Page 1 of 1

"Rotate Animation" for racing game

Posted: Thu Nov 04, 2010 5:56 pm
by paradoximo
Hi :D

I have a simple question.
How to write a rotating 3d model and set speed of that "rotating animation". I think i don't have to make that animation in modeler :/.

I think about rotating animation with car chosing.Is here anyone who did never see a car changer in racing game? :P

Posted: Thu Nov 04, 2010 6:55 pm
by Murloc992
How about:

Code: Select all

ISceneNodeAnimator* ani=smgr->createRotationAnimator(vector3df(0,1,0));
carNode->addAnimator(ani);
ani->drop();
It will rotate your car node on Y axis, and it must be what you want. Also you can tweak the speed or the rotation direction. :)

Posted: Thu Nov 04, 2010 8:22 pm
by paradoximo
Thanx for reply :D

your code lines seems to be good but i tried to paste them and when i compiled it the program did and error in console and crashed.

BTW I'm editing a "Hello World" demo :P and your "CarNode" is just node from line
IAnimatedMeshSceneNode* node = smgr -> addAnimatedMeshSceneNode( mesh ); //mesh is model of car
Any suggestions / help :D :P?

Btw i can upload a code if you want

Posted: Fri Nov 05, 2010 9:08 am
by hybrid
Since this is only a trivial example, you should post the code in code tags directly in the forum. Moreover, you have to check the console output. Probably either your dll was not found, or the mesh was not found.

Posted: Fri Nov 05, 2010 9:52 am
by paradoximo
hybrid: I know it's just trivial example ;)

Application works but crashes with errors like "x458478476 x868576857 x6978987956" and quits with message to sending a problem to microsoft base x].

I know where to put every line from Murloc992's but i doesn't work well anyway. :(

Posted: Fri Nov 05, 2010 10:06 am
by CuteAlien
Well, as hybrid mentioned - we really need to see the code to help.