11-08-2004, 02:05 AM
Is it possible to get the 2D coordonate on screen where un point (x,y,z) will be draw ?
11-08-2004, 07:17 AM
multiplying the point by the modelview and projection matrices should work
11-08-2004, 08:00 AM
that's a bit complicated ;)
the function is
GLdouble objX, objY, objZ;
GLdouble mm, pm;
GLdouble winX, winY, winZ;
gluProject(objX, objY, objZ, mm, pm, vp, &winX, &winY, &winZ);
objX/objY/objZ are the real world coordinates, model/proj/view are the current modelview/projection/viewport matrices, you get the window coordinates back in winX/winY/winZ. winZ is a normalized z-buffer value. concerning winY- for opengl, winY = 0 is at the bottom of the window, but for X11 (and i think windows as well) winY = 0 is at the top of the window. you have to consider that when you get window events.
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.