# vop How to Convert Quaternion to Angle?

## Recommended Posts

hello,How do I connect using vop?

##### Share on other sites

Hi, I don't have much experience in VOP, so here is just a quick comment : a quaternion should be converted to an angle AND rotation axis (i.e. a quaternion to angle won't work, it must be an angle and rotation axis). Have you checked VEX functions, or VOPs? I am sure that conversion must be straightforward...

##### Share on other sites

1 hour ago, catchyid said:

Hi, I don't have much experience in VOP, so here is just a quick comment : a quaternion should be converted to an angle AND rotation axis (i.e. a quaternion to angle won't work, it must be an angle and rotation axis). Have you checked VEX functions, or VOPs? I am sure that conversion must be straightforward...

I get the angle just to rotate the model,How can I use the resulting quaternion to rotate my model?

##### Share on other sites

Convert quaternion to matrix3 and multiply by position, with position on the top input such that the output is vector. Similar to "make transform".

I don't totally understand matrix as well as I'd like to, but essentially matrix3 can be used for rotation, while matrix4 can be used for both rotation and position/scale. They are applied by multiplying the position vector by the matrix.

For a 2D primer on the subject:

For application in Houdini:

http://www.hossamfx.org/math-in-houdini/

Edited by shawn_kearney
##### Share on other sites

Great resource on matrices and quaternions: http://www.tokeru.com/cgwiki/?title=HoudiniVex

##### Share on other sites

19 hours ago, shawn_kearney said:

Convert quaternion to matrix3 and multiply by position, with position on the top input such that the output is vector. Similar to "make transform".

I don't totally understand matrix as well as I'd like to, but essentially matrix3 can be used for rotation, while matrix4 can be used for both rotation and position/scale. They are applied by multiplying the position vector by the matrix.

For a 2D primer on the subject:

For application in Houdini:

http://www.hossamfx.org/math-in-houdini/

I succeeded in calculating the angle,But the rotation center point of this angle is in world coordinates(0,0,0),It is not understand.

##### Share on other sites

After posting I was a little worried about that. The math involved with actually getting a set of rads out of q doesn't look too crazy, if a little tedious (VOPs would be a tangle mess, better done in VEX).

From here you could just take that, convert to deg and use "make transformation" binding your pivot attribute to the pivot parameter. I will poke around and see after the holiday here.

What exactly are you trying to do here? It looks like you're working with DOP geometry?

Edited by shawn_kearney
##### Share on other sites

@APG Is this what you're looking for?

quat2.hiplc

Edited by shawn_kearney
optimized file
##### Share on other sites

1 hour ago, shawn_kearney said:

@APG Is this what you're looking for?

rot_v004_apg.hipnc

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

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

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

×
×