Simple Animation
- This is by no means an ultimate solution, but it will do for now.
- glutTimerFunc(int delay, void (* func)(int value) callback, int parameter)
- delay is the milliseconds until the call is made
- This is a lower bound
- Depending on code, it might be called MUCH later.
- callaback is the callback function
- The function signature indicates a void with a single integer parameter.
- If NULL no function is registered
- parameter is the parameter that is passed
- note the use in MovementFunction
- Note the change in resize()
- glFrustum(left, right, bottom, top, near, far)
- This a perspective projection (glOrtho did a parllel projection)
- the parameters define a viewing frustum, which has an apex at (0,0,0)
- Glut gives us a bunch of predefined objects
- glut SHAPE Object
- SHAPE = {Solid, Wire}
- OBJECT = { Sphere, Cube, Cone, Torus, Dodecahedron, Octahedron, Tetahedron, Icosahedron, Teapot}
- glutWireTeapot(1), glutSolidCube(4)
- Look Here for more information.
- Freeglut apparently adds Teaspoon, Teacup, SierpinskiSponge
- Two of the matrix stacks
- Objects The Modelview matrix is applied to objects
- Then the PROJECTION matrix is applied.
- Color Matricies, Texture Matricies
- These are stacks of matricies
- As transformations are applied they add to the top matrix on the stack.
- glMatrixMode sets the current matmrix we are manipulating
- glLoadIdentity(); sets the current matrix to the identity
- glTranslatef(x,y,z) applys a translation matrix to the stack
- glRotatef(angle, x,y,z) rotates aglong a given vector
- glScale(x,y,z) scales by a given amount
- glPushMatrix() - save the current matrix on the stack
- glPopMatrix() - Go back to the previous matrix.
- Much more on this later too.