[osg-users] NodeTrackerManipulator's look position setting

ümit uzun cush_umit at hotmail.com
Fri May 2 07:14:41 PDT 2008


Hi All;

I have an aircraft. Before I add the aircraftNode to my scene I rotate with;

/***********************************************/
mAircraftTransform->setMatrix( osg::Matrix::scale( size, size, size ) *
				       osg::Matrix::rotate( osg::DegreesToRadians( 90.0f ), 1.0f, 0.0f, 0.0f ) *
				       osg::Matrix::rotate( osg::DegreesToRadians( -90.0f ), 0.0f, 0.0f, 1.0f ) *
				       osg::Matrix::rotate( osg::DegreesToRadians( 5.0f ), 1.0f, 0.0f, 0.0f ) );
/***********************************************/

setMatrix command. And then I add this node my scene node. When I add the aircraft node to the my NodeTrackerManipulator node, NodeTracker is looking the plane from under it. And then I use setByMatrix and setHomePosition to look from behind to the aircraft. But it didn't work.

How can I rotate the camera for the NodeTrackerManipulator? My code is like that;

/***********************************************/
osg::ref_ptr tm;
	tm = new osgGA::NodeTrackerManipulator;
        tm->setTrackerMode(trackerMode);
        tm->setRotationMode(rotationMode);
	/*tm->setHomePosition(osg::Vec3d(0.0,-100.0,10.0),//homeEye
                            osg::Vec3d(0.0,0.0,0.0),//homeCenter
                            osg::Vec3d(0.0,100.0,0.0),//homeUp
                            true); // do not auto calculate home*/
        tm->setTrackNode( sProg->mAircraftModel.get( ) );
	tm->setByMatrix(sProg->mAircraftTransformPAT->getAttitude()); 
/***********************************************/

All advices would welcomed with glad :)

ÜMİT UZUN

_________________________________________________________________
Şimdi aileye katılmanın tam zamanı - Yeni nesil Ücretsiz Windows Live Hizmetlerini şimdi edinin!
http://get.live.com


More information about the osg-users mailing list