Hi all,
I am new to osg and 3d graphics in general and I need a little advice on how to
adjust the camera based on a matrix. I need a camera that will always be
focused at (0,0,0), but has the capabilities to rotate around the origin so
that it moves in a circular motion.
This is my code so far:
Code:
osgGA::TrackballManipulator *tman = new osgGA::TrackballManipulator();
tman->setVerticalAxisFixed(true);
osg::Vec3 eye(10, 10, 0);
osg::Vec3 center(0, 0, 0);
osg::Vec3 up(0, 0, 1);
tman->setHomePosition(eye, center, up);
I'm using Qt to embed this window, so on repaint I have:
Code:
void OSGWidget::paintEvent(QPaintEvent* eve)
{
osg::Matrixd matrix = this->getCameraManipulator()->getMatrix();
//manipulating the matrix
this->getCameraManipulator()->setByMatrix(matrix);
frame();
}
I assume that I need to multiply my camera manipulators matrix by another one,
but I'm not sure what the right matrix is. Any help is appreciated!
Thanks.
Braden
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=47505#47505
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org