"Rotate Animation" for racing game

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
paradoximo
Posts: 18
Joined: Sun Jan 24, 2010 6:13 pm

"Rotate Animation" for racing game

Post 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
Image
Murloc992
Posts: 272
Joined: Mon Apr 13, 2009 2:45 pm
Location: Utena,Lithuania

Post 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. :)
paradoximo
Posts: 18
Joined: Sun Jan 24, 2010 6:13 pm

Post 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
Image
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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.
paradoximo
Posts: 18
Joined: Sun Jan 24, 2010 6:13 pm

Post 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. :(
Image
CuteAlien
Admin
Posts: 9689
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Well, as hybrid mentioned - we really need to see the code to help.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply