Answer the question
In order to leave comments, you need to log in
Rotation Matrices, Java -> QT4?
Please tell me how to re-format the Java code into the corresponding operations in QT4.
here it is in Java:
Vector4f up = new Vector4f(0,1,0,0);
Matrix4f modelToWorld = new Matrix4f();
// skipped
modelToWorld.invert();
modelToWorld.transform(up)
// ля-ля-ля
QVector4D up = QVector4D(1,0,0,0);
QMatrix4x4 modelToWorld = new QMatrix4x4();
// skipped
modelToWorld = modelToWorld.inverted();
// ???
Answer the question
In order to leave comments, you need to log in
The * operator is redefined as not a member of the class and returns the result of the transformation:
QVector4D operator*( const QMatrix4x4& matrix, const QVector4D& vector )
// Можно поменять местами
QVector4D operator*( const QVector4D& vector, const QMatrix4x4& matrix )
QVector4D result = modelToWorld * up;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question