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