Discussion:
Plane.copyTransform - my skewed calculations,
Karim Beyrouti
2010-07-26 22:31:09 UTC
Permalink
Hi All, seems a little quite here these day...

I am using a copy transform move a dummy object to a target position for animation.
However I seem to be missing something and the object does not rotate / align as expected.

Link: http://kurst.co.uk/transfer/test/ (might take a second or two to load - but hopefully not much)
Problem: 'title' plane is skewed / not aligned

My method is, well... quite primitive, it works if i just apply the copyTransform directly, but not when i
want to do it through a proxy for tweenMax. I am definitely missing something.

sample code:

// Move dummy target to final position
titlePlaneTarget.copyTransform( selectedPlane );
titlePlaneTarget.moveUp( ( selectedPlane.height / 2 ) + titlePlane.height );
titlePlaneTarget.moveLeft( selectedPlane.width / 3 );

// Copy target properties to tween object
var tweenProps : Object = new Object();
tweenProps.x = titlePlaneTarget.x
tweenProps.y = titlePlaneTarget.y
tweenProps.z = titlePlaneTarget.z
tweenProps.rotationX = titlePlaneTarget.rotationX
tweenProps.rotationY = titlePlaneTarget.rotationY
tweenProps.rotationZ = titlePlaneTarget.rotationZ
tweenProps.localRotationX = titlePlaneTarget.localRotationX;
tweenProps.localRotationY = titlePlaneTarget.localRotationY;
tweenProps.localRotationZ = titlePlaneTarget.localRotationZ;

// Test : Use tween props to plonk target in final position
titlePlane.x = tweenProps.x
titlePlane.y = tweenProps.y
titlePlane.z = tweenProps.z
titlePlane.rotationX = tweenProps.rotationX
titlePlane.rotationY = tweenProps.rotationY
titlePlane.rotationZ = tweenProps.rotationZ
titlePlane.localRotationX = tweenProps.localRotationX;
titlePlane.localRotationY = tweenProps.localRotationY;
titlePlane.localRotationZ = tweenProps.localRotationZ;


Thank you for taking the time...


Best


Karim Byeoutit

Loading...