QuatToEuler Quandry

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  05 May 2011
QuatToEuler Quandry

Greetings...

Another day, another hair puller... I'm at a bit of a loss as to why Y rotation conversions are returning unexpected results...

In the attached file (Max 2010) each of the 3 boxes rotates around a different local axis with the same keyframe animation. Each box also has a testVal CA which evaluates the following line for the apropriate axis of rotation. (where source is the object itself)

(quattoeuler source.transform.rotationpart).z_rotation

X, and Z rotation work fine, but Y returns a different curve. I have tried adding and then chaning order:[1-9] to the quatToEuler function, and tried to invert the quat value before conversion, but have not been able to find a way to get correct Y rotation values directly from the transform. To be honest Quat values are a bit over my head so I was just blindly using trial and error.

Any ideas?

Cheers

Mikie
Attached Files
File Type: zip rotation problem.zip (18.0 KB, 8 views)
 
  05 May 2011
Have you read through this post and the thread it links to? Use:
(QuatToEuler2 (inverse source.rotation)).<axis>_rotation
and it will return the exact same curve for all. QuatToEuler2 is a different algorithm that returns the same results as the UI, and appears to resolve your issue.

-Eric
__________________
"The Evil Monkey hiding in your closet."
 
  05 May 2011
Thanks for that, It works for direct animation, but sadly doesn't cover all cases (which I probably should have made clear from the outset)

The reason I think I have no option but to interrogate the transform matrix itself is becasue in my case the rotation can be inhertited in many different ways... Rotation resulting from path constraint following for instance, wouldn't show up when using .rotation values.

The link you provided was quite intersting tho... I'm wondering if this is an inherant property of the 'right handed' calcs internal to 3ds max... Though I need to read a wiki or two to find out what that really means.

Mikie
 
  05 May 2011
Then just swap to:
(quattoeuler2 source.transform.rotationpart).y_rotation
Which appears to work for this file. Can't speak about other ones.

-Eric
__________________
"The Evil Monkey hiding in your closet."
 
  05 May 2011
Thanks so much! I swear I tried that, but must have been mucking about with inverting the quat and playing with the order at the same time...

There is a very large matrix shaped hole in my math skills I really need to fill... As trying to figure this stuff out by trail and error just sucks....
 
  05 May 2011
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 10:36 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.