Hi,

Akilan Thangamani wrote:
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?
Do you want to rotate the camera or the geometry you are looking at? The camera with identity view matrix looks along -z axis, you are rotating about x.

What is the problem in this?
I don't know what you want to do, so I cannot say. Try to explain what you expect. What are you currently getting?

jp



}
}




Thank you!

Cheers,
Akilan

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=17131#17131





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support.

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to