Wednesday, 17 August 2011

Keyboard control...

A very simple change to add simple keyboard control to the rotation of our cube.

Create 2 global float variables


and add these to the render() method

Now create the gl1Control_KeyDown method with the following syntax.



Finally add the "glControl1_KeyDown" method as the Key down event for the gl1control.


Simple, now we can rotate the cube to see our textures.

I think it was probably Pssst that got me really hooked on those keyboard controls :)

No comments:

Post a Comment