0% found this document useful (0 votes)
49 views2 pages

Robot Open GL

This document defines and provides examples of functions from the OpenGL, GLU, and GLUT libraries. OpenGL functions are used to perform 3D graphics rendering tasks like clearing buffers, setting colors, applying transformations. GLU provides additional 3D math functions. GLUT functions handle window creation and management, as well as drawing basic 3D objects. Examples of functions include glClear to clear buffers, glRotatef to apply rotations, glutSolidSphere to draw a sphere, and glutSwapBuffers to swap front and back buffers.

Uploaded by

Nur Ain Ismail
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views2 pages

Robot Open GL

This document defines and provides examples of functions from the OpenGL, GLU, and GLUT libraries. OpenGL functions are used to perform 3D graphics rendering tasks like clearing buffers, setting colors, applying transformations. GLU provides additional 3D math functions. GLUT functions handle window creation and management, as well as drawing basic 3D objects. Examples of functions include glClear to clear buffers, glRotatef to apply rotations, glutSolidSphere to draw a sphere, and glutSwapBuffers to swap front and back buffers.

Uploaded by

Nur Ain Ismail
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Michelle Daniels Robots Usage of OpenGL, GLU, and GLUT

Definitions adapted from: http://cs.uccs.edu/~semwal/indexGLTutorial.htmlOpenGL


and http://www.glprogramming.com/blue/
and http://cvs.haskell.org/Hugs/pages/libraries/OpenGL/Graphics-Rendering-OpenGL-GLBasicTypes.html#t%3AGLuint
and http://openglut.sourceforge.net/group__api.html
and http://www.opengl.org/resources/libraries/glut/spec3/node113.html

OpenGL
Functions:
- glCallList( ) // Execute a display list.
- glClear( ) // Clear buffers to preset values.
- glClearColor( ) // Specify color to be used when color buffers are cleared.
- glColor3f( ) // Specify new red, green, blue values for current color.
- glEnable( ) // Enable GL capabilities (used for robot scene lighting and depth
testing).
- glEndList( ) // Signal end of a list of a display list; matches glNewList( ).
- glGenLists( ) // Generate a contiguous set of empty display lists.
- glLightfv( ) // Set light source parameters.
- glLoadIdentity( ) // Replace current matrix with identity matrix.
- glMaterialfv( ) // Specify material parameters for lighting model. GLfloat version.
- glMatrixMode( ) // Specify which type of matrix is current matrix.
- glNewList( ) // Initiate a new display list, which is a group of GL commands
stored for subsequent execution; matches glEndList( ).
- glOrtho( ) // Multiply current matrix by an orthographic matrix.
- glPopAttrib( ) // Restore values of state variables saved with last glPushAttrib( )
call.
- glPopMatrix( ) // Pop current matrix stack by one, replacing current matrix with
one below it on the stack; matches glPushMatrix( ).
- glPushAttrib( ) // Specify mask indicating which state variables to save (push
onto) on attribute stack; matches glPopAttrib( ).
- glPushMatrix( ) // Push current matrix stack down by one, duplicating the current
matrix; matches glPopMatrix( ).
- glRotatef( ) // Compute a matrix that performs a counterclockwise rotation of
angle degrees about the vector from the origin through point (x,y,z). angle, (x,y,z)
are arguments. Current matrix is multiplied by this rotation matrix, with product
replacing the current matrix. GLfloat version.
- glScalef( ) // Multiply current matrix by scaling matrix, with arguments specifying
scale factors along x, y, z axes. GLfloat version.
- glShadeModel( ) // Select flat or smooth shading.
- glTranslatef( ) // Multiply current matrix by translation matrix, with arguments
specifying translations in x, y, z directions. GLfloat version.
- glViewport( ) // Set the viewport by specifying its rectangles lower left corner in
pixels and also its width and height.

Types:
- GLfloat //GL floating-point
- GLuint // GL unsigned 32-bit integer
GLU
- gluLookAt( ) // Define a viewing transformation by specifying position of eye
point, reference point, and up vector.

GLUT
3D Objects
Functions:
- glutSolidCube( ) // Draw a solid-shaded cube, centered at origin.
- glutSolidSphere( ) // Draw a shaded sphere, centered at origin.
- glutWireCube( ) // Draw a wire-frame cube, centered at origin.
Windowing
Functions:
- glutCreateWindow( ) // Send a request for a window to be constructed.
- glutDisplayFunc( ) // Set display callback for current window.
- glutInit( ) // Initialize GLUT library.
- glutInitDisplayMode( ) // Set the window creation display mode.
GLUT_DOUBLE argument signals double-buffering (see glutSwapBuffers( ) ).
- glutInitWindowPosition( ) // Requests future windows to open at a given position.
- glutInitWindowSize( ) // Requests future windows to open using a given width,
height.
- glutKeyboardFunc( ) // Set keyboard callback for current window.
- glutMainLoop( ) // Initiate event loop.
- glutPostRedisplay( ) // Mark current window as needing a redisplay.
- glutReshapeFunc( ) // Set reshape callback for current window; called when
window is reshaped.
- glutSwapBuffers( ) // Swap buffers for current window. Signals that youre done
drawing to current window. If double-buffered, swap front and back buffers.

You might also like