Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

28
2.1 Geometric/Coordinate Transformations Aalto CS-C3100 Computer Graphics Jaakko Lehtinen Lots of slides from Frédo Durand Background image: Prateek Joshi

Transcript of Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

Page 1: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

2.1 Geometric/Coordinate Transformations

Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

Lots of slides from Frédo Durand

Bac

kgro

und

imag

e: P

rate

ek J

oshi

Page 2: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

In This Video

2

• What are geometric transformations? • Useful types of transformations • Transformations as algebraic groups

– And why it is useful to look at them that way

Page 3: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

Two Views on Transformations

3

• First, the geometric one: a warp of space – Focus on how a point x gets transported into x’

points in original configuration points in warped configuration after transformation

Page 4: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

Two Views on Transformations

4

• First, the geometric one: a warp of space – Focus on how a point x gets transported into x’

From Sederberg and Parry, Siggraph 1986 link

points in original configuration points in warped configuration after transformation

Page 5: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

Two Views on Transformations

5

• Second, the coordinate view – Given the coordinates (x, y) of a point in System 1,

what are its coordinates (x’, y’) in System 2?

Coordinate system 1

x axis

y axis

(x, y)

Coordinate system 2

x’ axisy’ axis (x’, y’)

Page 6: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

View 2 is Directly Useful Here

Object coordinates

World coordinates

View coordinates

Image coordinates

Transformations take us between these coordinates.

Page 7: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

7

The two views are not contradictory

Page 8: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

8

Simple Transformations

?

Page 9: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

9

Some Simple Transformations

• Can be combined • Are these operations invertible?

Yes, except scale = 0

Page 10: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

10

Rigid-Body / Euclidean Transforms

• What properties are preserved?

TranslationRotation

Rigid / Euclidean

Identity

Page 11: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

11

Rigid-Body / Euclidean Transforms

• Preserves distances • Preserves angles

TranslationRotation

Rigid / Euclidean

Identity

Page 12: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

• Preserves angles • “The shapes are the same”, just

at different scale, orientation and location

12

Similitudes / Similarity Transforms

TranslationRotation

Rigid / Euclidean

Similitudes

Isotropic ScalingIdentity

Page 13: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

13

Linear Transformations

TranslationRotation

Rigid / EuclideanLinear

Similitudes

Isotropic ScalingIdentity

Scaling

Shear

Reflection

Page 14: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

14

Linear Transformations

• L(p + q) = L(p) + L(q) • L(ap) = a L(p)

TranslationRotation

Rigid / EuclideanLinear

Similitudes

Isotropic Scaling

Scaling

Shear

ReflectionIdentity

Page 15: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

15

Linear Transformations

• L(p + q) = L(p) + L(q) • L(ap) = a L(p)

TranslationRotation

Rigid / EuclideanLinear

Similitudes

Isotropic Scaling

Scaling

Shear

ReflectionIdentity

???

Page 16: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

16

Linear Transformations

• L(p + q) = L(p) + L(q) • L(ap) = a L(p)

TranslationRotation

Rigid / EuclideanLinear

Similitudes

Isotropic Scaling

Scaling

Shear

ReflectionIdentity

???

Translation is not linear: f(p) = p+t

f(ap) = ap+t ≠ a(p+t) = a f(p) f(p+q) = p+q+t ≠ (p+t)+(q+t) = f(p) + f(q)

Page 17: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

17

Affine Transformations

• What is preserved..?

TranslationRotation

Rigid / EuclideanLinear

Similitudes

Isotropic Scaling

Scaling

Shear

ReflectionIdentity

Affine

Page 18: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

18

Affine Transformations

• Preserves parallel lines

TranslationRotation

Rigid / EuclideanLinear

Similitudes

Isotropic Scaling

Scaling

Shear

ReflectionIdentity

Affine

Page 19: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

19

Projective Transformations• Preserves lines: lines remain lines

(planes remain planes in 3D)

TranslationRotation

Rigid / EuclideanLinear

Affine

(Planar) Projective

Similitudes

Isotropic Scaling

Scaling

Shear

Reflection

Perspective

Identity

Page 20: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

20

Page 21: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

• What’s with the hierarchy? Why have we grouped types of transformations with and within each other?

21

What’s so nice about these?

TranslationRotation

Rigid / Euclidean

LinearAffine(Planar) Projective

Similitudes

Isotropic Scaling

Scaling

ShearReflection

Perspective

Identity

Page 22: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

• They are closed under concatenation – Means e.g. that an affine transformation followed by

another affine transformation is still an affine transformation

– Same for every subgroup, e.g. rotations, translations..

• Very convenient! • Projections are the

most general – Others are its

special cases22

What’s so nice about these?

TranslationRotation

Rigid / Euclidean

LinearAffine(Planar) Projective

Similitudes

Isotropic Scaling

Scaling

ShearReflection

Perspective

Identity

Page 23: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

Name-dropping

23

• Fancy name: Group Theory • Remember algebra?

– A group is a set S with an operation f that takes two elements of S and produces a third: (and some other axioms)

• These transformations are group(s) and subgroups – The transformations are the set S,

concatenation of transformations is f

s, t ⇥ S, f(s, t) = u � u ⇥ S

Page 24: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

Transforms are Groups

24

• Why is this useful? – You can represent any number of

successive transformations by a single compound transformation

• Example – The object-to-world transformation,

the world-to-view transformation, and the perspective projection (view-to-image) can all be folded into a single projective object-to-image transformation

– (OpenGL: Modelview, projection)

Disclaimer: Not ANY

transformation, but the types

just introduced

Object coordinates World coordinates View coordinates Image coordinates

Page 25: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

More Complex Transformations..

25

• ...can be built out of these, e.g.

• “Skinning” – Blending of affine

transformations – We’ll do this later..

and you will code it up! :) Ilya Baran

Page 26: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

More Complex Transformations

26

• Harmonic coordinates (link to paper) – Object enclosed in simple “cage”, each object point

knows the influence each cage vertex has on it – Deform the cage, and the object moves!

Pix

ar

Page 27: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

27

Questions?

Page 28: Aalto CS-C3100 Computer Graphics Jaakko Lehtinen

28

Key Concepts• Geometric transformations change the positions/

coordinates of points in space • Translation, scaling, rotation, shearing, reflection,

and planar perspective transformations are the building blocks of graphics – And, as you will see in the next two videos, they can

all be represented using matrices • More complex ones can be built out of them