hi list

i'm trying to project the radius of a bounding sphere onto the 
screen to get the area of the sphere in viewport coordinates.

something is wrong with the code below. somehow, i'm missing the 
conversion from world into to screen coordinates... i did not find 
any hints in the documentation so far.

Action::ResultE AreaLOD::draw(Action *action)
{
   RenderAction* ra = dynamic_cast<RenderAction*>(action);

   ...

   DynamicVolume vol = ra->getActNode()->getVolume(false);
   vol.morphToType(DynamicVolume::SPHERE_VOLUME);
   SphereVolume sphereVol = (SphereVolume&)vol.getInstance();
   Real32 radiusWorld = sphereVol.getRadius();

   Matrix matToScreen
   ra->getCamera()->getWorldToScreen(matToScreen,
     *ra->getViewport());
   sphereVol.transform(matToScreen);

   Real32 radiusScreen = sphereVol.getRadius();

   ...
}

any ideas?

thanks a lot,
simob

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to