Hello,
I'm trying to create orient attribute within Attribute Create SOP with 4 components(quaternion) but seems like it doesn't work as expected.
When I change the angle(Fourth component) the object is rotating but it stops at about 180 degree no matter what value is in the box and rotation “slows down” when it's approaching 180 degree.
However if I use quaternion function with Attribute Wrangle it works exactly as expected.
@orient = quaternion(ch('angle'), myVec);
I wonder why Attribute Create works differently.
Thanks!
Quaternion and attribute create
2496 2 2- mikhail s
- Member
- 46 posts
- Joined: 3月 2015
- Offline
- neil_math_comp
- Member
- 1743 posts
- Joined: 3月 2012
- Offline
The 4th component of a quaternion isn't an angle. If you check the Geometry Spreadsheet with your Attribute Wrangle example, you can see that both component 1 and component 3 are changing. When going past 180 degrees, component 3 is negative.
Also, the angle of rotation will be the opposite of that in your Attribute Create, since
Hopefully that at least clears up why there's an issue, though I'm not a good person to describe how quaternions actually do work. Sorry.
Also, the angle of rotation will be the opposite of that in your Attribute Create, since
0,0,0,1
is an identity transform, not 0,1,0,0
, and since quaternions are scale-invariant, 0,1,0,10000000
will be approximately equivalent to the identity transform 0,0,0,1
.Hopefully that at least clears up why there's an issue, though I'm not a good person to describe how quaternions actually do work. Sorry.
Edited by neil_math_comp - 2018年8月28日 11:33:09
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
- jsmack
- Member
- 7803 posts
- Joined: 9月 2011
- Offline
-
- Quick Links