3 D transformations Dr Nicolas Holzschuch University of

  • Slides: 10
Download presentation
3 D transformations Dr Nicolas Holzschuch University of Cape Town e-mail: holzschu@cs. uct. ac.

3 D transformations Dr Nicolas Holzschuch University of Cape Town e-mail: holzschu@cs. uct. ac. za Modified by Longin Jan Latecki latecki@temple. edu

Map of the lecture • Homogeneous coordinates in 3 D • Geometric transformations in

Map of the lecture • Homogeneous coordinates in 3 D • Geometric transformations in 3 D – translations, rotations, scaling, …

Homogeneous coordinates in 3 D • In order to model all transformations as matrices:

Homogeneous coordinates in 3 D • In order to model all transformations as matrices: – introduce a fourth coordinate, w – two vectors are equal if: x/w = x’/w’, y/w = y’/w’ and z/w=z’/w’ • All transformations are 4 x 4 matrices

Translations in 3 D

Translations in 3 D

Scaling in 3 D

Scaling in 3 D

Rotations in 3 D • One rotation: one axis and one angle • Matrix

Rotations in 3 D • One rotation: one axis and one angle • Matrix depends on both axis and angle – direct expression possible, from axis and angle, using cross-products • Rotations about axis have simple expression – other rotations express as composition of these rotations

Rotation around x-axis is unmodified Sanity check: a rotation of p/2 should change y

Rotation around x-axis is unmodified Sanity check: a rotation of p/2 should change y in z, and z in -y

Rotation around y-axis is unmodified Sanity check: a rotation of p/2 should change z

Rotation around y-axis is unmodified Sanity check: a rotation of p/2 should change z in x, and x in -z

Rotation about z-axis is unmodified Sanity check: a rotation of p/2 should change x

Rotation about z-axis is unmodified Sanity check: a rotation of p/2 should change x in y, and y in -x

Any transformation in 3 D • All transformations in 3 D can be expressed

Any transformation in 3 D • All transformations in 3 D can be expressed as combinations of translations, rotations, scaling – expressed using matrix multiplication • Transformations can be expressed as 4 x 4 matrices