Download An Interactive Introduction to OpenGL Programming by Dave Shreiner, Ed Angel, Vicki Shreiner PDF

By Dave Shreiner, Ed Angel, Vicki Shreiner

Show description

Read or Download An Interactive Introduction to OpenGL Programming PDF

Best computers books

PRICAI 2006: Trends in Artificial Intelligence: 9th Pacific Rim International Conference on Artificial Intelligence Guilin, China, August 7-11, 2006 Proceedings

This booklet constitutes the refereed complaints of the ninth Pacific Rim overseas convention on synthetic Intelligence, PRICAI 2006, held in Guilin, China in August 2006. The eighty one revised complete papers and 87 revised brief papers offered including three keynote talks have been rigorously reviewed and chosen from 596 submissions.

Beginning AutoCAD 2004, First Edition

Starting AutoCAD 2004 is a direction according to studying and training the necessities of second drawing utilizing AutoCAD. Bob McFarlane's hands-on strategy is uniquely fitted to self sufficient studying and use on classes. the point of interest on second drawing in a single ebook, guarantees the reader will get an intensive grounding within the topic, with a better intensity of assurance than has a tendency to be on hand from common introductions to AutoCAD.

Extra resources for An Interactive Introduction to OpenGL Programming

Example text

GlRotate(), glTranslate(), and glScale(). For the basic viewing transformations, OpenGL and the Utility library have supporting functions. 39 An Interactive Introduction to OpenGL Programming Programming Transformations Prior to rendering, view, locate, and orient: • eye/camera position • 3D geometry Manage the matrices • including matrix stack Combine (composite) transformations 40 Because transformation matrices are part of the state, they must be defined prior to any vertices to which they are to apply.

As each pixel in a primitive is rasterized, its distance from the eyepoint (depth value), is compared with the values stored in the depth buffer. If the pixel’s depth value is less than the stored value, the pixel’s depth value is written to the depth buffer, and its color is written to the color buffer. The depth buffer algorithm is: if ( pixel->z < depthBuffer(x,y)->z ) { depthBuffer(x,y)->z = pixel->z; colorBuffer(x,y)->color = pixel->color; } OpenGL depth values range from [0, 1], with one being essentially infinitely far from the eyepoint.

This is done using glEnable(), and passing the token for the feature, like GL_LIGHT0 or GL_POLYGON_STIPPLE. 30 An Interactive Introduction to OpenGL Programming Transformations 31 31 An Interactive Introduction to OpenGL Programming Transformations in OpenGL Modeling Viewing • orient camera • projection Animation Map to screen 32 Transformations are used both by the applications programmer to move and orient objects (either statically or dynamically) and by OpenGL to implement the viewing pipeline.

Download PDF sample

Rated 4.77 of 5 – based on 27 votes