Download presentation
Presentation is loading. Please wait.
Published byClyde Walton Modified over 6 years ago
1
3D Computer Graphics (3080/GV10) Week 5-6 Tutorial 3
Andrew Cox
2
OpenGL Transformation Pipeline
ModelView Matrix Camera Space Projection Matrix Object Space Homogeneous Clip 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, <
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.