Geometric Transformations for Computer Graphics 2 D Translation

  • Slides: 26
Download presentation
Geometric Transformations for Computer Graphics

Geometric Transformations for Computer Graphics

2 D Translation

2 D Translation

2 D Rotation

2 D Rotation

2 D Scaling

2 D Scaling

Homogeneous Coordinates

Homogeneous Coordinates

2 D Translation 2 D Rotation 2 D Scaling

2 D Translation 2 D Rotation 2 D Scaling

Inverse transformations: Composite translations:

Inverse transformations: Composite translations:

Composite Rotations: Composite Scaling:

Composite Rotations: Composite Scaling:

General 2 D Rotation Move to origin Rotate Move back

General 2 D Rotation Move to origin Rotate Move back

General 2 D Scaling Move to origin Scale Move back

General 2 D Scaling Move to origin Scale Move back

2 D Directional Scaling

2 D Directional Scaling

2 D Reflections

2 D Reflections

3 2 2 1 1 3 2 1 1 2 3 3

3 2 2 1 1 3 2 1 1 2 3 3

Geometric Transformations by Rasterization • The transformed shape needs to be filled. – A

Geometric Transformations by Rasterization • The transformed shape needs to be filled. – A whole scan-line filling is usually in order. • However, simple transformations can save new filling by manipulating blocks in the frame buffer. Translation: Move block of pixels of frame buffer into new destination.

90° counterclockwise rotation 180° rotation Rotated pixel block Destination pixel array RGB of destination

90° counterclockwise rotation 180° rotation Rotated pixel block Destination pixel array RGB of destination pixel can be determined by averaging rotated ones (as antialiasing)

3 D Transformations Very similar to 2 D. Using 4 x 4 matrices rather

3 D Transformations Very similar to 2 D. Using 4 x 4 matrices rather than 3 x 3. Translation

General 3 D Rotation 1. Translate the object such that rotation axis passes through

General 3 D Rotation 1. Translate the object such that rotation axis passes through the origin. 2. Rotate the object such that rotation axis coincides with one of Cartesian axes. 3. Perform specified rotation about the Cartesian axis. 4. Apply inverse rotation to return rotation axis to original direction. 5. Apply inverse translation to return rotation axis to original position.

Efficient 3 D Rotations by Quaternions

Efficient 3 D Rotations by Quaternions

3 D Scaling Enlarging object also moves it from origin

3 D Scaling Enlarging object also moves it from origin

Scaling with respect to a fixed point (not necessarily of object)

Scaling with respect to a fixed point (not necessarily of object)