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 Online or Download An Interactive Introduction to OpenGL Programming PDF

Similar computers books

LaTeX Eine Einführung

Nachdruck des gleichnamigen Addison-Wesley-Titels Zum Buch: Dieses beliebte Standardwerk beschreibt die aktuelle model LaTeX 2. Diese model gestattet auch die Integration von alten LaTeX 2. 09 Texten, ohne dass sich der Anwender mit den Eingabedetails dieser Vorgängerversionen vertraut machen muss.

Trust and Privacy in Digital Business: First International Conference, TrustBus 2004, Zaragoza, Spain, August 30 - September 1, 2004. Proceedings

Truly welcome to court cases of the first foreign convention on belief and privateness in electronic enterprise, Zaragoza, Spain, held from August thirtieth to September 1st, 2004. This convention was once an outgrowth of the 2 profitable TrustBus inter- tional workshops, held in 2002 and 2003 along side the DEXA meetings in Aix-en-Provence and in Prague.

SOFSEM 2006: Theory and Practice of Computer Science: 32nd Conference on Current Trends in Theory and Practice of Computer Science, Merin, Czech Republic, ... Computer Science and General Issues)

This publication offers the court cases of the thirty second convention on present tendencies in conception and perform of machine technology, held in Merin, Czech Republic. The forty five revised complete papers, offered including 10 invited contributions have been conscientiously reviewed and chosen from 157 submissions. The papers have been equipped in 4 topical tracks on desktop technology foundations, instant, cellular, advert hoc and sensor networks, database applied sciences, and semantic net applied sciences.

Additional info for An Interactive Introduction to OpenGL Programming

Sample text

0 ); } 53 Moving all objects in the world five units away from you is mathematically the same as “backing up” the camera five units. 5; glViewport( 0, 0, (GLsizei) w, (GLsizei) h ); glMatrixMode( GL_PROJECTION ); glLoadIdentity(); … continued … 54 In this routine, we first compute the aspect ratio (aspect) of the new viewing area. 0 ) { left /= aspect; right /= aspect; } else { bottom *= aspect; top *= aspect; } glOrtho( left, right, bottom, top, near, far ); glMatrixMode( GL_MODELVIEW ); glLoadIdentity(); } 55 Continuing from the previous page, we determine how to modify the viewing volume based on the computed aspect ratio.

63 An Interactive Introduction to OpenGL Programming Depth Buffering and Hidden Surface Removal 1 Color Buffer 2 1 4 8 16 2 4 8 16 Depth Buffer Display 64 Depth buffering is a technique to determine which primitives in your scene are occluded by other primitives. 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.

Generally, only perspective transformations change w and require this perspective division in the pipeline. 37 An Interactive Introduction to OpenGL Programming 3D Transformations A vertex is transformed by 4 x 4 matrices • all affine operations are matrix multiplications • all matrices are stored column-major in OpenGL • matrices are always post-multiplied v • product of matrix and vector is M v M= m0  m  1 m2   m3 m4 m8 m12  m5 m6 m9 m10 m13   m14  m7 m11 m15   38 Perspective projection and translation require 4th row and column, or operations would require addition, as well as multiplication.

Download PDF sample

Rated 4.35 of 5 – based on 14 votes