Jump to content

Difference between vector and 3 floats vector?


Recommended Posts

The short answer is that they are very similar, except that houdini interprets a "vector" as 3 float values describing a vector is space and "3 floats" as just that, an array of 3 float values, something other than a vector in space. So a vector can be transformed (by a transform SOP, say) and a 3 floats shouldn't. Color is a good example of a 3 floats attribute that you wouldn't want to respond to a transform.

In practice that is the only difference I worry about: if it's a vector in space (P, N, etc.) use vector. If it's something not spatial like color, use 3 floats.

The long answer, and someone's gonna have to check my work on this one since I'm probably going to get the details wrong is:

3 floats, vector, normal, point, and direction are ALL different types of 3 float arrays that respond to transforms differently. I think:

3 floats shouldn't respond to transforms (although in practice I think if you create a value P, N, or some other common attrib and set its type to 3 floats, Houdini will still interpret it as a vector and it will respond to transforms.

Vector responds to rotations and scales, but not translation.
Normal responds to rotations and non-uniform scales, but not uniform scales.
Point responds to translation, rotations and scales.
Direction I can never remember...

If you want to experiment, create a sphere. Add normals. Then add an attribute create. Make a 3 float point attribute called "myattrib" and append a transform SOP. Next to type "float" use the second drop down to switch between "none", "position", "normal", and "color". For each one, check out the Attributes drop down in the transform SOP. You'll see that when it's set to "color" for instance, it doesn't show up in the Transform SOP since a color is a 3 float value and can't be transformed. If it's set to position or normal, you can set the transform SOP to transform it (or not by excluding it).


  • Like 1
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.

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