jkunz07 Posted September 12, 2016 Share Posted September 12, 2016 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 Quote Link to comment Share on other sites More sharing options...
MirrorSword Posted September 12, 2016 Share Posted September 12, 2016 (edited) 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 September 12, 2016 by MirrorSword 2 Quote Link to comment Share on other sites More sharing options...
jkunz07 Posted September 13, 2016 Author Share Posted September 13, 2016 Thanks James! Finally had a chance to test it and that does seem to be what I'm after. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.