Skip to content

Commit

Permalink
updated to separate model and view
Browse files Browse the repository at this point in the history
  • Loading branch information
deveshidwivedi committed Feb 1, 2024
1 parent 2ceca4e commit f5baf36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/webgl/GeometryBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class GeometryBuilder {
* transformations.
*/
addGeometry(input) {
this.renderer.uMVMatrix =
this.renderer.uModelMatrix.multiply(this.renderer.uViewMatrix);
this.hasTransform = !this.renderer.uMVMatrix.mat4
.every((v, i) => v === this.identityMatrix.mat4[i]);

Expand Down
4 changes: 2 additions & 2 deletions src/webgl/interaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ p5.prototype._grid = function(size, numDivs, xOff, yOff, zOff) {
this._renderer.curStrokeColor[1] * 255,
this._renderer.curStrokeColor[2] * 255
);
this._renderer.uMVMatrix.reset();
this._renderer.uModelMatrix.reset();

// Lines along X axis
for (let q = 0; q <= numDivs; q++) {
Expand Down Expand Up @@ -733,7 +733,7 @@ p5.prototype._axesIcon = function(size, xOff, yOff, zOff) {

return function() {
this.push();
this._renderer.uMVMatrix.reset();
this._renderer.uModelMatrix.reset();

// X axis
this.strokeWeight(2);
Expand Down

0 comments on commit f5baf36

Please sign in to comment.