Hi Paul, On 12/5/06, Paul Cummings <[EMAIL PROTECTED]> wrote:
That is exactly right.
To add a axis that orients with the model coordinates but relative with eye coordinates you'll need to get the orientation part of the main cameras view matrix, you can use osg::Matrix::get(osg::Quat&) to do this and then rebuild new matrix for to place you axis subgraph in eye/HUD coordinates. The other way would be rather than placing the axis in eye coordinates, is to place it in to the model coordinates, but update the translation per frame to keep it relative to the where you want to place it on screen. Again you'll need to main cameras view matrix to be able to compute this. The most elegant way to implement this functionality would probably to subclass from osg::CameraNode and override the computeWorldToLocal/LocalToWorld so that it places the subgraph relative to the orientation of the inherited modelview matrix, by finally placed absolute position. Such a custom node would allow you to decouple the setting of the view matrix entirely from the other components of the scene graph/application - you could simply add it to scene graph and forget about it. Perhaps one day I'll have time to code the above solution as an example, don't have time right now though so you'll have to solder on. Robert. _______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/