This advanced multimedia technology book provides an in-depth review of the OpenGL graphics pipeline, transformation, projection, clipping, rasterization, shading, and visibility. It covers hierarchical modeling with examples like a robot arm and human hands, along with OpenGL implementation details, attributes, simple transformations, orthographic projection, and camera transformations. The text includes code snippets, primitives drawing, material properties, color models, and callback functions for event handling, displaying, and double buffering. Additionally, it discusses mathematical curve representations, such as parametric polynomial curves, cubic curves, and compact curve representations like Hermite, Bezier, and Splines.
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation
Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement.Téléchargez la présentation en cliquant sur ce lien.Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.
F I N
Plus de contenu associé
Transcription de la présentation
OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin Chen and Doug James
OpenGL • A low-level OS-independent graphics API for 2D and 3D interactive graphics. • Initiated by SGI (called GL at early time) • Implementation, for Windows, hardware vendors provide suitable drivers for their own products; for Linux, we have Mesa.
Helper libraries • OpenGL does not provide OS-dependent functions such as windowing and input • GL: core graphics functions • GLU: graphics utilities in top of GL • GLUT: input and windowing functions
How does it work? • From the programmer’s view • Specify geometric properties of the objects • Describe material properties • Define viewing • Define camera and object transformations • OpenGL is a state machine • States: color, material properties, line width, current viewing • States are applied to subsequent drawing commands • Input: description of geometric objects • Output: shaded pixels
How does it work • From the implementer’s perspective • Graphics pipeline Primitives + material properties Is it Visible? 3D to 2D Scan conversion Visibility determination Display Rotate Translate Scale
Primitives: drawing a polygon // put GL into polygon drawing mode glBegin(GL_POLYGON); // define vertices glVertex2f(x0, y0); glVertex2f(x1, y1); glVertex2f(x2, y2); glEnd(); Code available at http://www.xmission.com/~nate/tutors.html
Primitives Hardware may be more efficient on triangles; stripes require less data
Polygon restrictions • In OpenGL, polygons must be simple and convex not simple not convex
Attributes • Part of the state of the graphics pipeline • Set before primitives are drawn. • Remain in effect! • Example: • Color, including transparency • Reflection properties • Shading properties
Primitives: material properties • glColor3f(r,g,b); All subsequent primitives will use this color. Colors are not attached to objects. The above command only changes the system states. • OpenGL uses red, green and blue color model. Each components are ranged within 0 and 1.
Simple transformations • Rotate by a given angle (in degrees) about ray from origin through (x,y,z) glRotate{fd}(angle, x, y, z); • Translate by a given x, y, z values glTranslate{fd}(x, y, z); • Scale with a factor in the x, y, and z directions glScale{fd}(x, y, z); • glPushMatrix(); glPopMatrix();
Depth buffer in OpenGL • glutInitDisplayMode(GLUT_DEPTH); • glEnable(GL_DEPTH_TEST); • glClear(GL_DEPTH_BUFFER_BIT);
Double buffering • Flicker if drawing overlaps screen refresh • Solution: use two frame buffers • Draw into one buffer • Swap and display, while drawing other buffer • glutInitDisplayMode(GLUT_SINGLE) • glutInitDisplayMode(GLUT_DOUBLE) • glutSwapBuffers()
Constrain the cubics Hermite: defined by two endpoints and two endpoint tangent vectors Bezier: defined by two endpoints and two other points that control the endpoint tangent vectors Spline: defined by four control points
Connexion au compte
Connectez-vous pour publier votre contenu sur SlideServe.