18
CT4201/EC4215: Computer Graphics Transformation BOCHANG MOON

CT4201/EC4215: Computer Graphics Transformation€¦ · CT4201/EC4215: Computer Graphics Transformation BOCHANGMOON. Transformation • Fundamental operation to arrange objects in

  • Upload
    others

  • View
    13

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CT4201/EC4215: Computer Graphics Transformation€¦ · CT4201/EC4215: Computer Graphics Transformation BOCHANGMOON. Transformation • Fundamental operation to arrange objects in

CT4201/EC4215: Computer Graphics

TransformationBOCHANG MOON

Page 2: CT4201/EC4215: Computer Graphics Transformation€¦ · CT4201/EC4215: Computer Graphics Transformation BOCHANGMOON. Transformation • Fundamental operation to arrange objects in

Transformation• Fundamental operation to arrange objects in a 3D scene

Object 3D scene

Page 3: CT4201/EC4215: Computer Graphics Transformation€¦ · CT4201/EC4215: Computer Graphics Transformation BOCHANGMOON. Transformation • Fundamental operation to arrange objects in

Transformation: Scaling• Change length along the coordinate axes

◦ 𝑠𝑐𝑎𝑙𝑒 𝑠 , 𝑠𝑠 00 𝑠

◦𝑠 00 𝑠

𝑥𝑦

𝑠 𝑥𝑠 𝑦

x

y

x

y

0.5 00 0.5

Page 4: CT4201/EC4215: Computer Graphics Transformation€¦ · CT4201/EC4215: Computer Graphics Transformation BOCHANGMOON. Transformation • Fundamental operation to arrange objects in

Transformation: Scaling• Change length along the coordinate axes

◦ 𝑠𝑐𝑎𝑙𝑒 𝑠 , 𝑠𝑠 00 𝑠

◦𝑠 00 𝑠

𝑥𝑦

𝑠 𝑥𝑠 𝑦

x

y

x

y

0.5 00 2.0

Page 5: CT4201/EC4215: Computer Graphics Transformation€¦ · CT4201/EC4215: Computer Graphics Transformation BOCHANGMOON. Transformation • Fundamental operation to arrange objects in

Transformation: Shearing• Push objects sideways along horizontal or vertical direction◦ 𝑠ℎ𝑒𝑎𝑟 𝑠 1 𝑠

0 1◦ 𝑠ℎ𝑒𝑎𝑟 𝑠 1 0

𝑠 1

x

y

x

y

1 10 1

Page 6: CT4201/EC4215: Computer Graphics Transformation€¦ · CT4201/EC4215: Computer Graphics Transformation BOCHANGMOON. Transformation • Fundamental operation to arrange objects in

Transformation: Shearing• Push objects sideways along horizontal or vertical direction◦ 𝑠ℎ𝑒𝑎𝑟 𝑠 1 𝑠

0 1◦ 𝑠ℎ𝑒𝑎𝑟 𝑠 1 0

𝑠 1

x

y

x

y

1 01 1

Page 7: CT4201/EC4215: Computer Graphics Transformation€¦ · CT4201/EC4215: Computer Graphics Transformation BOCHANGMOON. Transformation • Fundamental operation to arrange objects in

Transformation: Rotation• Rotate objects counterclockwise◦ 𝑟𝑜𝑡𝑎𝑡𝑒 𝜃 𝑐𝑜𝑠𝜃 𝑠𝑖𝑛𝜃

𝑠𝑖𝑛𝜃 𝑐𝑜𝑠𝜃

x

y

x

y

𝑐𝑜𝑠𝜋4 𝑠𝑖𝑛

𝜋4

𝑠𝑖𝑛𝜋4 𝑐𝑜𝑠

𝜋4

45 degrees

Page 8: CT4201/EC4215: Computer Graphics Transformation€¦ · CT4201/EC4215: Computer Graphics Transformation BOCHANGMOON. Transformation • Fundamental operation to arrange objects in

Transformation: Rotation• Rotate objects counterclockwise◦ 𝑟𝑜𝑡𝑎𝑡𝑒 𝜃 𝑐𝑜𝑠𝜃 𝑠𝑖𝑛𝜃

𝑠𝑖𝑛𝜃 𝑐𝑜𝑠𝜃

x

y

x

y

𝑐𝑜𝑠𝜋

4 𝑠𝑖𝑛𝜋

4𝑠𝑖𝑛

