Here are new versions of the glbox.cpp & glbox.h files with mouse control included. These files are exactly as at the end of lighting with the changes:
xRot = yRot = zRot = 0.0; // default object rotation scale = 1.25; // default object scale object = 0; xTrans = yTrans = zTrans = 0.0; //init trans values
gluLookAt(0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
glRotatef( xRot, 1.0, 0.0, 0.0 );
glRotatef( yRot, 0.0, 1.0, 0.0 );
glRotatef( zRot, 0.0, 0.0, 1.0 );
glTranslatef( -xTrans, 0.0, 0.0 );
glTranslatef( 0.0, yTrans, 0.0 );
glTranslatef( 0.0, 0.0, zTrans );
Useful References
OpenGL Programming Guide
(The Red Book).
OpenGL Index in Alphabetic Order
(This is pretty long)
The OpenGL Website - tutorials
Contact me
email: pj@cpsc.ucalgary.ca
Tel: (403) 220 7041.