Jump to content

Transforming Velocity or Direction vector


jkunz07

Recommended Posts

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

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