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
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to