TireOrientation in my SimpleVehicle

teeum

21-11-2007 11:58:43

Hi,

I'm working on a schoolproject, we have to make a 3D game. I'm trying to get a car driving around with my own 3D model.

Now I have some troubles with the tires. The demo is driving and that's doing fine for now, but when I use my own model the tires are oriented wrong.

I tried to fix this with changing the orientation as following:
Ogre::Quaternion tireorient;
if (x == -1 && z == -1)
tireorient = Ogre::Quaternion(Ogre::Degree(180), Ogre::Vector3::UNIT_Y);
if (x == -1 && z == 1)
tireorient = Ogre::Quaternion(Ogre::Degree(0), Ogre::Vector3::UNIT_Y);
if (x == 1 && z == -1)
tireorient = Ogre::Quaternion(Ogre::Degree(180), Ogre::Vector3::UNIT_Y);
if (x == 1 && z == 1)
tireorient = Ogre::Quaternion(Ogre::Degree(0), Ogre::Vector3::UNIT_Y);


Well the tires are looking good now, I was Wow cool! But then I wanted to drive away it seems the tires both go another way and that makes the car standing still.

I tried to find a solution for it on the forum, but I didn't find it. Only thing I can think of is that I changed the body of the tire instead of the mesh, but I'm not sure anymore.

I tried to rotate the node, instead of chaning the orientation, but that doesn't do anything. I did it as following.
Ogre::Quaternion r = Ogre::Quaternion(Ogre::Degree(-90), Ogre::Vector3::UNIT_X);
node->setOrientation(r);

This doesn't do anything at all. Not to unit_x, z or y.

I hope my problem is clear, if not pls say so, I can upload some pictures or more samplecode, but it's almost the same if not the same as the simple vehicle demo.

Thx for any help!
Teeum

EDIT:

Well I'm sure now I changed the orientation of the body. It makes sense to me the car won't drive this way. I tried to rotate the mesh of my wheel, but that doesn't work. The node->setScale(..) does it's job, but when I add node->setOrientation(quaternion) or node->roll/yaw/pitch().. etc. it doesn't effect the wheels :?:

I don't know what to do anymore.. Do I have to make 2 wheels in 3dmax, one for the left side and one for the right? That wouldn't make sense to me :shock:

teeum

25-11-2007 11:11:50

Well finally I found my stupid question. I've set the torque on one of the wheels in a minus direction. This way they rotate in the same direction.

Learning all this new things in such a short time is a hard thing to accomplish. (C++, Orgre, Newton, VC8 argh :P )