[osg-users] Computing Image Co-ordinates

Harash Sharma harashsharma at yahoo.com
Wed Sep 5 05:10:37 PDT 2007


Hi All,
   
      I want some help regarding computation of projected model co-ordinates. The problem is like this. I have a cuboidal model (car). I have been able to compute its bounding box -- so I know the world co-ordinates of the car bound corners. The scene is being rendered to a texture with an image size of MxN Pixels. I would like to calculate the image co-ordinates corresponding to the 8 bounding box corner co-ordinates. Is there any function available in OSG which I can use to achieve this. If not, it would be very kind of you to indicate some  pointers on how to do it. I thought it would be as simple as multiplying the model vectors by the osg::View::getCamera()->getViewMatrix() * osg::View::getCamera()->getProjectionMatrix(), but I think I am missing something. 
   
     Please Help. Thanks in advance.
   
  Regards
   
  Harash

       
---------------------------------
Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, when. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20070905/9a36fd86/attachment-0003.htm>


More information about the osg-users mailing list