Hello,
I’m wondering if anyone can let me know why the rectangle is offset from the mouse by about 300px in the x and y direction?
here’s the code:
var angle = 0;
function setup() {
  createCanvas(700, 700, WEBGL);  
}
function draw() {
  background(64); 
  translate(mouseX, mouseY);
  
  rotateY(angle);
  rectMode(CENTER);
  rect(0, 0, 50, 50);
  angle += 0.02;
}
in the 2D version it seems to work well:
var angle = 0;
function setup() {
  createCanvas(700, 700);
}
function draw() {
  background(64); 
    
  translate(mouseX, mouseY);
  rotate(angle);
  
  rectMode(CENTER);
  rect(0, 0, 100, 100);
  
  // animate!
  angle += 0.02;
}
My guess is that it has to do with translate() needing a third parameter for Z but that’s as close as I can get. I don’t know what to put in there.

 Thank you. So the answer is:
 Thank you. So the answer is: