Hi Ijustfu, It's not possible to guess what is wrong with your code from the little snippet you've provided. The only thing we can do is make general notes about setting the camera view matrix, and the first thing to do is to use a full viewer frame loop rather than the viewer.run() convenience method so have a loop like:
viewer.realize(); while(!viewer.done()) { viewer.advance(); viewer.eventTraversal(); viewer.updateTraversal(); viewer.getCamera()->setViewMatrix(myViewMatrix); viewer.renderingTraversals(); } Robert. 2009/5/19 ijustfu <ijus...@163.com>: > Dear All, > I want to control virtual camera by a remote computer and local mouse. > Anybody know how to make two controls work at the same time? > > I did it as following, but do not work. > Firstly, following functions are invoked. > mViewer->setCameraManipulator(NULL); > mViewer->getCamera()->setViewMatrixAsLookAt(); > Then to get the handle of camera from mViewer with > mViewer->getCamera()->setViewMatrixAsLookAt(); > but reply the NULL. > Thus, I can not set my camera at a desired location. > > Show your comments to help me. > Thanks. > > > 2009-05-19 > ________________________________ > ijustfu > > > 请教一个关于setViewMatrixAsLookAt函数的问题 > > 如果先调用mViewer->setCameraManipulator(NULL);然后再调用mViewer->getCamera()->setViewMatrixAsLookAt(),此时的setViewMatrixAsLookAt有效;如果mViewer里面存在一个照相机控制器,然后调用mViewer->getCamera()->setViewMatrixAsLookAt(),此时的setViewMatrixAsLookAt函数无效,即不能够把照相机定位到想要的位置,场景无任何变化。 > > 请问哪问朋友遇到后面这种情况没有,可能出现的问题在那里,应该如何,才能使setViewMatrixAsLookAt该函数有效呢?先谢谢各位 > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org