user2783211
user2783211

Reputation: 178

Tool rotation transformation and animation

I 'm trying to do Toolse transformation to rotate the object , deploy object in degrees , but ran into a problem when the rotation of the object you want to animate .

The bottom line is that the animation object to be rotated for example at 1230 degrees or opposite , from 0 to 360 is not enough and need more range!

http://jsfiddles.net/hukNL/12/

In this example, I get the direction of the black point from 0 to 360 degrees looking where the black dot relative to the green square , but do not know how to make sure that the range grew up in a big way , or look less which way to rotate

Here for example the rotation of an object in one direction in 3D program Image

How to get this result ?

Upvotes: 0

Views: 85

Answers (1)

Mardie
Mardie

Reputation: 1672

The point is to count the turns, multiply by a full turn, and add to the angle.

spins=0;
if turnClockWise
   spins++

if turnCounterClockWise
   spins--

angle = angle + spins*360;

http://jsfiddle.net/x8FUq/

Upvotes: 1

Related Questions