how to rotate the model with a moving 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
gmaster_ck
Posts: 16
Joined: Tue Aug 05, 2008 3:30 pm

how to rotate the model with a moving axis

Post by gmaster_ck »

I have a model of jet engine, I want to make the blade rotate with its own axis, and meanwhile, the axis itself is moving and rotating with the jet plane. How can I realize it? Thank you! :D
VioletAlixe
Posts: 28
Joined: Thu Oct 04, 2007 9:03 pm

Post by VioletAlixe »

Parent the blade to the engine and have the blade rotate. Whatever happens to the engine will also happen to the blade (if you move the engine, the blade will be attached still), but the blade will be able to spin on it's own.


So make the engine the parent of the spinning blade.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Yeah, what violetAlixe says is your best bet, which means using a modelling program to seperate the blade from the jet model and so you have two models to load, the jet (minus blade) and the blade, then you make nodes out of both of them, make the jet the parent of the blade and adjust the blades transformation so that it's lined up where it should be, then you can just use setRotation() to rotate it as you would expect a blade to rotate on a plane.
Image Image Image
gmaster_ck
Posts: 16
Joined: Tue Aug 05, 2008 3:30 pm

Post by gmaster_ck »

get it done! thanks a lot. :D
Post Reply