#Rotational Keys
15 messages in this thread
When creating rotational keys in the keyframer, how do I compound angles using
the vectors you ask for? If I want to rotate an object 15 degrees in the Z
axis, all I have to do is to set the angle to 15 and the vectors to 0,0,1. What
formula is expected to be used when I want to compound two or three axis? I
could not reverse engineer what 3D Studio does when I rotate the object by
hand and go check the keys.
An example I run over and over:
105 deg Y rot. 105 deg Y and 10 deg X
X 0 -0.25386
Y 0 -0.19479
Z 1 9.94742
Ang 105 107.9669
And please, pretty please, don't give me the "sqrt(x^2+y^2+z^2)" smart answer.
That's pretty obvious. I want to know how did you (3D Studio) derive those
components and came up with that resulting angle.
This is urgent. I sent this morning a KXP that needs this. I couldn't figure
this one out but decided to send it in any way. What I am doing for now is
creating a separate key for each axis I need rotated. Let me just say that
several tons of high tech machinery crashed and this KXP will be used to
recreate the incident.
Ok, more stuff on the rotation world front…
Up to now, I was actually creating a key for each frame. If I turn down the
sample rate (from 30 samples a second to 1 sample a second) I will be
generating a rotation key for each 30 frames. In fact, I am generating both
position keys and rotation keys for each 30 frames. The whole process runs
anywhere from 5,000 to 10,000 frames.
The problem is that now, my model spins 360's between keys. This only happens
in the Z axis (parallel to the "Top" view). That view (axis) is weird to begin
with as "0" degrees is at "90" (east looking straight down the "Top" view) when
dealing with rotation but not when dealing with positioning. I have to keep
subtracting 90 degrees (1/2 PI) in order for the model to keep the right
orientation (Yaw). I don't have to do that when plotting 3D vector coordinates
which I gather from navigation data and speed. Why the discrepancy? What causes
the model to spin around?
The doc says the angle can't be less than 0. If negative, add 2PI. This works
fine for X and Y. I am doing the same for Z but it doesn't seem to work. If I
go and edit the key by hand within the keyframer I find, for instance, a 359.08
degrees. It should be -0.02 (if I put -0.02 by hand, the model correctly
rotates the -0.02 degree instead of spinning 359.08 degrees).
Can anybody give me a clue what this is all about?
Hey, so far I'm enjoying this self conversation thang. I've probably really
gone mad… At any rate, still need to know how to use those compounded
rotation angles. Generating a key for each axis is making the thing to have
hick ups every frame. I have to go back to 3DS docs and see if I can figure
what all those "tens, cont, bias, easeTo, and easeFrom" mean. I'm just plugging
the values ORBIT.C uses without any regard to knowing what they mean.
The spinning mystery of the day: Just disregard the stuff written in the docs.
Don't pay attention to that "don't use negative angle" stuff. I got rid of the
lines fixing up (adding 2PI if angle < 0.0) and everything is working fine. In
other words, I'm feeding negative radians when the rotation is negative and the
stuff is working. When I do what the docs tell me to do the object spins. Go
figure… Oh well, I'm still using docs I got last 02/04!!! Where is the new
(shipping) stuff?
Gus,
I've forwarded this to QA and Grant.
jonas[adesk]
Gus,
ooh, looks like fun, but just so you know, I got my r3 docs today (Monday)!
Still no pxp_pick_object() but hey, I wrote that last night anyway. You might
see your docs today too (Fed Ex is really cool).
later,
doug
Yomp! The Fedex man just left me some goodies, including the new docs and a
floppy… Bummer, now I run out of thing to whine about… <g>
You might find a few things, (like the way they laid out the docs,
does anyone know what method of sorting they used? It certainly
wasn't either logical progression or alphabetized or ???) Anyway,
nice to have the final shipping version!
Uhm, do you know what a quaternion is? Check your collection of
Siggraph papers, I think this explains the wacky rotation.
Yeah, one of those days. It must be something simple, or something totally
wacky and no wonder I can't figure. I was dead tired last night (5am). I will
be back at it later on (it's 11:30pm already! gee, here we go again)…
I've often heard that 3D programmers turn to quaternions as a way to
*prevent* the sort of flip you were seeing when your rotations cross
the poles. But it was late when I read your autobiographies, :-), so
I'm not sure if this applies. Maybe a Yostie will jump in here to
help.
Gus writes: "And please, pretty please, don't give me the
"sqrt(x^2+y^2+z^2)" smart answer. That's pretty obvious. I want to
know how did you (3D Studio) derive those components and came up with
that resulting angle."
Okay, it's not very useful anyway.
The rotational keys are quaternians discussed Ken Shoemaker's siggraph
paper of a few years back. I'll try to dig up the reference for you.
Alternatively, I can send you the source to the quat.h routines, but
only with the provision that you ask me no questions about that code
as its "production code" and is very mysterious and otherwise
unsupportable. (That's why a lot of toolkit source is not in the
kit, it was just too mysterious).
Please, pretty please send me whatever you got! <g> Mysterious? Are
you kidding? If you think that's mysterious, guess how I felt reading
through the documentation and seeing no clearer explanation! I
understand quartenations. Well, let me rephrase that, I know about
it and I know how they are used (I would have to dig stuff up before
being able to apply any of it). But as far as I can remember, you end
up with a 4×4 matrix. How is that then converted back to a 3 axis and
derived angle is another story. That's the mysterious stuff I know
very little about.
If you need a fax of a xerox of a Siggraph paper, I have a big stack of
proceedings… call me at (414) 674-5200 8 am to 7 pm.
John,
<< SIGGRAPH papers.. >>
I'm looking for Shoemake, K. "Animating Rotation with Quaternion
Curves" SIGGRAPH 85, 245-254. Do you have it?
jonas[adesk]