Sorry if this is an obvious question, but how in a plugin does one apply a transform (Matrix4x4) containing rotation and translation to a Vector3D which is an XYZ position to get the new XYZ position? I looked at the Matrix4x4 methods but the data conversion was not obvious and a simple example would be very helpful. Thanks!
Sorry to be dense, I saw that but was unable to get “Multiply” to be recognized in the variety of ways I tried it. I have done it in the pedantic way of loading the vector3d into another matrix4x4, doing the overloaded “*”, and then unloading the vector3d from the result. A code snipit would be oh-so helpful. Thanks Elias!
should be as simple as this:
Matrix4x4 transform = ...; Vector3D input = ...; Vector3D output = transform * input;
just tried and worked.
make sure you don’t mix up Matrix4x4 with Matrix (from SlimDX) and Vector3D with Vector (from SlimDX).
Aha! That multiply is not commutative! I had the transform and vector reversed. Thank you!