Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
CptEO

Simple rotationY 90 gives unexpected result

Recommended Posts

Hi,

 

I have been using TweenLite/TweenMax for some time and it is a really nice library.

Unfortunately I have run into a strange problem.

 

I have a simple shape (a square) which I have made into a movieclip with an instance name 'test'.

Now i want to perform a simple rotationY tween to 90 in order to rotate the square in such a way that you only see its side (kind of like a line).

 

I thought this simple code would do the trick:

 

import com.greensock.*;
import com.greensock.easing.*;
TweenMax.to(test, 2, {rotationY:90, ease:Linear.easeNone});

 

But now I see that the square doesn't exactly go to its side but rotates a bit further. If I use the following code it goed to exactly to its side:

 


TweenMax.to(test, 2, {rotationY:86, ease:Linear.easeNone});

 

It seems there is some kind of descrepancy there. I first thought it had something to do with the Perspective Angle setting, but changing this value does not give a different result.

 

Any suggestions what is going wrong here?

Link to comment
Share on other sites

try this

 

1) remove all TweenLite code

2) add this code

 

test.rotationY = 90

 

are the results the same?

 

-----

 

Also, move your test object somewhere else on the stage. You should see that the perspective changes based on the position of the object relative to the virtual camera.

 

Take a look at this article: http://www.flashandmath.com/flashcs4/pp/ to learn more about controlling perspective projection.

Link to comment
Share on other sites

Hi Carl,

Thanks for your reply. It gives the same result if I try your code: the square not completely from the side as a line. See attached screenshot

post-12906-0-02380400-1352153874_thumb.png

Link to comment
Share on other sites

Cool. That confirms what I suspected. Nothing going on funny with TweenLite, its just the way flash handles 3D.

 

If you place any movie clip on the stage and and change its rotationY via the transform panel you will get the same results. you can change the vanishing point using the properties panel

 

Screen shot 2012-11-05 at 5.43.55 PM.png

 

noticed the highlighted number in the screengrab.

 

Check out that link I sent to handle this issue in actionscript.

 

c

Link to comment
Share on other sites

Thanks Carl, that really helped.

For those of you who find this thread. For me it helped to change the vanishing point values.

You have to set different ones depending on where the movieclip is located on the stage.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×