objarni's picture

Multiply Vector4 and Matrix4 ?

I'm trying to multiply a Vector4 and a Matrix4,

Vector4 v;
Matrix4 m;
// what I want to do:
Vector4 result = m*v; // opengl-style linear algebra

I've looked in v, m, Vector4 and Matrix4 for "Mult" or "Apply" methods, and also operator overloads -- but I can't seem to find this.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
objarni's picture


Inertia's picture

Vector4 result = Vector4.Transform( m, v );

puklaus's picture

"Vector4.Transform( m, v );"

I never even thinked, maybe Mul() / Mult() -methods too, even they do the same thing?

objarni's picture


Actually, the parameters are switched:

Vector4 result = Vector4.Transform(v, m);