[Robotics] getScreenPosition

Benoit Bolsee benoit.bolsee at online.be
Thu Aug 20 18:53:20 CEST 2009


The (x,y) coordinate are obtained by going through the normalize openGL
coordinate transformation chain:
 
world (x,y,z) -> camera (x,y,z) -> device (x,y,depth) -> screen (x,y)
screen(x,y) is the position in pixel on the screen where the world
(x,y,z) is projected. (0,0) is the bottom left corner of the screen,
(screenx, screeny) is the top right corner.
The BGE implements a last transformation step and converts screen(x,y)
to a normalized blender viewport coordinate such that (0.0,0.0) is the
top left pixel of the viewport and (1.0,1.0) is the botton right pixel.
If you want to have pixel coordinate, you must revert this last step.
Unfortunately, it looks like the viewport dimension is not available
from the python API.
 
Benoit

-----Original Message-----
From: robotics-bounces at blender.org [mailto:robotics-bounces at blender.org]
On Behalf Of Hervé Legrand
Sent: jeudi 20 août 2009 16:58
To: robotics at blender.org
Subject: [Robotics] getScreenPosition


Hello,

I wonder how the (x,y) coordinates of function getScreenPosition() are
obtained.
What combination of matrices or quaternions are used?

How can we pass to 3D coordinates in the global scene to the 2D
coordinates in the screen placemark?

thank you for your answers.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/robotics/attachments/20090820/d220cc1d/attachment.htm 


More information about the Robotics mailing list