So this is a very simple sketch, but when you use the mouse to rotate the circle it doesn't seem to rotate exactly on the Y axis. Run the sketch and you'll see what I mean.
- import processing.opengl.*;
float a;
void setup() {
size(800, 600, OPENGL);
fill(0, 153);
noStroke();
hint(ENABLE_OPENGL_4X_SMOOTH);
}
void draw() {
background(255);
translate(width/2, height/2);
rotateY(radians(a));
ellipse(0, 0, 400, 400);
}
void mouseDragged() {
a = mouseX;
}
1