Hi Sebastian, thanks for the quick reply!

i`m pasting here below, the part of the code that deals with the camera matrix:


Code:


osg::Matrixd cameraMatrix;
osg::Matrixd cameraRotation;
osg::Matrixd cameraTrans;
osg::Matrixd cameraZoom;


cameraRotation.makeRotate( roll, vec3(0,1,0), pitch, vec3(1,0,0), heading, 
vec3(0,0,1) );

osg::Vec3f pos = nodeTrackerManip->getMatrix().getTrans();
cameraTrans.makeTranslate( pos.x(), pos.y(), pos.z() );

cameraMatrix = cameraRotation * cameraTrans;

cameraMatrix.invert(cameraMatrix);

// from OpenGL (Y up) to OSG (Z up)
osg::Matrixd rotationToYUp;
rotationToYUp.makeRotate( -osg::PI / 2.0, osg::Vec3(1.0, 0.0, 0.0) ); 

//===========================================
// ---------> here is the problem. If zoom is > 1 then the clouds won`t be 
visible anymore...
cameraZoom.makeScale( zoom, zoom, 1 );
//===========================================

cameraMatrix = cameraMatrix * rotationToYUp * cameraZoom;





Thank you!

Cheers,
lawrence

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





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

Reply via email to