Rotating entire space before animation

Hi @Avatrin
your code is incomplete and not formatted using the

</> code tag

but best is ( when using p5.js ) you
share your

version ( for the problem only )
so everyone can easy check and play
and you might have a faster response.


not related to appyMatrix
but to rotation generally:
-a- first walk to the rotation center

translate( width/2,height/2);

-b- then rotate around that.

-c- to understand axis thinking just use the

first, so all even just with a look at the reference
how the axis thinking is would be clear.


finally is i follow your link to

and use
example 5

function setup() {
  createCanvas(100, 100, WEBGL);
  noFill();
}

function draw() {
  background(200);
  rotateY(PI / 6);
  stroke(153);
  box(35);
  var rad = millis() / 1000;
  // Set rotation angles
  var ct = cos(rad);
  var st = sin(rad);
  // Matrix for rotation around the Y axis
  applyMatrix(  ct, 0.0,  st,  0.0,
               0.0, 1.0, 0.0,  0.0,
               -st, 0.0,  ct,  0.0,
               0.0, 0.0, 0.0,  1.0);
  stroke(255);
  box(50);
}

and i get
/*
TypeError: this._renderer.applyMatrix is not a function (sketch: line 16)
p5.RendererGL: enabled webgl context
*/

show me what you see there?


anyhow see that you posted 2 times

and assume your question is resolved.