From: Tone Milazzo (tone1971++at++yahoo.com)
Date: 05/28/2003 15:23:34
Goal: To translate the world coordinates of objects the person is seeing
in the environment into pixel coordinates. i.e. wherever an object is in
the scene if the person is looking straight at it the screen x,y should be
0,0.
Since there doesn't seem to be a method in pfChannel to translate
world-to-screen and vise-versa, I'm using the glu function "gluProject"
instead. But the numbers I get for winx, winy, winz don't seem right ( I
am adjusting for the fact that my origin is in the center of the screen
and gl's in in the lower left corner) The Y especially seems to be off
always returning a value that is to the right of center, even if the
object is in the left of the view. Here is what I'm using:
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glGetDoublev( GL_MODELVIEW_MATRIX , model );
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glGetDoublev( GL_PROJECTION_MATRIX , proj );
gluProject( objx, objy, objz, model, proj, view, &winx, &winy, &winz);
Environment: Window with four pfChannels, one in each corner of the
display. All four channels are pointing to the same scene but from
diffrent angles.
The camera in the upper left is from the perspective of a virtual person
(rendered with BDI's Diguy software). Also in the scene are a number of
Performer objects (3D studio max)
Machine: Dual processor PIIIs in Redhat linux 7.3
-Tone
=====
Dance like it hurts,
Love like you need the money,
And work when people are watching.
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com
This archive was generated by hypermail 2b29 : Wed May 28 2003 - 15:24:12 PDT