On 12/2/2011 6:09 AM, Stefanos Kougiou wrote:
Hi,
I would like to thank you for your answers. Especially for the website Skylark
, it really got me started on the subject. I will definitely search more info
on the 4x4 matrix.
Now about the distances I admit that I wasn't clear :). I need the distance
from the camera to the center of a given 3d model(OSG Node). For the position
of the 3D model I would like to use the function getTransformationMatrix() of
the node.
Is it possible to use getTransformationMatrix on the camera node? Then I would
use the method that Skylark suggested and my problem will be solved. As for
scale, as far as I know my models are not scaled in runtime.
If you multiply the object center by the camera's modelview matrix, the length
of the resulting eye space vector is the distance.
I strongly encourage you to learn OpenGL. Get the OpenGL Programming Guide.
Older copies are available online for free, and they cover topics such as these.
--
-Paul Martz Skew Matrix Software
http://www.skew-matrix.com/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org