[osg-users] Setting camera position
Hi, I am using a Trackball Manipulator in my application. I want the camera to have a fixed look-at direction along the negative z-axis, and a fixed up direction along the positive y-axis. But I want the camera to change its position according to an array. Eg:- Consider the array of positions to be as follows: 0,0,0 10,10,10 20,10,10 So, I want the camera to be positioned at (0,0,0), then at (10,10,10), and finally at (20,10,10). How can this be done? Thank you! Cheers, Utkarsh -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47792#47792 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Setting camera position
How and when do you want it to change position? You can change position explicitly via the camera manipulator interface; there are a number of different convenience methods for that. If you want the position to change gradually over time (animation) then take a look at the osgGA::AnimationPathManipulator. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47794#47794 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Setting camera position
Hi, I want to change the position of the camera according to a counter. When the counter is 0, camera should be at (0,0,0), when counter is 1, camera should be at (10,10,10) and so on. I tried using the camera manipulator function setTransformation as follows: osg::ref_ptrosgGA::TrackballManipulator tman=new osgGA::TrackballManipulator(); //setTransformation(eye, center, up); tman-setTransformation(osg::Vec3(0,0,0), osg::Vec3(0,0,-1), osg::Vec3(0,1,0)); But it didn't work when the counter reached 1, 2, Did I commit a mistake there? Thank you! Cheers, Utkarsh -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47795#47795 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org