Hi Stephan,
What you need to do is transform you vertex from the 3d objects space
into window coordinates, and then from window coordinates back into
hud object space. If the viewport is the same for both the 3d
subgraph as for the hud then the window transform isn't required, then
you can just transform into eye space and back out.
Something like:
osg::Matrix localToEye = LocalToWorld *
camera_3d->getViewMatrix() *
camera_3d->getProjectionMatrix();
osg::Matrix eyeToHUD;
eyeToHUD.invert(camera_hud->getViewMatrix() *
camera_hud->getProjectionMatrix());
osg::Matrix localToHUD = localToEye * eyeToHUD;
On 4/22/07, Stephan Huber <[EMAIL PROTECTED]> wrote:
Hi
this is perhaps a stupid question, but I can't wrap my head around it.
Here's what I want to do:
I have an object attached to the root of the scenegraph, and a hud,
displaying some additional info. I want to connect a certain point of my
object with a certain point in my hud. For this I have to transform the
vertice of the object into the space of the objetc attached to my hud.
I can get the world-coord of the vertice via osg::localToWorld but how
can I transform this vertice into the "space" of the hud? Do I have to
apply the view and projection matrices of the cameranodes in the nodepath?
I there some built-in method in osg to transform from one local space to
another local space across multiple projections?
Thanks for any pointers,
Stephan
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/