View Single Post
# 4 03-02-2013 , 07:43 PM
ieoie's Avatar
Registered User
Join Date: Aug 2007
Location: The Netherlands
Posts: 88

You can do this by the following function: (3/2) * (sin(x) + 1)

You also have to remember that in Maya, sine expects units in radians, meaning that 2*pi = (~6.28) = one full cycle of sine. Therefore, in 6 frames, you make a complete cycle of sine. In your expression, you have halved that (remember that multiplying inside the brackets does the opposite transformation), so it now takes 3 frames to cycle completely. The minimums and maximums of sine are found at pi/2 and (3*pi)/2. (Green lines) Since (2*pi)/3 = ~2.1, you are jumping past pi/2, and again past (3*pi)/2. In the example where you are currently hitting are the red lines.

user added image

In short:
float $speed = 0.02;

pCube1.rotateZ = (3.0 / 2.0) * (sin(frame * (1.0 / $speed)) + 1);


trying to combine the commands shown here with a previous one about a flickering light
would you be willing to explain this a little more further....
or maybe i have to open a new thread with an explanation of my goal......???


*
The Universe is larger then you ever can think, But smaller then the size of your imagination.

all are welcome at www.ieoie.nl