Download 3D Transformations and more Schemes and Mind Maps Computer science in PDF only on Docsity!
CS 430
Computer Graphics
3D Transformations
World Window to Viewport Transformation
Week 2, Lecture 3 David Breen, William Regli and Maxim Peysakhov Department of Computer Science Drexel University
Outline
- World window to viewport transformation
- 3D transformations
- Coordinate system transformation
4
Window-to-Viewport
Transformation
- Given a window and a viewport, what is the transformation from WCS to VPCS? Three steps: - Translate - Scale - Translate 1994 Foley/VanDam/Finer/Huges/Phillips ICG
5
Transforming World
Coordinates to Viewports
- 3 steps
- Translate
- Scale
- Translate Overall Transformation: 1994 Foley/VanDam/Finer/Huges/Phillips ICG
P '= M
wv
P
3D Transformations
10
Representation of 3D
Transformations
- Z axis represents depth
- Right-Handed System
- When looking “down” at the origin, positive rotation is CCW
- Left-Handed System
- When looking “down”, positive rotation is in CW
- More natural interpretation for displays, big z means “far” (into screen) 1994 Foley/VanDam/Finer/Huges/Phillips ICG
3D Transformations:
Scale & Translate
- Scale
- Parameters for each axis direction
- Translation
3D Transformations:
Rotation
- One rotation for each world coordinate axis
- Also can be expressed as the
Rodrigues Formula
P
rot = P cos( ϑ ) + ( n × P )sin( ϑ ) + n ( n ⋅ P )( 1 − cos( ϑ ))
Rotation Around an
Arbitrary Axis
Improved Rotations
- Euler Angles have problems
- How to interpolate keyframes?
- Angles aren’t independent
- Interpolation can create Gimble Lock, i.e. loss of a degree of freedom when axes align
- Solution: Quaternions!
€ p = ( 0 , x )
slerp – Spherical linear interpolation Need to take equals steps on the sphere A & B are quaternions