Lecture 3:
Basic Transformations

Contents

Lecture Objectives

3-1

Camera Analogy

3-2

The Role of Matrices

3-3

Modeling Transformations

3-4

Lab: Modeling Transformation Exercise

3-5

Translation

3-6

Rotation

3-7

The right-hand rule

3-8

Scaling

3-9

Example: transforms.c

3-10

Projection Transformations

3-11

Lab: Projection Transformation Exercise

3-12

Orthographic Projections

3-13

A 3D Experiment

3-14

Example: orthoRotate.c

3-15

Observations

3-16

Perspective Projection Using glFrustum

3-17

Perspective Projection Using gluPerspective

3-18

Using Perspective Projections

3-19

Example: perspectiveRotate.c

3-20

Matrix Stacks

3-21

Vertex Transformation

3-22

Who's Who?

3-23

Matrix Modes

3-24

A Shortcut

3-25

Matrix Stack Operations

3-26

Loading the Identity Matrix

3-27

Using the ModelView Matrix Stack

3-28

Example: matrixmodes.c

3-29

Lab: Modeling and Projection Transformations

3-30

Lecture Summary

3-31

Sample Solutions For Transformation Exercises

3-32

OpenGL C Quick Reference

3-33