1 / 9

3D Computer Graphics (3080/GV10) Week 5-6 Tutorial 3

3D Computer Graphics (3080/GV10) Week 5-6 Tutorial 3. Andrew Cox. OpenGL Transformation Pipeline. ModelView Matrix. Camera Space. Projection Matrix. Object Space. Homogeneous Clip Space. Perspective Divide. Normalized Device Coordinates. Viewport Transform. Viewport Coordinates.

Download Presentation

3D Computer Graphics (3080/GV10) Week 5-6 Tutorial 3

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 3D Computer Graphics (3080/GV10)Week 5-6 Tutorial 3 Andrew Cox

  2. OpenGL Transformation Pipeline ModelView Matrix CameraSpace Projection Matrix Object Space HomogeneousClip Space Perspective Divide Normalized Device Coordinates Viewport Transform Viewport Coordinates Slide adapted from Eric Lengyel[1]

  3. OpenGL Perspective Projection Matrix • n, f = distances to near, far planes • e = focal length = 1 / tan(FOV / 2) • a = viewport height / width Picks up viewspace z and places negated in w: division by Z gives perspective Slide adapted from Eric Lengyel[1]

  4. Slide courtesy of Eric Lengyel[1]

  5. Matrix Multiplication and Concatenation

  6. Order of OpenGL Transformations • OpenGL calls define a matrix, then concatenate it with existing one • Transformations applied in reverse of lexical program order

  7. Matrix Modes • GL tracks two matrix stacks • Projection • ModelView • The matrix applied to vertices is • The matrix commands apply to the current mode: • glMatrixMode(GL_PROJECTION); • glMatrixMode(GL_MODELVIEW);

  8. glLoadIdentity() • Matrix commands are concatenated with matrix of current mode • Includes gluPerspective () etc. • Clear out current matrix with glLoadIdentity()

  9. References • Eric Lengyel, Projection Matrix Tricks, Game Developers Conference 2007, <http://www.terathon.com/lengyel/>.

More Related