6. 3D Perspective

Brock University
COSC 3P98 Computer Graphics
Instructor: Brian Ross



Viewing 3D


Main types of planar projections:


Parallel projection


Parallel projection: OpenGL


Perspective projection


Projection example

 Point

World coords

Orthographic coords

Perspective factor t

Perspective coords

A

 (2,1,-1)

 (2,1)

 1.0

 (2,1)

 B

 (2,1,-10)

 (2,1)

 0.1

 (0.2, 0.1)

 C

 (2,1,-100)

 (2,1)

 0.01

 (0.02, 0.01)

 D

 (2,-5,-100)

 (2,-5)

 0.01

 (0.02, -0.05)

 E

 (-50,-50,-100)

 (-50,-50)

 0.01

 (-0.5, -0.5)


Perspective: OpenGL


Moving eye in OpenGL

2. gluLookAt(GLdouble eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ)


Example OpenGL Program


References



Back to COSC 3P98 index

COSC 3P98 Computer Graphics
Brock University
Dept of Computer Science
Copyright © 2006 Brian J. Ross (Except noted figures).
http://www.cosc.brocku.ca/Offerings/3P98/course/lectures/3d_perspective/
Last updated: November 6, 2006