CreateRotationAnimator on arbitrary axis

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
pilesofspam
Posts: 62
Joined: Mon May 11, 2009 4:31 am

CreateRotationAnimator on arbitrary axis

Post by pilesofspam »

I'm building a project that includes a few asteroids tumbling through space. To get a nice stable tumbling, I used CreateRotationAnimator from the 11.PerPixelLighting example (where you set the earth turning slowly).

My problem is that if you specify any more than one of the Cartesian axes for tumbling, you get sort of an intelligent spin. What I'd rather is tumbling around an arbitrary axis. Guess I can do it manually, but it sure would be nice if there was a way to do it with CreateRotationAnimator. Does anybody have experience with this?

Thanks,

Dave
CuteAlien
Admin
Posts: 9933
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: CreateRotationAnimator on arbitrary axis

Post by CuteAlien »

I suppose you have to write your own rotation animator for that. Irrlicht still might help you a little bit - the quaternion class has a function to create a quaternion from an axis + angle. And then you can convert the quaternion to a rotation matrix or to euler angles.
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