Hello. I [newbie] have got 2 basic questions.
1)I got two models (3DS) loaded into scene graph. I want to rotate and
translate them along their centers. I have done it manually with keyboard but
is there any built in functionality for this pupose where you select the node
and rotate and translate it along its center(not camera's center)?
2)Other problem is I have done manual rotation using keyboard event
void Model::SetRotation(osg::Vec3d rot)
{
mModelPat->setAttitude(osg::Quat
(osg::DegreesToRadians(rot.x()),osg::Vec3d(1,0,0),
osg::DegreesToRadians(rot.y()),osg::Vec3d(0,1,0),
osg::DegreesToRadians(rot.z()),osg::Vec3d(0,0,1)));
}
But how can I get angle for x, y & z axis out of this PAT (getAttitude())?
Putting it simple, how can I make a check to say that when model has x-axis
angle>45 Degree, do some thing. I think I need to do some calculations with
osg::Quat, but can not figure out.
Any help will be appreciated.
Regards
---------------------------------
Cheap Talk? Check out Yahoo! Messenger's low PC-to-Phone call rates.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/