0.9 rotation

ghiboz

23-05-2007 12:26:32

hi!
i tried to rotate a node managed by nxogre, but doesn't take effect....
how can I do this?

body = mScene->createBody(....);
body->getNode()->pitch( Ogre::Degree( 2.0f ) );


thanks

betajaen

23-05-2007 12:35:54

Of course it doesn't.

NxOgre pays absolute no attention to what changes you make to your scene node, infact once you changed it - NxOgre goes and puts it back where it was.

It's that evil.

You should adjust the orientation through the Actor.

ghiboz

23-05-2007 13:01:38

Of course it doesn't.

NxOgre pays absolute no attention to what changes you make to your scene node, infact once you changed it - NxOgre goes and puts it back where it was.

It's that evil.

You should adjust the orientation through the Actor.

thx...

body->moveGlobalOrientation(quaternion rotation);


is correct??
'cause doesn't rotate! :cry:

betajaen

23-05-2007 13:08:57

SetGlobalOrientation?

ghiboz

23-05-2007 13:27:03

SetGlobalOrientation?
:oops:

Caphalor

23-05-2007 13:28:06

I like the ogre rotation functions, so I used this "trick":


body = mScene->createBody(....);
body->getNode()->pitch( Ogre::Degree( 2.0f ) );
body->setGlobalOrientation(body->getNode()->_getDerivedOrientation());


In 0.4, it worked, I didn't try 0.9 yet. :(

Rhys

28-08-2007 14:00:02

I like the ogre rotation functions, so I used this "trick":


body = mScene->createBody(....);
body->getNode()->pitch( Ogre::Degree( 2.0f ) );
body->setGlobalOrientation(body->getNode()->_getDerivedOrientation());


In 0.4, it worked, I didn't try 0.9 yet. :(
A little bit late answer, but well...:)
It works with the current versions of Ogre and NxOgre, but for some reason you have to normalise the derived orientation of the body, otherwise the rotation will become odd. Maybe a problem with the ogre scene nodes...don't know.

nord

09-07-2008 18:21:28

I have tried but it didn't work for me.
My problem is, I create a car but the visualisation of my car is not facing the z axis but x axis. I have to rotate it 90 degrees to make it face the right direction and fit into the collision box. Here is my code. Thanks in advance.

mBody = mScene->createBody("carname; carbody.mesh;", new CubeShape(1.8,1.3,4.5),Pos, "mass: 1800");

mBody->getNode()->yaw(Ogre::Degree(90) );
mBody->setGlobalOrientation(mBody->getNode()->_getDerivedOrientation());

betajaen

09-07-2008 18:43:49

Use MeshMagick to rotate the car permanently. By the time you setup a scenenode system to do it, it isn't worth it.

nord

09-07-2008 18:52:00

I have already tried it. I have downloaded the meshmagick but I don't know how to use ogre command lines.. Where will I input a command like this ?

> MeshMagick transform -rotate=90/0/1/0 robot.mesh

Thanks..

betajaen

09-07-2008 18:54:27

In a dos prompt/command line window; but if you need help with that - you should ask on the main forums.

nord

09-07-2008 19:12:27

Thank you very much I have done it with meshmagick by inputting commands from dos command line.

But I wonder something. Why does nxogre ignores any rotation on the visual node of a body or actor?
Interestingly it does not touch the scale on the visual node on the other hand. (using nxogre 0.9 - 38 )

betajaen

09-07-2008 19:25:46

NxOgre sets the orientation of the SceneNode to whatever it wishes, it doesn't take account of it's initial setting.