Up and N different result then orient with maketransform

   412   5   0
User Avatar
Member
96 posts
Joined: Dec. 2012
Offline
I'm creating a quaternion from an @N and @up vector by converting it first to a matrix with the `quaternion(maketransform(@N, @up))` expression. However, the result is different when I put it into a copy to points sop. I've added a hip file, would be thankful if you could give me some advice.

With N and Up:



With orient:




Hip File is attached
Edited by schiho - May 13, 2019 03:28:20

Attachments:
orient.jpg (57.1 KB)
NAndUp.jpg (51.2 KB)
upAndOrientMissmatch.hipnc (77.6 KB)

User Avatar
Member
178 posts
Joined: June 2013
Offline
Can you try
lookat(0, -v@N, v@up);
, instead?
Edited by probiner - May 17, 2019 10:07:15
User Avatar
Member
96 posts
Joined: Dec. 2012
Offline
@probiner Thanks for that, that worked, seems that this is similar to the make transform node, not sure why make transform behaves differently, it fails when both N and up have either -1 or 1 in the same Axis.
User Avatar
Member
178 posts
Joined: June 2013
Offline
lookat() makes orthonormal matrices (normalized, perpendicular axes), I also use it instead of the cross product precisely because of the situations you mentioned, because it always returns something. The only drawback is requiring you to negate the forward axis. Which is not consistent with other functions.

Edited by probiner - May 15, 2019 05:54:52
User Avatar
Member
96 posts
Joined: Dec. 2012
Offline
Yeah the negation might cause trouble, especially in my case if i need to export the transforms to a third party application, but so far it works. Wish maketransform would behave as expected. Btw can you share you hip and in your previous comment you have a type ‘missing comma’ fix that for other readers?

Thanks
User Avatar
Member
178 posts
Joined: June 2013
Offline
Ah yeah, the wonders of sharing code I didn't open Houdini to test… Comma and semi-colon added.

What hip are you talking about? The one with where I made the comparative image? Dunno mate, made that a while ago.
  • Quick Links