简体   繁体   中英

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 ?

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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM