Lecture_Chapter4_b

# P 1 v 1 2 v 2 3 v 3 p0 ecs 175 chapter 4 object

This preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: Chapter 4: Object Transformation 37 Homogeneous Coordinates •  Distinguishing points and vectors In world frame vectors are defined by a local coordinate frame. v = α1 v1 + α2 v2 + α3 v3 In world frame points are defined by a local coordinate frame and origin. P = α 1 v 1 + α 2 v 2 + α 3 v 3 + P0 ECS 175 Chapter 4: Object Transformation 38 Homogeneous Coordinates •  Distinguishing points and vectors v1 v2 Local coordinate system as rows in matrix v3 P0 v = α1 v1 + α2 v2 + α3 v3 P = α 1 v 1 + α 2 v 2 + α 3 v 3 + P0 ECS 175 Chapter 4: Object Transformation v1 v2 v = (α1 , α2 , α3 , 0) · v3 P0 v1 v2 P = (α1 , α2 , α3 , 1) · v3 P0 39 Transformation in Homogeneous Coordinates •  Affine transformation now represented by 4x4 matrix α11 α21 A= α31 0 α12 α22 α32 0 α13 α23 α33 0 α14 α24 α34 1 x x y and vectors v = y A transforms points p = z z 1 0 ECS 175 Chapter 4: Object Transformation 40 Translation P￿ = P + v x y P = z 1 vx vy v= vz 0 100 0 1 0 ￿ P = 0 0 1 000 ￿ x + vx x y ￿ y + vy ￿ P = ￿ = z z + vz 1 1 vx vy ·P vz 1 translation matrix T ECS 175 Chapter 4: Object Transformation 41 Transformation in Homogeneous Coordinates •  Example coordinate transformation (scaling and translation) vworld = T (p)S (0.5, 0.5, 0.5) · vlocal ECS 175 Chapter 4: Object Transformation 0.5 0 = 0 0 0 0.5 0 0 0 0 0.5 0 p1 p2 · vlocal p3 1 42 Rotation in 3D cos(α) sin(α) Rz ( α ) = 0 0 − sin(α) cos(α) 0 0 1 0 0 cos(α) Rx ( α ) = 0 sin(α) 0 0 cos(α) 0 Ry ( α ) = − sin(α) 0 ECS 175 0 0 1 0 0 − sin(α) cos(α) 0 0 sin(α) 1 0 0 cos(α) 0 0 Chapter 4: Object Transformation 0 0 upper left sub-matrix 0 identical to 2D matrix 1 0 0 0 1 0 0 0 1 inversion: R ( α ) −1 = R ( − α ) cos(−α) = cos(α) sin(−α) = − sin(α) R ( α ) −1 = R ( α ) T 43 Rotation: Fixed Point •  Rotation always performed around origin •  Changing the fixed point requires translations: vworld = T (p)Rz (α)T (−p) · vlocal vworld ECS 175 cos(α) sin(α) = 0 0 − sin(α) cos(α...
View Full Document

## This document was uploaded on 03/12/2014 for the course ECS 175 at UC Davis.

Ask a homework question - tutors are online