how to rotate in an animated loop?

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
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

how to rotate in an animated loop?

Post by afecelis »

Hi guys!

Is there an animator to make a 3d model spin 360 degrees in the "Y" axis?

how would that be done? I want a model to show up as a projected hologram rotating in a loop.

thnx!
Image
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

Crud, how do I do this again?
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

Thnx Saigumi. I tried and tried and tried using the API before but without success. Remember I'm not a programmer. That's why I brough it up here, to try it thru an example. I'm more like a code vampire.

If you may post some example code on how to declare the animator and then attach it to a 3d model node would be lovely.

thanks!!! :D
Image
r2d2
Posts: 211
Joined: Mon Nov 24, 2003 5:22 pm

Post by r2d2 »

Code: Select all

scene::ISceneNodeAnimator *anim2 = smgr->createRotationAnimator(core::vector3df(0, 1, 0));
	mnode->addAnimator(anim2);
	anim2->drop();
mnode is the node of the object you want to rotate
core::vector3df is the axis and the speed it should turn around it
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

thnx again r2! gonna try it now!
Image
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

whoohooo!!!


that did it!

Man it was the simplest way. I was complicating things up. Where do you set the speed of rotation? If I place it wrong it gives me an error that the animator doesn't work with 2 values.

cheers!
Image
r2d2
Posts: 211
Joined: Mon Nov 24, 2003 5:22 pm

Post by r2d2 »

core::vector3df is the axis and the speed it should turn around
Post Reply