Jump to content
sawyerwolf19

(Solved) Incorrect Orientation converting 3@transform to p@Orient using quaternion()

Recommended Posts

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

Edited by sawyerwolf19

Share this post


Link to post
Share on other sites
I think there is an error in the definition of matrix.

USE THIS:

 3@transform = set( {0.848744,0.421838,-0.318882},{-0.350787,-0.00210714,-0.936453},{-0.395704,0.906669,0.1461872} ) ;

Share this post


Link to post
Share on other sites
17 hours ago, uakin said:

I think there is an error in the definition of matrix.

USE THIS:

 3@transform = set( {0.848744,0.421838,-0.318882},{-0.350787,-0.00210714,-0.936453},{-0.395704,0.906669,0.1461872} ) ;

Thanks for replying!

Sorry I dont understand what is the error ?

The 3x3matrix is from a leaf instance point exported from SpeedTree. 

Share this post


Link to post
Share on other sites

I think the orientation is actually working correctly but if you do a cracktransform on that matrix you'll see that it has a negative scale

Attached is a test scene that hopefully explains

orient_problem.hiplc

  • Like 1

Share this post


Link to post
Share on other sites
2 hours ago, j00ey said:

I think the orientation is actually working correctly but if you do a cracktransform on that matrix you'll see that it has a negative scale

Attached is a test scene that hopefully explains

orient_problem.hiplc

Thank  you for replying!
Yes, there is a " negative scale transformation" in the 3x3 Matrix.

I guess I have to extract "scale" from  3x3 Matrix to check if there is a" negative scale transformation" inside for every 3x3 Matrix getting from other softwires.

 

Share this post


Link to post
Share on other sites

At a guess I'd say it's likely that if it's coming from the same software it will happen the same but I don't know for sure. Could it be something to do with handedness of Speedtree vs Houdini perhaps?

You don't necessarily need to check each time, you could maybe make an asset, or even just a wrangle preset to check the scale and correct it if it's negative.

Share this post


Link to post
Share on other sites
On 9/9/2022 at 7:47 AM, sawyerwolf19 said:

Thanks for replying!

Sorry I dont understand what is the error ?

The 3x3matrix is from a leaf instance point exported from SpeedTree. 

I guess all components of rotation matrix should be 1 unit long

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×