"origin" return rotations between 90 and -270

   4827   6   0
User Avatar
Member
25 posts
Joined: Feb. 2010
Offline
I have some trouble with the origin expression.

I try to use it to retrieve the rotations values of an object in world space but it didn't return the expected result.

If you look my exemple, you will see that the rotations values retrieved with “origin”, are modified and are always between 90 et -270. But I need the real rotation angle. For exemple if I rotate the object by 360 I don't want to get 0.

Maybe I need to use an other function than origin, or maybe I need to recreate one. I was thinking that the only solution is to create a new expression function that will read all the parenting hierachy and compute the reals rotation values, but I'm not sure I could do it beter than the guy who have made the origin function (I'm not sure it's faisable)

Please tell me what you think.
Can I do it or is it not possible because of some mathematical problemes…

Attachments:
originExpressionError.hipnc (73.9 KB)

User Avatar
Member
7740 posts
Joined: July 2005
Offline
dealer2couleurs
Can I do it or is it not possible because of some mathematical problemes…

It's not mathematically possible in general with 3D rotations. On the other hand, if you only have a 1D rotation, then it's possible but you will need to create your own method of doing it.
User Avatar
Member
25 posts
Joined: Feb. 2010
Offline
I don't know a lot the quaternions, but

don't you think I can compute for each transformation matrix the corresponding quaternions and use them to compute the final quaternion to rotate my object…

I had the feeling that it couldn't be done with matrix but maybe with quaternion…
User Avatar
Member
8598 posts
Joined: July 2007
Online
you cannot do that through quaternions, you'll get just the final pose which is what you are getting

you can probably do this just by summing euler angles for all objects in upstream hierarchy (including pretransforms), but there should not be any other transform methods, like lookat, path, blend Obj, …
and they all should probably have the same rot order
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
7740 posts
Joined: July 2005
Offline
tamte
you can probably do this just by summing euler angles for all objects in upstream hierarchy (including pretransforms), but there should not be any other transform methods, like lookat, path, blend Obj, …
and they all should probably have the same rot order

That can't work in general. I've attached a simple counter-example.

Attachments:
angles_summed.hip (63.8 KB)

User Avatar
Member
8598 posts
Joined: July 2007
Online
you are right
it's not the same thing
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
25 posts
Joined: Feb. 2010
Offline
Tnak you for your answer,

As I was thinking, it's not a trivial solution.
I will continue with “origin” for now
  • Quick Links