- Procedure Koordinaten(mpX, mpY : Integer; Var X,Y,Z : glDouble);
- Var
- Viewport : Array [1..4] Of Integer;
- ModelView : Array [1..16] Of Double;
- Projection : Array [1..16] Of Double;
- winZ : glFloat;
- Begin
- ZeichneSzene;
- glGetDoublev(GL_MODELVIEW_MATRIX, @ModelView);
- glGetDoublev(GL_PROJECTION_MATRIX, @Projection);
- glGetIntegerv(GL_VIEWPORT, @Viewport);
- glReadPixels(mpX, -mpY, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, @winZ);
- gluUnProject(mpX, viewport[4]-mpY, winZ,
- @ModelView, @Projection, @ViewPort,
- X, Y, Z);
- End;