Hi,
I understand that this problem has already been discussed . But as I was not
able
to understand clearly I post my simple camera rotation problem., I written a
code
osg::ref<osg::Camera> g_camera=new osg:::camera;
g_camera->setProjectionMatrix(osg::Matrix::ortho2D(0,1,0,1));
g_camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
g_camera->setViewMatrix(osg::Matrix::Identity());
g_camera->setClearMask(GL_DEPTH_BUFFER_BIT);
g_camera->setRenderOrder(osg::camera::POST_RENDER);
g_camera->setAllowEventFocus(true);
g_camera->addChild(create_geometry()); //create_geometry() fn will return a
geode with //a drawable added
......
..........
.......
osgViewer::Viewer viewer;
viewer.setSceneData(g_camera.get());
.....
while(!viewer.done())
{
if(isKey_R_pressed){
....
......
osg::Matrixd vmat=g_camera->getViewMatrix(); //here i get the camera thru
traversal
vmat.makeRotate(osg::DegreesToRadians(45.),osg::osg::Vec3f(1.,0.,0.));
g_camera->setViewMatrix(vmat);
....
.....}
viewer.frame();
}
}
I dont understand how my geometry is not getting rotated?
What is the problem in this?
}
}
Thank you!
Cheers,
Akilan
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=17131#17131
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org