What's the different between vector 4 and quaternion

   6398   4   0
User Avatar
Member
66 posts
Joined: May 2016
Offline
Hi all,
I have been confused for awhile between vector 4 and quaternion.

The folowing attribute: P{x,y,z,w},RGBA,@orient @rot etc. are they vector 4 or quaternion,what's the differences?
For vex, the sign for vector4 or quaternion are the same? like p@orinet?
when we use chp()function for vector4 or quaternion?


Best
Edited by carldrifter - June 30, 2018 22:33:04
User Avatar
Member
7737 posts
Joined: Sept. 2011
Offline
vector4 is the data type, it could be any 4 floating point numbers. A quaternion is a specific type of data, a coordinate on the hypersphere. A vector4 attribute can be ‘tagged’ as a quaternion so that transform operations treat the data as a quaternion.
User Avatar
Member
323 posts
Joined: Jan. 2015
Offline
P{x,y,z,w},RGBA,@orient @rot etc. are all “vector 4” meaning they are made up of 4 floats (nothing more)

and: @orient is also a quaternion (and a vector 4)
see https://en.wikipedia.org/wiki/Quaternion [en.wikipedia.org]

The cool thing about a quaternion is that it needs only a vector 4 to define a orientation in 3d space.

Compare a quaternion to a rotation matrix and as far as i understand that would need a 4x4 matrix so 16 float values…(not 100% sure here)
User Avatar
Member
66 posts
Joined: May 2016
Offline
Olaf Finkbeiner
P{x,y,z,w},RGBA,@orient @rot etc. are all “vector 4” meaning they are made up of 4 floats (nothing more)

and: @orient is also a quaternion (and a vector 4)
see https://en.wikipedia.org/wiki/Quaternion [en.wikipedia.org]

The cool thing about a quaternion is that it needs only a vector 4 to define a orientation in 3d space.

Compare a quaternion to a rotation matrix and as far as i understand that would need a 4x4 matrix so 16 float values…(not 100% sure here)


Thanks very much, Olaf. If I undstand correctly,vector4 is a basic type but quaternion is a special type of vector4.Therefore,I can define vector 4 with any 4 floats as I want but not all vector4 type can be quaternion. Quaternion are related to transform and rotation~
User Avatar
Member
98 posts
Joined: Aug. 2014
Offline
carldrifter
If I undstand correctly,vector4 is a basic type but quaternion is a special type of vector4.Therefore,I can define vector 4 with any 4 floats as I want but not all vector4 type can be quaternion. Quaternion are related to transform and rotation~

A bit of nit picking, actually any vector4 can be quaternion, but not ‘meaningful’ one as definition of orientation, or, as data used later by Houdini. I'd go with jsmack explanation, that quaternion, normal or color for example, is a *tag*, telling Houdini how to use data.
Perhaps a bit of visual help could explain more. In pic bellow, first small network is an usual method for isolating the rotation around x axis, while in order to work properly, vector4 has to be normalized. That's typical use for defining the orientation.
Second is more a practical use, as fourth input dimension for curl noise, where it has nothing with orientation.
  • Quick Links