Rotating Cube : OpenGL

The following program displays a wireframe cube that can be rotated using the following keys: –

 

a) Uppercase ‘x’: – Increases the angle of the cube wrt the x-axis by 1.0
b) Lowercase ‘x’: – Decreases the angle of the cube wrt the x-axis by 1.0
c) Uppercase ‘y’: – Increases the angle of the cube wrt the y-axis by 1.0
d) Lowercase ‘y’: – Decreases the angle of the cube wrt the y-axis by 1.0
e) Uppercase ‘z’: – Increases the angle of the cube wrt the z-axis by 1.0
f) Lowercase ‘z’: – Decreases the angle of the cube wrt the z-axis by 1.0

The screenshots below describe the working of the program:-

Rotating Cube - Initial State
After Rotation

The following video shows the Rotating Cube in action :

Click here to view and download the source code of this project.
Click here to download Rotating Cube.exe only (You’ll need glut.dll for running this application. Put both Rotating Cube.exe and glut.dll in the same folder).

(Visited 243 times, 2 visits today)

Leave a Reply

Your email address will not be published. Required fields are marked *