3D Transformations

11
 Computer graphics 3D Rotation transformation

description

Computer Graphics 3D transformation

Transcript of 3D Transformations

  • Computer graphics

    3D Rotation transformation

  • 3D Rotation 2

    z

    x

    y

    Rotation around axis:

    - Counterclockwise, viewed from rotation axis

    z

    x

    y z

    x

    y

  • 1

    3D Rotation around arbitrary axis 1

    z

    P

    x

    yP

    Q

    2

    3

    1) Translate object such that the rotation axis coincides with X

    axis.

    2) Perform Rotation around X axis

    3) Translate the object such that the rotation axis is moved back

    to its original position

  • z x

    y

    1P

    2P

    3D Rotation around arbitrary axis 2 Rotation around axis through two points

    P1 and P1 .

    1.Translate such that axis passes through

    origin;

    2.Rotate the object such the axis of

    rotation coincides with any one axes

    3.Perform rotation about that axes

    4.Apply inverse rotation to bring the axis

    back to its original position

    5.Translate back the axis to its original

    position

  • 3D Rotation around arbitrary axis 3

    z x

    y

    1P

    2P

    Initial

    z x

    y

    '

    1P

    1. translate axis

    'P2

    zx

    y

    2. rotate axis

    '

    1P

    ''P2

    zx

    y

    3. rotate around

    z-axis

    '

    1P

    ''P2

    4. rotate back

    z x

    y

    '

    1P

    'P2

    z x

    y

    1P

    2P

    5. translate back

  • 3D Rotation around arbitrary axis 3

    z x

    y

    1P

    2P

    Initial

    z x

    y

    '

    1P

    1. translate axis

    'P2

    zx

    y

    2. rotate axis

    '

    1P

    ''P2

    zx

    y

    3. rotate around

    z-axis

    '

    1P

    ''P2

    4. rotate back

    z x

    y

    '

    1P

    'P2

    z x

    y

    1P

    2P

    5. translate back

    T(P1)R

    Rz() R1 T(P1)

  • 3D Rotation around arbitrary axis 3

    z x

    y

    1P

    2P

    Initial

    z x

    y

    '

    1P

    1. translate axis

    'P2

    zx

    y

    2. rotate axis

    '

    1P

    ''P2

    zx

    y

    3. rotate around

    z-axis

    '

    1P

    ''P2

    4. rotate back

    z x

    y

    '

    1P

    'P2

    z x

    y

    1P

    2P

    5. translate back

    T(P1)R

    Rz() R1 T(P1)

    M = T(P1) R1Rz() RT(P1)

  • Rotation around an axis

  • Projections

    Use to get a view of a solid object

    Parallel

    Perspective

  • Parallel Projection

  • Perspective Projection