1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Matrix3D: Fixed an ordering bug in the multiplication operator

This commit is contained in:
Tom Poole 2022-07-27 15:52:49 +01:00
parent 9005e2fda8
commit 7612f446b5
4 changed files with 58 additions and 26 deletions

View file

@ -93,10 +93,10 @@ public:
Matrix3D<float> getViewMatrix() const
{
Matrix3D<float> viewMatrix ({ 0.0f, 0.0f, -10.0f });
Matrix3D<float> rotationMatrix = viewMatrix.rotation ({ -0.3f, 5.0f * std::sin ((float) getFrameCounter() * 0.01f), 0.0f });
auto viewMatrix = Matrix3D<float>::fromTranslation ({ 0.0f, 0.0f, -10.0f });
auto rotationMatrix = viewMatrix.rotation ({ -0.3f, 5.0f * std::sin ((float) getFrameCounter() * 0.01f), 0.0f });
return rotationMatrix * viewMatrix;
return viewMatrix * rotationMatrix;
}
void render() override

View file

@ -893,10 +893,10 @@ public:
{
const ScopedLock lock (mutex);
auto viewMatrix = draggableOrientation.getRotationMatrix() * Vector3D<float> (0.0f, 1.0f, -10.0f);
auto viewMatrix = Matrix3D<float>::fromTranslation ({ 0.0f, 1.0f, -10.0f }) * draggableOrientation.getRotationMatrix();
auto rotationMatrix = Matrix3D<float>::rotation ({ rotation, rotation, -0.3f });
return rotationMatrix * viewMatrix;
return viewMatrix * rotationMatrix;
}
void setTexture (OpenGLUtils::DemoTexture* t)