Skip to content

Commit 331a7e1

Browse files
vamshi567bhvamshidevara
authored andcommitted
Fix modelViewMatrix computation order in _setGlobalUniforms
1 parent 71d062a commit 331a7e1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/core/p5.Renderer3D.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ export class Renderer3D extends Renderer {
791791
projectedToScreenMatrix.translate([0.5, 0.5, 0.5]);
792792
projectedToScreenMatrix.scale(0.5, -0.5, 0.5);
793793

794-
const modelViewMatrix = modelMatrix.copy().mult(viewMatrix);
794+
const modelViewMatrix = viewMatrix.copy().mult(modelMatrix);
795795
const modelViewProjectionMatrix = modelViewMatrix.mult(projectionMatrix);
796796
const worldToScreenMatrix = modelViewProjectionMatrix
797797
.mult(projectedToScreenMatrix);
@@ -1434,7 +1434,7 @@ export class Renderer3D extends Renderer {
14341434
const modelMatrix = this.states.uModelMatrix;
14351435
const viewMatrix = this.states.uViewMatrix;
14361436
const projectionMatrix = this.states.uPMatrix;
1437-
const modelViewMatrix = modelMatrix.copy().mult(viewMatrix);
1437+
const modelViewMatrix = viewMatrix.copy().mult(modelMatrix);
14381438

14391439
shader.setUniform(
14401440
"uPerspective",

0 commit comments

Comments
 (0)