Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
OpenGL Evolution z^ Controlled by an Architectural ReviewBoard (ARB)^ •^ Members include SGI, Microsoft, Nvidia, HP,3DLabs, IBM,…….^ •^ Relatively stable (present version 2.0)^ •^
Evolution reflects new hardware capabilities^ •^ 3D texture mapping and texture objects^ •^ Vertex programs • Allows for platform specific features throughextensions
raphics^
L ibrary): Library of 2-D, 3-D
tilities): Miscellaneous functions dealing with camera set-up and higher-levelshape descriptions z GLUT^ (
GL U tility
T oolkit): Window-system independent toolkit with numerous utilityfunctions, mostly dealing with user interface
Lack of Object Orientation z^ OpenGL is not object oriented so thatthere are multiple functions for a givenlogical function^ • glVertex3f^ • glVertex2i^ • glVertex3dv z^ Underlying storage mode is the same z^ Easy to create overloaded functions inC++ but issue is efficiency
glVertex3f(x,y,z) belongs to GL library
function name
x,y,z^ are floats glVertex3fv(p)
p^ is a pointer to an array
dimensions
display
callback
function named
mydisplay
-^ Every glut program must have a displaycallback •^ The display callback is executed wheneverOpenGL decides the display must berefreshed, for example when the window isopened •^ The^ main
function ends with the program entering an event loop
is too simple z^ Makes heavy use of state variabledefault values for^ •^ Viewing^ •^ Colors^ •^ Window parameters
glVertex
are determined by the application andare called^
object^ or^ problem coordinates z The viewing specifications arealso in object coordinates and it isthe size of the viewing volumethat determines what will appearin the image z Internally, OpenGL will convert to camera (eye) coordinates
and later to^ screen coordinates
Transformations in OpenGl z^ Modeling transformation^ •^ Refer to the transformation of models (i.e., thescenes, or objects) z^ Viewing transformation^ •^ Refer to the transformation on the camera z^ Projection transformation^ •^ Refer to the transformation from scene toimage
Courtesy: Neider, Davis and Woo, “The OpenGL Programming Guide”
Projection Transformation z^ Transformation of the 3D scene into the2D rendered image plane^ •^ Before applying projection transformations,need to set
glMatrixMode(
)
-^ Orthographic projection^ •^ glOrtho(left, right, bottom, top, near, far) •^ Perspective projection^ •^ glFrustum (left, right, bottom, top, near, far)