{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture09-3DTransforms

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

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

View Full Document Right Arrow Icon
CS 455 – Computer Graphics Three-Dimensional Transformations
Background image of page 1

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

View Full Document Right Arrow Icon
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
Background image of page 2
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 ) ( ) ( ) (
Background image of page 3

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

View Full Document Right Arrow Icon
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)
Background image of page 4
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
Background image of page 5

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

View Full Document Right Arrow Icon
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
Background image of page 6
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
Background image of page 7

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

View Full Document Right Arrow Icon
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
Background image of page 8
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’) φ θ
Background image of page 9

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

View Full Document Right Arrow Icon
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 θ
Background image of page 10
Rotation about the x axis (cont) So:
Background image of page 11

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

View Full Document Right Arrow Icon
Image of page 12
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}