annemarie,
I'm assuming you want to use the arctangent (atan2) to base orientation around some known vector (i.e. mouse postion).
Here's some code that might help.
Code:
float ang = 0;
void setup(){
size(600, 400, P3D);
framerate(30);
}
void draw(){
background(0);
ambientLight(140, 140, 140);
translate(width/2, height/2, 0);
//rotate 90 degs and then find
//theta(angle of rotation in radians)
//based on mouse position
rotateZ(PI/2+atan2(mouseY-height/2, mouseX-width/2));
//this second rotation just
//keeps pyramid spinnning
rotateY(radians(ang-=PI/2.0));
scale(50, 50, 50);
beginShape(TRIANGLES);
//face 1
fill(45, 200, 20);
vertex(-1, 1, -1);
vertex(0, -1, 0);
vertex(1, 1 , -1);
//face 2
fill(255, 30, 30);
vertex(-1, 1, 1);
vertex(0, -1, 0);
vertex(1, 1 , 1);
//face 3
fill(140, 45, 255);
vertex(-1, 1, -1);
vertex(-1, 1, 1);
vertex(0, -1, 0);
//face 4
fill(255, 255, 30);
vertex(1, 1, -1);
vertex(1, 1, 1);
vertex(0, -1, 0);
endShape();
}