Jump to content

(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
Link to comment
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. 

Link to comment
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.

 

Link to comment
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.

Link to comment
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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...