ArcBall/Quaternion rotation of ObjectContainer3D

Software: Away3D 4.x

mb85, Newbie
Posted: 05 March 2012 08:13 PM   Total Posts: 14

So I have an ObjectContainer3D with a few models inside it. It’s located at 0,0,0 and will never move. I would like to be able to do non gimbal-locked rotations to it based on mouse dragging.

Is there an easy way to convert x and y mouse movement to non gimbal-locked rotation of said ObjectContainer3D? I’ve seen a few posts where people use a simple Matrix3D transformation like this:

var matrix:Matrix3D box.matrix;
 
matrix.appendRotation(deltaX,new Vector3D(0,0,1));
matrix.appendRotation(-deltaY,new Vector3D(1,0,0));
 
box.matrix matrix

The problem is, ObjectContainer3D doesn’t have a matrix property, so I cant use this solution. Or can I? Anyone know?

   

Fab4ce, Jr. Member
Posted: 06 March 2012 02:11 PM   Total Posts: 44   [ # 1 ]

Hi,

1. Is the rotation of the camera around the objects an option?
2. if not, did you see this thread?/forum/viewthread/375/

   

mb85, Newbie
Posted: 07 March 2012 07:54 PM   Total Posts: 14   [ # 2 ]

Thanks for the help. Yes I did see that thread, in fact that’s where I got the code I posted from.

I got the rotation to apparently work by using the .transform property instead of the .matrix property, but the rotation still doesn’t seem like true quaternion rotation. The rotation axis seems to wobble around as you spin it.

I suppose I could rotate the camera. I was trying to avoid that since I was already animating it with TweenMax, and it would involve refactoring some things. But it might be easier to do it that way. Any suggestions on how to do that?

   

Fab4ce, Jr. Member
Posted: 08 March 2012 10:17 AM   Total Posts: 44   [ # 3 ]

I always recommend to use the camera. thats a lot easier.
There are many examples for doing this…. but only a few for the object rotation.
Sorry that i canĀ“t give you a concrete link.

   

hush, Newbie
Posted: 12 March 2013 03:08 PM   Total Posts: 2   [ # 4 ]

Fab4ce, do you have a working example for rotating the camera not the object?

   

hush, Newbie
Posted: 13 March 2013 02:29 PM   Total Posts: 2   [ # 5 ]

Please, can anyone point me to a working arcball source for away3d 4? Need to rotate the camera freely around the object avoiding the gimbal lock n’ stuff.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X