-UPDATED-
I have added a piece of text into a new push/pop matrix and it is visible and can be rotated, but it seems to be rotating around a long way from the centre.
Which property can I change to get the text to move around a smaller orbit?
Code:PFont font;
float y = 6;
float x = 4;
float z = 0;
void setup() {
size(640, 360, P3D);
}
void draw(){
background(0);
lights();
stroke(255);
noFill();
pushMatrix();
translate(mouseX-40, mouseY, 0);
rotateY(y);
rotateX(x);
rotateZ(z-5);
box(40);
popMatrix();
pushMatrix();
//translate(mouseX, mouseY);
font = loadFont("ArialMT-12.vlw");
textFont(font);
fill(255);
text("left-click to rotate (x)", width/3, height/2, 0);
text("right-click to rotate (y)", width/3, height/2+13, 0); //CUBE WIREFRAME.
popMatrix();
if((mousePressed)&& (mouseButton == RIGHT)){
y = y+0.1;
}else if((mousePressed)&& (mouseButton == LEFT)){
x = x+0.1;
}
fill(100);
noStroke();
pushMatrix();
translate(width/3, height/2, 0); //CUBE SOLID(PANELS).
rotateY(y);
rotateX(x);
rotateZ(z);
scale(2,2,2);
beginShape(QUADS);
vertex(-10, 10, 10);
vertex( 10, 10, 10);
vertex( 10, -10, 10);
vertex(-10, -10, 10);
vertex( 10, 10, 10);
vertex( 10, 10, -10);
vertex( 10, -10, -10);
vertex( 10, -10, 10);
vertex( 10, 10, -10);
vertex(-10, 10, -10);
vertex(-10, -10, -10);
vertex( 10, -10, -10);
vertex(-10, 10, -10);
vertex(-10, 10, 10);
vertex(-10, -10, 10);
vertex(-10, -10, -10);
vertex(-10, 10, -10);
vertex( 10, 10, -10);
vertex( 10, 10, 10);
vertex(-10, 10, 10);
vertex(-10, -10, -10);
vertex( 10, -10, -10);
vertex( 10, -10, 10);
vertex(-10, -10, 10);
endShape(CLOSE);
popMatrix();
pushMatrix();
fill(255);
translate(width/3, height/2, 0);
rotateY(y);
rotateX(x);
rotateZ(z);
//scale(2,2,2);
text("hello?",width/3, height/2, 0);
popMatrix();
}