I gave up on this approach. Used another Camera that mimic HUD but with Prespective projection. Works now. Have to learn to stress less when looking for answers :-)
Cheers, Nick On Thu, Nov 14, 2013 at 1:32 PM, Trajce Nikolov NICK < trajce.nikolov.n...@gmail.com> wrote: > Hi Community, > > I would like to do this mentioned in the subject and I am facing issues. > Sounds pretty simple but need help. > > The model is attached to osg::MatrixTransform and I have > osg::UpdateCallback attached to it that sets the Matrix based on the > camera. So here is the snippet from the callback: > > osg::MatrixTransform* mxt = dynamic_cast<osg::MatrixTransform*>(node); > > osg::Vec3 pos = camera->getInverseViewMatrix().getTrans(); > osg::Quat rot = camera->getInverseViewMatrix().getRotate(); > > mxt->setMatrix(osg::Matrix::rotate(rot)*osg::Matrix::translate(pos)). > > It doesn't look right. What is wrong with this code? Also, there is some > delay (when I don't apply the orientation just for debug), the model when > attached is sort of delayed following the camera. Any hints? > > Thanks a bunch > > Nick > > -- > trajce nikolov nick > -- trajce nikolov nick
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org