- glGetDoubleV(GL_MODELVIEW_MATRIX, Addr(ModelView));
- glGetDoubleV(GL_PROJECTION_MATRIX, Addr(Projection));
- glGetIntegerV(GL_VIEWPORT, Addr(viewport));
- gluProject(-1,-1, 0, ModelView, Projection, ViewPort,@x1,@y1,@z);
- gluProject( 1, 1, 0, ModelView, Projection, ViewPort,@x2,@y2,@z);
- if x1<x2 then begin FLeft:=round(x1); FRight:=round(x2);end else begin FLeft:=round(x2); FRight:=round(x1);end;
- if y1<y2 then
- begin
- FTop:=Application.MainForm.ClientHeight-round(y2);
- FBottom:=Application.MainForm.ClientHeight-round(y1);
- end else
- begin
- FTop:=Application.MainForm.ClientHeight-round(y1);
- FBottom:=Application.MainForm.ClientHeight-round(y2);
- end;