Jump to content

Is there a way to revert a volume's transform back to normal?


magneto

Recommended Posts

Hi,

I am trying to revert the rotation of a volume so it aligns with the world. I tried setting the primitive intrinsic, but if you set it to identity, then you lose the scale. Since it's absolute, I am not able to apply the inverse of this transform either.

Should I use the explodematrix expression?

I am actually trying to create a bounding box that has the same size and orientation. Setting the orientation of the box is easy but I am not sure how else I can find out the size of the volume since it can be scaled. But Volume Slice SOP is able to do this accurately it so there must be a way.

Any ideas?

Thanks :)

Link to comment
Share on other sites

Thanks sanostol. I attached the file. Basically trying to create the same bounding box of the volume you see. But I don't want to use OBB algorithms because the transform of the volume is known.

I actually came up with a solution yesterday by sampling the positions of the corner voxels, which when you account for the voxel size, seems to work. Just didn't think it would be this complicated :)

vol.hip

Link to comment
Share on other sites

Thanks petz, very clever trick. Your solutions are always the most elegant :)

EDIT: Do you know if I can use the same idea to extract rotation? Because if I extract it using the same function, then I am not sure how to apply it to an identity matrix. There is only a rotate function that rotates a matrix around an axis.

How can I use this extracted rotation to orient another geometry?

EDIT 2: In other words, I want to reset the translate and scale of the matrix so I am only left with a rotation matrix. I tried extracting and rotating by x, y and z separately, and also converting the matrix (after from matrix4 to matrix3) into a quaternion, and then applying but it seems inaccurate.

Do I have to use something like the QR decomposition?

Any math experts? :)

Thanks :)

Edited by magneto
Link to comment
Share on other sites

Guest mantragora

Yeah, I hate Maya. I tried get into it couple times last 5 years. Once I have to script every little shit in it or use this f*cking linking editor I'm out. It's the end of 2013 and in Maya it's still 90's.

  • Like 1
Link to comment
Share on other sites

Thanks anim, do you think that's accurate enough? I tried it for some stuff but it seems off when compared to the full matrix itself, which of course also have a scale I am trying to get rid of.

do you have example of that?

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...