Page 1 of 1

Reset rotation value . . .

Posted: 24 Jul 2012, 14:47
by spikylaura
Hi all,

This is probably one of those very simple things when you know how: I would like to rotate an object on one axis, and when 360 degrees is complete, reset the value to 0, but without the object spinning back.

Hope you can help.

Many thanks

Paul

Re: Reset rotation value . . .

Posted: 24 Jul 2012, 20:52
by chriss0212
have you tried to use the modulo propertie?

greetz

christian

Re: Reset rotation value . . .

Posted: 25 Jul 2012, 09:47
by Daniel Willer
Chris is right just take a float expression and make a modulo 360. The resulting expression would look like
A % 360

Re: Reset rotation value . . .

Posted: 25 Jul 2012, 09:59
by spikylaura
Thanks for your quick replies. I'm unfamiliar with the Modulo property, so thanks for the heads up. I'll have a look today and let you now how I get on.

Many thanks,

Paul

Re: Reset rotation value . . .

Posted: 25 Jul 2012, 12:09
by spikylaura
Rotation Example.vza
(9.54 KiB) Downloaded 480 times
I have attached an example to illustrate what I'm trying to achieve. The object has 2 sides - A & B. There are 3 animation states - S1, S2 and S3. S1 shows side A at 0 deg, S2 shows side B at 180 deg S3 shows Side A again at 360 deg.

What I would like to happen is when the animation reaches S3, to effectively swap to S1, or 0 deg, without the object "rewinding' through 360 deg.

I'm not quite sure how to use the modulo function of the Math Effects, so I don't know if this will achieve what I'm trying to do.

Many thanks for any help you can offer.

Paul

Re: Reset rotation value . . .

Posted: 25 Jul 2012, 14:28
by TobiTobsen
Hi,
what modulo does is that it returns the rest atfter dividing.
For a few programming languages a "%" is the sign for the modulo operation.
So lets say 180%360 returns 180.
540%360 returns again 180.
360%360 retrurns 0 as there is no rest.

I can not really see the flipping problem in you scene but i have attached a scene with a modulo expression.

Cheers,
Tobi

Re: Reset rotation value . . .

Posted: 30 Jul 2012, 12:53
by Stefan Goerke
Hi,

it is possible to jump from one value to another by using the "jump" interpolation type in the diagram view of the animation editor.
see aso here:
http://www.ventuz.com/support/help/v3_0 ... ditor.html

Sometimes using the Mover node could be also an opportunity.

with best regards,
Stefan