As a part of project, today I tried to make a 3-D box rotating on its own axis using processing.

this is how it looked like

`import processing.opengl.*;`

int depth = 200;

//Cube cubes = new Cube;

Cube cubes = new Cube(150, 75, depth/2);

void setup() {

size(640,480,P3D);

noStroke();

```
```}

void draw() {

background(0);

fill(200);

pointLight(51, 102, 255, 65, 60, 100);

pointLight(200, 40, 60, -65, -60, -150);

// Raise overall light in scene

ambientLight(70, 70, 10);

translate(width/2,height/2,-depth);

rotateY(frameCount * 0.01);

cubes.drawCube();

}

class Cube{

int w,h,d;

Cube(int w, int h, int d){

this.w=w;

this.h=h;

this.d=d;

}

void drawCube(){

beginShape(QUADS);

vertex(-w/2,-h/2,-d/2);

vertex(w,-h/2,-d/2);

vertex(w,h,-d/2);

vertex(-w/2,h,-d/2);

vertex(-w/2 , -h/2 , d);

vertex(w, -h/2 , d );

vertex(w , h , d );

vertex(-w/2 , h , d );

// Left face

vertex(-w/2 , -h/2 , -d/2 );

vertex(-w/2 , -h/2, d );

vertex(-w/2, h , d );

vertex(-w/2 , h , -d/2 );

// Right face

vertex(w , -h/2 , -d/2 );

vertex(w , -h/2 , d );

vertex(w , h , d );

vertex(w , h , -d/2 );

// Top face

vertex(-w/2 , -h/2 , -d/2 );

vertex(w , -h/2 , -d/2 );

vertex(w , -h/2 , d );

vertex(-w/2 , -h/2 , d );

// Bottom face

vertex(-w/2 , h , -d/2 );

vertex(w , h , -d/2 );

vertex(w , h , d );

vertex(-w/2 , h , d );

` endShape();`

}

}