rotate scene node

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
Varn1807
Posts: 7
Joined: Tue Jun 07, 2011 12:23 pm

rotate scene node

Post by Varn1807 »

How can i make an animation to rotate a scene node for 180 degrees and then stop.
Is there a specific function?
Because CreateRotationAnimator it rotates it non-stop. I want it to stop after it rotates 180 degrees.

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

Post by CuteAlien »

Doesn't seem to be supported so far. So you have to write your own animator for that.
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
Varn1807
Posts: 7
Joined: Tue Jun 07, 2011 12:23 pm

Post by Varn1807 »

and may i ask some ideeas how to do that??
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

I would take the source of the RotationAnimator as a start point. Then simply add a check if the rotation is 180 degrees and from there on stop any further rotation.
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
Varn1807
Posts: 7
Joined: Tue Jun 07, 2011 12:23 pm

Post by Varn1807 »

thanks for the advice I have done it :)
now for another question( i'm sorry if i'm asking too many questions ), i don't need any code I only need ideas.
for example how do you make a scene node appeear , it does it's animation, then another one appears, it does it's animation and so on.
I don't want all of them to appear at the same time and do their animations, I want them to appear in an order.
Thanks
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

Varn1807 wrote:thanks for the advice I have done it :)
now for another question( i'm sorry if i'm asking too many questions ), i don't need any code I only need ideas.
for example how do you make a scene node appeear , it does it's animation, then another one appears, it does it's animation and so on.
I don't want all of them to appear at the same time and do their animations, I want them to appear in an order.
Thanks
You might need another layer for logic to do this and do the things exactly as you said yourself.
Working on game: Marrbles (Currently stopped).
Varn1807
Posts: 7
Joined: Tue Jun 07, 2011 12:23 pm

Post by Varn1807 »

have no idea about layers :| can you explain a bit
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

Varn1807 wrote:have no idea about layers :| can you explain a bit
I mean on top of irrlicht framework that would do what you want. It might be some Object classes that hold nodes and manipulates them the way you need. Also a manager for those object would be nice (Like scene manager irn irrlicht). It's up to you to design it.
Working on game: Marrbles (Currently stopped).
brick
Posts: 36
Joined: Sun Jul 10, 2011 12:15 pm

Re: rotate scene node

Post by brick »

I have a somewhat similar question. Nodes that I have created can be moved by WASD keys. I want them to face the direction in which they're moving. Say, if they're facing east, I want them to instantly turn west when I push A. However, I just can't seem to find a way to turn the ndoes. There's a rotation animator, but that's not what I want. I just need the node to instantly turn around. Is there a method which takes the angle of rotation as a parameter, and then instantly performs rotation?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: rotate scene node

Post by hybrid »

Maybe go throught the examples first. They have a purpose: Learning the basics of Irrlicht. Anyway, check the scene node API. There's also rotation and movement without animators.
brick
Posts: 36
Joined: Sun Jul 10, 2011 12:15 pm

Re: rotate scene node

Post by brick »

You're right, thanks. I've found a way to rotate it successfully.
Post Reply