So I played around few control lines to spinning pinwheel.
The expression lines in that picture is
Flags1.rotateZ = time*cos(time+100);
Flags2.rotateZ = time*cos(time+80);
Flags3.rotateZ = time*cos*time+70);
The Flags1 is the middle, 2 is left and 3 is right one. The middle one was the main pinwheel so I wanted to spin faster than other two.
The expression I wrote means : the flags' rotateZ value increases as the value of time multiplying by cos(time value+100 / 80 / 70).
Another try was
flags1.rotateZ = -time * 150 * sin(time*2);
flags2.rotateZ = flags3.rotateZ = -(time*100);
which means : flags1's rotateZ value increases by time and 150times faster and its spinning way is decided by sin(time*2) value.
As I used cos and sin function in the line, it was spinning left and right as the value of cos graph goes to + and -.
After Playing around with expression in many different ways, I made it proper pinwheel island.
I textured it as well. I wanted the pinwheel spins faster as time goes by.
So the expression was
flags1.rotateZ = time*(time+100);
I multiplied (time+100) because it need to get faster.
The result is :
The outcome is exactly what I wanted. I really liked using expression, reminding old days and I have been thinking studying MEL scripting and expressions really seriously. As soon as this project finishes, I will start up studying MEL and expressions!
No comments:
Post a Comment