I am not too familiar with 3D in Processing, but I think that when you do pg.rotate*, you move the PGraphics for further drawings, but you don't do them.
I think your should rotate the current graphics canvas before drawing.
I tried with:
Code:
PGraphics pg;
float angle = 0;
void setup() {
// Should not use parameters there, see reference
size(500, 500, P3D);
pg = createGraphics(width, height, JAVA2D);
pg.background(0);
//Initialize random points on PGraphics object
pg.beginDraw();
for(int i=0; i<1000; i++) {
float r = random(255);
color c1 = color(random(255), random(255), 0);
pg.stroke(c1);
pg.point(50+int(random(width-100)), 50+int(random(height-100)));
}
pg.endDraw();
}
void draw() {
background(0);
angle += PI/60;
pushMatrix();
rotateX(angle);
rotateY(angle);
rotateZ(angle);
image(pg, 0, 0);
popMatrix();
}
I see movement, but it might be wrong (not what you want) because I draw the image on the rotated canvas, making a projection. Or something like that, I am not too sure...
The correct way of doing that would probably to do a 3D square, apply your random texture to it, and rotate that shape.