ActionScript 3.0 :: Using Local3DToGlobal With PerspectiveProjection?

May 8, 2010

I'm using local3DToGlobal with PerspectiveProjection.  My problem is that when I don't use PerspectiveProjection local3DToGlobal works as expected. But when I use PerspectiveProjection local3DToGlobal appears to give a random Point that doesn't make sense to me.  However, if I have the local3DToGlobal in a function that's called with the Event.ENTER_FRAME it works as expected.
 
The red circle is suppose to follow the black circle end of the stick graphic. The red circle is using regular x and y positions, while the stick is using x, y and z (3D). If you call the onEnterFrameMethod directly the red circle wont wrap the circle end of the stick.  If you comment out the PerspectiveProjection code, then the red circle will wrap the circle end of the stick.  If you uncomment the PerspectiveProjection code, and then use an event listener to call the onEnterFrameMethod, the red circle will wrap the circle end of the stick.
 
package
{
import flash.display.Sprite;
import flash.events.Event;
import flash.geom.Point;

[code]....

View 1 Replies


Similar Posts:


ActionScript 3.0 :: ProjectionCenter Does Not Affect PerspectiveProjection?

Dec 28, 2009

I am manually drawing 3D lines on screens. I am NOT using the native X Y Z properties of Sprite.private var displayCoordinates:Vector.<Number> = new Vector.<Number>;

private var displayMatrix:Matrix3D = new Matrix3D();
var pperspectiveProjection = new PerspectiveProjection();
pp.projectionCenter = new Point(sizeX/2,sizeY/2);

[code].....

View 1 Replies

Flex - Display Object That Has Been Transformed With A PerspectiveProjection?

Jul 20, 2010

I'm currently transforming some objects to make them appear far away using a PerspectiveTransform. This works well, but I have no way of knowing where on the screen the object is displayed. The x and y coordinates are the coordinates of the object if it were at z=0. How can I compute the display coordinates of my component?

View 1 Replies

ActionScript 3.0 :: RotationY/PerspectiveProjection/width Calculation?

Dec 18, 2009

Basically I have used PerspectiveProjection so I may rotate multiple images about their centre so they don't appear differently rotated because of their x-position on the stage.My problem is calculating the width of the rotated images. When I rotate an image 45 degrees, my width ends up being ~146, but based on the following (my comments from my code), it should be closer to 141:

Code:
// ^C
// / |

[code]......

View 7 Replies

ActionScript 3.0 :: Correction Applied To The Rotation Y Angle When Using PerspectiveProjection?

Dec 28, 2010

I have a stage with and height of :600x400 On this stage i have 3 squares that have a centerpoint in the middle. The square are 90 (width) and 80 (height)The first square is aligned to the left site and the second one in the middle and the third one on the right  The perspectiveProjection is setup using the middle of the stage as it projectionCenter.When i rotate all squares to 90 degrees (rotationY) than only the middle one is now not visible anymore, at that point i want to switch the image inside the square. But at 90 degrees the left and right squares are not invisible..  For the left square that point wouldbe at 90 - 22, and the right one 90 + 22.   Is there a way to calculate the correction value (22) in this example?
 
What i don't want is to give every square it's own perspectiveProjecten , then it would work but you have a completely different3D rotation.The only thing that goes wrong in my example is that the image from the left and right square are not changed at the right time, because 90 degrees on the left square does not mean it it not visible at that point.
 
And here is the code:
 
import flash.display.MovieClip;import flash.geom.Point;import flash.geom.PerspectiveProjection;import fl.transitions.*;import fl.transitions.easing.*
var squares:Array = [c1, c2, c3];

[code]....

View 13 Replies

ActionScript 3.0 :: RotationX And RotationY And RotationZ And PerspectiveProjection Together Break MouseEvent?

Apr 21, 2009

When I change the rotation of a movie clip, and apply PerspectiveProjection, all mouse events applied to that movie clip and all the movie clips inside that movie clip break.The mouse event bellow will not work for me.
 
a_mc.rotationX = 1;
a_mc.rotationY = 1;
a_mc.rotationZ = 1;[code]........

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved