Two Squares : OpenGL

The following program displays two squares that can be moved around the screen using the keyboard. Clicking the left/right mouse button or the mouse wheel changes the colours of the squares: – a) The first square can be moved left, up, down and right using the keys ‘a’, ‘w’, ‘s’ and ‘d’ respectively. b) The second square can be moved in

Read more

Spinning Square : OpenGL

The following program displays a square that can be rotated using the mouse. You can rotate and stop it using the mouse. This Spinning Square produces an amazing animation when performed systematically : a) Press the Left mouse button to start spinning the square. b) Press the mouse wheel to stop  spinning. Spinning Square Video The following video shows the

Read more

Rotating Sphere : OpenGL

The following program displays a wireframe sphere that can be rotated using the mouse. You can rotate and modify its colour using the mouse in the following ways : a) Pressing the left mouse button turns the background colour red. b) Pressing the mouse wheel turns the background colur green. c) Pressing the right mouse button turns the background colour blue.

Read more

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

Read more