Hello @yaya,
matrixB = myObject->GetAbsPos() * matrixA;
First of all, BaseObject::GetAbsPos
returns a Vector
, which in turn makes your calculation at least implicitly wrong, since you call the result matrixB
, implying that it is a matrix. But the product of a matrix M and a vector p is the vector p' transformed by M. There is also the fact that order matters in the C++ SDK, i.e., you are forced to write expressions in the canonical matrix-first order (in Python you are not restricted in such fashion, because Python handles operator overloading differently).
Vector p; Matrix M;
// Valid expression since Mat3 has an operator overload for M * p
Vector q = M * p;
// Invalid expression since Vec3 does not have an operator overload for p * M
Vector r = p * M;
It might also be noteworthy that Matrix
and Vector
are only aliases originating from our classic API. The types have been replaced by a more versatile templated model of the atomic arithmetic types. Vector
is just a typedef
for maxon::Vec3<maxon::Float64, 1>
and Matrix
for maxon::Mat3<maxon::Vector64>
. You can find the relevant template descriptions in the Mat3< V > Struct Template and Vec3< T, STRIDE > Struct Template references.
Cheers,
Ferdinand