I have a cube that rotates on its 3 axis, when key[a] == true it will spin to the left as if it was rolling that way. rotating the cube 45 degrees in any direction sets it back 90 degrees for the illusion of continuing. this maintains 3 axis that are < 45 degrees off from the environment

I believe this is correct but the x axis for the cube seems to be relative to the environment while y and z are relative to the cubes orientation, I can not find reference to this in the documentation is it a bug?
<https://processing.org/reference/rotateY_.html>
<https://processing.org/reference/rotateX_.html>

```
  if(keys[w]) { 
    if (x >= 359) x = 0;
    x = x + 1;
  }  
  if(keys[a]) { 
    if (z >= 359) z = 0;
    z = z + 1;
  }  
  if(keys[s]) { 
    if (x <= 0) x = 359;
    x = x - 1;
  }  
  if(keys[d]) { 
    if (z <= 0) z = 359;     
    z = z - 1;
  }

  // return 90 deg for magic trick       
  if (x > 45 && x < 180) x = 270 + x;
  if (x < 316 && x > 180) x = 360 - x;

  if (y > 45 && y < 180) y = 270 + y;
  if (y < 316 && y > 180) y = 360 - y;

```