𝜋4 𝑐𝑜𝑠

𝜋4

‐45 degrees

Page 9: CT4201/EC4215: Computer Graphics Transformation€¦ · CT4201/EC4215: Computer Graphics Transformation BOCHANGMOON. Transformation • Fundamental operation to arrange objects in

Transformation: Reflection• Reflect objects across either of the coordinate axes◦ 𝑟𝑒𝑓𝑙𝑒𝑐𝑡_𝑦 1 0

0 1

x

y

x

y

Page 10: CT4201/EC4215: Computer Graphics Transformation€¦ · CT4201/EC4215: Computer Graphics Transformation BOCHANGMOON. Transformation • Fundamental operation to arrange objects in

Transformation: Reflection• Reflect objects across either of the coordinate axes◦ 𝑟𝑒𝑓𝑙𝑒𝑐𝑡_𝑥 1 0

0 1

x

y

x

y

Page 11: CT4201/EC4215: Computer Graphics Transformation€¦ · CT4201/EC4215: Computer Graphics Transformation BOCHANGMOON. Transformation • Fundamental operation to arrange objects in

Transformation: Composition• Apply more than one transformation to an object

• e.g. apply a scale S, and then a rotation R◦

𝑥𝑦 𝑅𝑆

𝑥𝑦

x

y

x

y

Page 12: CT4201/EC4215: Computer Graphics Transformation€¦ · CT4201/EC4215: Computer Graphics Transformation BOCHANGMOON. Transformation • Fundamental operation to arrange objects in

Transformation: Composition• Apply more than one transformation to an object

• e.g. apply a scale S, and then a rotation R◦

𝑥𝑦 𝑆

𝑥𝑦

x

y

x

y

Page 13: CT4201/EC4215: Computer Graphics Transformation€¦ · CT4201/EC4215: Computer Graphics Transformation BOCHANGMOON. Transformation • Fundamental operation to arrange objects in

Transformation: Composition• Apply more than one transformation to an object

• e.g. apply a scale S, and then a rotation R◦

𝑥𝑦 𝑅

𝑥𝑦

x

y

x

y

Page 14: CT4201/EC4215: Computer Graphics Transformation€¦ · CT4201/EC4215: Computer Graphics Transformation BOCHANGMOON. Transformation • Fundamental operation to arrange objects in

Inverse Transformation• Your transformation◦ 𝑥 𝑅𝑆𝑥 𝑇𝑥

• Undo your transformation◦ 𝑥 𝑇 𝑥

x

y

x

y

Page 15: CT4201/EC4215: Computer Graphics Transformation€¦ · CT4201/EC4215: Computer Graphics Transformation BOCHANGMOON. Transformation • Fundamental operation to arrange objects in

Inverse Transformation• Your transformation◦ 𝑥 𝑅𝑆𝑥 𝑇𝑥

• Undo your transformation◦ 𝑥 𝑇 𝑥 𝑅𝑆 𝑥 𝑆 𝑅 𝑥

x

y

x

y

Page 16: CT4201/EC4215: Computer Graphics Transformation€¦ · CT4201/EC4215: Computer Graphics Transformation BOCHANGMOON. Transformation • Fundamental operation to arrange objects in

Inverse Transformation• Your transformation◦ 𝑥 𝑅𝑆𝑥 𝑇𝑥

• Undo your transformation◦ 𝑥 𝑇 𝑥 𝑅𝑆 𝑥 𝑆 𝑅 𝑥

x

y

x

y

𝑅

Page 17: CT4201/EC4215: Computer Graphics Transformation€¦ · CT4201/EC4215: Computer Graphics Transformation BOCHANGMOON. Transformation • Fundamental operation to arrange objects in

Inverse Transformation• Your transformation◦ 𝑥 𝑅𝑆𝑥 𝑇𝑥

• Undo your transformation◦ 𝑥 𝑇 𝑥 𝑅𝑆 𝑥 𝑆 𝑅 𝑥

x

y

x

y

𝑆

Page 18: CT4201/EC4215: Computer Graphics Transformation€¦ · CT4201/EC4215: Computer Graphics Transformation BOCHANGMOON. Transformation • Fundamental operation to arrange objects in

Inverse Matrix• M = 2 x 2 matrix

◦ 𝑀 𝑀 𝑀𝑀 𝑀

◦ 𝑀 𝑀 𝑀𝑀 𝑀