## Recommended Posts

If I want to transform a velocity vector by a matrix4, do I just multiply it by the transpose(inverse(matrix4))?

maybe I need to extract the scale from the matrix and multiply the velocity by that as well?

Cross posting from https://www.sidefx.com/forum/topic/45863/ in case more people will see it here

##### Share on other sites

Hey,

I think you can just turn the velocity into a float4, make sure the last component is zero, and then multiply it by the matrix. (As it says here in the docs). However I'm not a master at matrix math so I might be missing something.

edit: re-read the help doc I linked and it said that when transforming a normal you want to multiply it by the inverted transpose of the matrix. but it seems like a velocity would just be transformed as a regular vector. However It would be interesting to know why you do one thing with a vector and another with a normal.

edit2: Looks like you use the inverted transpose so that the normals will stay perpendicular to the surface. (as explained here).

edit3: I did a test and I'm pretty sure that for a velocity vector you want to use the vector rules and not the normal rules.

Edited by MirrorSword
• 2

## Create an account

Register a new account