{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture09-3DTransforms

# Lecture09-3DTransforms - CS 455 Computer Graphics...

This preview shows pages 1–12. Sign up to view the full content.

CS 455 – Computer Graphics Three-Dimensional Transformations

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
3D Space We want to extend the idea of transformations to deal with 3D objects More complex than 2D, but essentially the same ideas work Coordinate systems: We will use a right-handed system Right-handed x y z Left-handed x y z
General 3-D Transformations A general 3-D transformation has the form: x ´ = f x ( x , y , z ) y ´ = f y ( x , y , z ) z ´ = f z ( x , y , z ) where x , y , and z are the original coordinates and x ´ , y ´ , and z ´ are the transformed coordinates In vector form: = = = z y x z y x f f f z y x p p p p p p and where ) ( ) ( ) (

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Affine Homogeneous Transformations For the same reason as 2-D, we want to use affine transformations in homogeneous coordinates: x ´ = f x ( x , y , z , 1) = a x x + b x y + c x z + d x y ´ = f y ( x , y , z , 1) = a y x + b y y + c y z + d y z ´ = f z ( x , y , z , 1) = a z x + b z y + c z z + d z w ´= f w ( x , y , z , 1) = 1 In matrix form: Mp p = = 1 1 0 0 0 z y x d c b a d c b a d c b a z z z z y y y y x x x x Homogeneous coordinate ( w = 1)
Translation Move a 3-D object from one place to another: Simple extension from 2-D to 3-D add a translation for z + + + = = = 1 1 1 0 0 0 1 0 0 0 1 0 0 0 1 z y x z y x t z t y t x z y x t t t Tp p

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Scale Change a 3-D object’s size: Another simple extension add a scale for z = = = 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 z s y s x s z y x s s s z y x z y x Sp p
More involved than translation or rotation. We need to rotate about a particular coordinate axis Positive rotations will be such that looking down one coordinate axis, a 90 degree counter-clockwise rotation will transform one positive axis into another Rotation x y z Axis of rotation x y z Direction of positive rotation y to z z to x x to y

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Three possible axes to rotate about: x axis: p ´ = R x p y axis: p’ = R y p z axis : p’ = R z p We will need a separate rotation matrix for each case Rotation: About a Coordinate Axis
Rotation about the x axis Looking down the x axis: We want to rotate from p to p’ We know: y = r cos φ z= r sin φ x’ = x y’ = r cos ( φ + θ ) z’ = r sin ( φ + θ ) y z p(x, y, z) p’(x’, y’, z’) φ θ

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Rotation about the x axis (cont) The sum of angles formula: cos ( φ + θ ) = cos φ cos θ - sin φ sin θ sin ( φ + θ ) = sin φ cos θ + cos φ sin θ So: y z p(x, y, z) p’(x’, y’, z’) φ θ y = r cos φ z= r sin φ x’ = x y’ = r cos ( φ + θ ) z’ = r sin ( φ + θ ) z’ = r sin φ cos θ + r cos φ sin θ = z cos θ + y sin θ y’ = r cos φ cos θ - r sin φ sin θ = y cos θ - z sin θ
Rotation about the x axis (cont) So:

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}