[osg-users] how to update the Camera
Wu Xiaodong
wuxiaodong82 at gmail.com
Sun Mar 2 18:35:32 PST 2008
Hi, I am freshman in OpenSceneGrapph. Now I have some issue on updating the
Camera when the Geode under it was updated.
the details of the issue is as following.
1st step. I build a viewer and its scene graph with only one osg::Geometry
which contains nothing. and set a TrackballManipulator to the viewer's
camera;
* osg::ref_ptr<osgGA::TrackballManipulator> trackBall = new
osgGA::TrackballManipulator;
setCameraManipulator( trackBall.get() );
* 2nd step. I update the one Geometry by a object of the class derived from
the Geometry node's UpdateCallBack class;
the default track ball center seems to be the (0,0,0); when the Gemetry is
updated, the Geometry node's center is changed into (x0,y0,z0); but the
track ball rotate around the vertex ( 0,0,0). How can I make it rotate
around the (x0,y0,z0 );
I read the OSG's reference docs, may I can achieve it by
setPreDrawCallback<file:///E:/Oil/OpenSceneGraphReferenceDocs/a01059.html#a76>(
DrawCallback <file:///E:/Oil/OpenSceneGraphReferenceDocs/a01061.html> *cb) .
Is there any advice about the application above, Thanks.
Xiaodong Wu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080303/72035716/attachment.htm
More information about the osg-users
mailing list