View Full Version : How are Orientation and Rotation related?
yogert909 07-04-2006, 04:35 AM Basically, I'm trying to write a script that will combine them into one value to be used in a 3D program. But simply adding rotationX to orientationX... is not giving the right values.
|
|
Mylenium
07-04-2006, 04:50 AM
Basically, I'm trying to write a script that will combine them into one value to be used in a 3D program. But simply adding rotationX to orientationX... is not giving the right values.
What would that be good for? Sorry, you have to approach this another way. Orientation use Quarternions and only rotation uses classic Eulerian rotations and you can only use the latter in a sensible way in scripts and expressions.
Mylenium
yogert909
07-04-2006, 05:05 AM
It would be good if I have an already animated camera in aftereffects and I want to get the same camera move into a 3D program, in this case Cinema4D. C4d doesn't have orientation and rotation. Do you know of another way to get meaningful rotation data into C4D?
Quarternions and Eulerian rotations?? Yikes, where do you find this kind of stuff out?
Thanks
Mylenium
07-04-2006, 05:45 AM
It would be good if I have an already animated camera in aftereffects and I want to get the same camera move into a 3D program, in this case Cinema4D. C4d doesn't have orientation and rotation. Do you know of another way to get meaningful rotation data into C4D?
Quarternions and Eulerian rotations?? Yikes, where do you find this kind of stuff out?
Thanks
Well, like I said, you'd have to convert all your orientation data to standard rotation values, there's no way around that. A good place to start would be using lookAt(sourcepoint,targetpoint) on your rotations. This will return an array of 3 rotational values that can be separated into their components for each channel. You will get much more usable results using this method.
Mylenium
Per-Anders
07-04-2006, 06:03 AM
Cinema uses HPB euler, HPB = YXZ. That's pretty much all you need to know in terms of bringing the data in.
Now the orient/rotation is basically the same as rotating the Axis and rotating the Object, i.e. orientation = the Axis and Rotation = Object, they are as far as I can see both just plain 3d eurler angles as far as I can tell in AE, no quaternions. The way you handle this is via some basic Matrix Math, you create a rotational Matrices for each then multiply the Object rotation by the Axis rotation, the resulting matrix should be your now final Matrix, and you convert that back in order to get your final axial rotation values. This is what you would then send out to whatever application.
Good luck with it!
Per-Anders
07-04-2006, 06:13 AM
btw, if you wanted a cheap way that didn't involve you having to work out any math with Cinema then you'd just export your two datasets, then in cinema have your camera set up as a child of a null. apply the position/scale/orientation to the null, then the rotation only to the camera. cinema will take care of the rest for you (that will work in any 3d app by the way).
yogert909
07-04-2006, 07:47 AM
Thanks! I'll give it a try in the morning when my brain is working.
yogert909
07-05-2006, 06:17 PM
I'm sorry, is there somehting I'm missing? The "cheap way" is not working. I did a test by simply typing in the position and rotation values of my 1st frame from ae into a c4d camera and null and it did not seem to match my ae scene. I took care to transpose the values correctly i.e. Y value is negetive and Xrot=P, Yrot=H, Zrot=B. If I get you correctly, orientation values should go to the null and rotation values to the camera, right?
Thanks so much for your comments
Per-Anders
07-05-2006, 11:33 PM
You have to make sure the camera's position is 0,0,0 inside of the null, it's a way of creating another axis for the camera. Rmemeber the Camera is a child of the Null, or the Null is the parent of the Camera.
Orientation goes into the null's rotation from after effects - y rotation,x rotation ,z rotation is the order, the position goes into the null too (not the camera), the Rotation goes into the camera's rotation (again y,x,z from after effects). the camera must retain it's local positoin of 0,0,0 and scale of 1,1,1 otherwise when you rotate the null the camera being a child of the null will rotate and move which isn't desirable.
CGTalk Moderation
07-05-2006, 11:33 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.