In my case,the renderer of the camera is null,so it is not a solution.Thank you 
anyway.------------------ ???????? ------------------
??????: "LearningOSG LearningOSG"<[email protected]>
????????: 2014??7??1??(??????) ????3:18
??????: "OpenSceneGraph Users"<[email protected]>;
????: Re: [osg-users] how to get view pointer from cullvistor


Hello?Wu Zhicheng,? Try following code will help you
 ??? ? ? osgViewer::Renderer* renderer = 
dynamic_cast<osgViewer::Renderer*>(_p_viewer->getCamera()->getRenderer());
? ? ? ? assert(renderer);
 ? ? ? ? p_sceneView=renderer->getSceneView(0);
? ? ? ??p_sceneView->getViewMatrix()
? ? ? ?p_sceneView->getProjectionMatrix()


? cheers

 

 Learned osg six months



2014-07-01 9:52 GMT+08:00 ttaw <[email protected]>:
 Hi, all:
 ? I'm trying to get view pointer in traverse function. I used:
 CullVisitor *cv = dynamic_cast<Cullvsitor *>(nv);
 cv->getCurrentCamera()->getView();
 ? This wouldn't work if the current node is a child of a Camera node which is 
in the scenegraph.I'm wondering how to achieve this. Could anybody give me some 
advices? Thanks in advance.
 ?
  ------------------
  Failure is the mother of success.
 Wu Zhicheng


 ?

_______________________________________________
 osg-users mailing list
 [email protected]
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to