I have a leaf instance point exported from SpeedTree with 3@transform.
3@transform = set( {-0.146396,-0.0727609,0.0550026},{0.0605058,0.000363445,0.161525},{0.0682531,-0.156387,-0.0252152} ) ;
-- Instance with @transform
p@orient = quaternion(3@transform);
DELETE @transform attribute
-- Instance with p@orient
Different Results of orientation!
If I instance the point with p@Orient converted from 3@transform using quaternion() , the orientation is flipped .
It seems that I get the same p@Orient value with ident() and ident() * -1 .
Is it the problem?
How can I obtain the correct p@orient ?
Thank you for reading my question
Incorrect Orientation converting 3@transform to p@Orient
1108 2 1- lionlee19hk
- Member
- 1 posts
- Joined: 12月 2020
- Offline
- willh
- Member
- 134 posts
- Joined: 12月 2006
- Offline
- toadstorm
- Member
- 359 posts
- Joined: 4月 2017
- Offline
This flip is happening because quaternions don't encode scale, and there's some negative scaling happening in that 3x3 matrix of yours.
You can verify this by using cracktransform() to create a v@scale attribute to go along with the orientation:
The scale extracted from that matrix is {-0.172, -0.172, -0.172}.
You can verify this by using cracktransform() to create a v@scale attribute to go along with the orientation:
3@transform = set( {-0.146396,-0.0727609,0.0550026},{0.0605058,0.000363445,0.161525},{0.0682531,-0.156387,-0.0252152} ) ; p@orient = quaternion(3@transform); v@scale = cracktransform(0,0,2,0,3@transform);
The scale extracted from that matrix is {-0.172, -0.172, -0.172}.
MOPs (Motion Operators for Houdini): http://www.motionoperators.com [www.motionoperators.com]
-
- Quick Links