2D Computer Graphics Diego Nehab Summer 2020 IMPA 1 Gradients in - - PowerPoint PPT Presentation

2d computer graphics
SMART_READER_LITE
LIVE PREVIEW

2D Computer Graphics Diego Nehab Summer 2020 IMPA 1 Gradients in - - PowerPoint PPT Presentation

2D Computer Graphics Diego Nehab Summer 2020 IMPA 1 Gradients in SVG [SVG, 2011] Defjned by a list of n stops t i c i 0 1 with i 1 n t i t i 1 c t is linear by parts t i t c i t t i c i 1 1 c t t i t t i 1 t i t i 1 sRGBA Color


slide-1
SLIDE 1

2D Computer Graphics

Diego Nehab Summer 2020

IMPA 1

slide-2
SLIDE 2

Gradients in SVG [SVG, 2011]

slide-3
SLIDE 3

Color ramp

A color ramp is a function c c: [0, 1] → sRGBA that maps the interval [0, 1] to colors with transparency Defjned by a list of n stops ti ci 0 1 sRGBA with i 1 n ti ti

1

c t is linear by parts c t ti

1

t ci t ti ci

1

ti

1

ti ti t ti

1 2

slide-4
SLIDE 4

Color ramp

A color ramp is a function c c: [0, 1] → sRGBA that maps the interval [0, 1] to colors with transparency Defjned by a list of n stops (ti, ci) ∈ [0, 1] × sRGBA, with i ∈ {1, . . . , n}, ti < ti+1 c t is linear by parts c t ti

1

t ci t ti ci

1

ti

1

ti ti t ti

1 2

slide-5
SLIDE 5

Color ramp

A color ramp is a function c c: [0, 1] → sRGBA that maps the interval [0, 1] to colors with transparency Defjned by a list of n stops (ti, ci) ∈ [0, 1] × sRGBA, with i ∈ {1, . . . , n}, ti < ti+1 c(t) is linear by parts c(t) = (ti+1 − t) ci + (t − ti) ci+1 ti+1 − ti , ti ≤ t < ti+1

2

slide-6
SLIDE 6

Wrapping function (or spread method)

A wrapping function s s: R → [0, 1] maps a real number to the domain of the color ramp E.g., pad (or clamp), repeat (or wrap), and refmect (or mirror) pad t 1 0 t repeat t t t reflect t 2 1

2 t 1 2 t 1 2 3

slide-7
SLIDE 7

Wrapping function (or spread method)

A wrapping function s s: R → [0, 1] maps a real number to the domain of the color ramp E.g., pad (or clamp), repeat (or wrap), and refmect (or mirror) pad(t) = min

  • 1, max(0, t)
  • repeat t

t t reflect t 2 1

2 t 1 2 t 1 2 3

slide-8
SLIDE 8

Wrapping function (or spread method)

A wrapping function s s: R → [0, 1] maps a real number to the domain of the color ramp E.g., pad (or clamp), repeat (or wrap), and refmect (or mirror) pad(t) = min

  • 1, max(0, t)
  • repeat(t) = t − ⌊t⌋

reflect t 2 1

2 t 1 2 t 1 2 3

slide-9
SLIDE 9

Wrapping function (or spread method)

A wrapping function s s: R → [0, 1] maps a real number to the domain of the color ramp E.g., pad (or clamp), repeat (or wrap), and refmect (or mirror) pad(t) = min

  • 1, max(0, t)
  • repeat(t) = t − ⌊t⌋

reflect(t) = 2

  • 1

2 t − ⌊ 1 2 t + 1 2⌋

  • 3
slide-10
SLIDE 10

Linear gradient mapping

A linear gradient mapping is a function ℓ ℓ: R2 → R parametrized by 2 control points p1, p2 p1 p2 p It computes the normalized projected length of p p1 into p2 p1 p p p1 p2 p1 p2 p1 p2 p1

4

slide-11
SLIDE 11

Linear gradient mapping

A linear gradient mapping is a function ℓ ℓ: R2 → R parametrized by 2 control points p1, p2 p1 p2 p It computes the normalized projected length of p p1 into p2 p1 p p p1 p2 p1 p2 p1 p2 p1

4

slide-12
SLIDE 12

Linear gradient mapping

A linear gradient mapping is a function ℓ ℓ: R2 → R parametrized by 2 control points p1, p2 p1 p2 p It computes the normalized projected length of p − p1 into p2 − p1 ℓ(p) = p − p1, p2 − p1 p2 − p1, p2 − p1

4

slide-13
SLIDE 13

Radial gradient mapping

A radial gradient mapping is a function r r : R2 → R parametrized by a center c, a radius r, and a focal point f c p f q It computes the length ratio of from point p to f and q to f r p p f q f where q is the intersection between the ray from focal point f to point p and the circle centered at c with radius r

5

slide-14
SLIDE 14

Radial gradient mapping

A radial gradient mapping is a function r r : R2 → R parametrized by a center c, a radius r, and a focal point f c p f q It computes the length ratio of from point p to f and q to f r p p f q f where q is the intersection between the ray from focal point f to point p and the circle centered at c with radius r

5

slide-15
SLIDE 15

Radial gradient mapping

A radial gradient mapping is a function r r : R2 → R parametrized by a center c, a radius r, and a focal point f c p f q It computes the length ratio of from point p to f and q to f r(p) = p − f q − f where q is the intersection between the ray from focal point f to point p and the circle centered at c with radius r

5

slide-16
SLIDE 16

Paint transforms

Every shape includes a transformation To that maps it from object coordinates (where the object is defjned) to scene coordinates (where the object is placed on a scene) Similarly, every paint includes a transformation Tp that maps points from paint coordinates (where the color is computed) to scene coordinates (where the color is painted) If you want to apply a transformation T to a shape and want its paint to move with it, simply compose To T To Tp T Tp

6

slide-17
SLIDE 17

Paint transforms

Every shape includes a transformation To that maps it from object coordinates (where the object is defjned) to scene coordinates (where the object is placed on a scene) Similarly, every paint includes a transformation Tp that maps points from paint coordinates (where the color is computed) to scene coordinates (where the color is painted) If you want to apply a transformation T to a shape and want its paint to move with it, simply compose To T To Tp T Tp

6

slide-18
SLIDE 18

Paint transforms

Every shape includes a transformation To that maps it from object coordinates (where the object is defjned) to scene coordinates (where the object is placed on a scene) Similarly, every paint includes a transformation Tp that maps points from paint coordinates (where the color is computed) to scene coordinates (where the color is painted) If you want to apply a transformation T to a shape and want its paint to move with it, simply compose T′

  • = T ◦ To

T′

p = T ◦ Tp 6

slide-19
SLIDE 19

Gradient paints

A linear gradient is a function R2 → sRGBA formed by the composition of a paint transform Tp, a linear gradient mapping ℓ, a wrapping function s, and a color ramp c p → c s

  • ℓ(T−1

p p)

  • Show in Inkscape

7

slide-20
SLIDE 20

Gradient paints

A linear gradient is a function R2 → sRGBA formed by the composition of a paint transform Tp, a linear gradient mapping ℓ, a wrapping function s, and a color ramp c p → c s

  • ℓ(T−1

p p)

  • Show in Inkscape

7

slide-21
SLIDE 21

Examples

8

slide-22
SLIDE 22

Gradient paints

A radial gradient is a function R2 → sRGBA formed by by the composition of a paint transform Tp, a radial gradient mapping r, a wrapping function s, and a color ramp c p → c s

  • r(T−1

p p)

  • Show in Inkscape

9

slide-23
SLIDE 23

Gradient paints

A radial gradient is a function R2 → sRGBA formed by by the composition of a paint transform Tp, a radial gradient mapping r, a wrapping function s, and a color ramp c p → c s

  • r(T−1

p p)

  • Show in Inkscape

9

slide-24
SLIDE 24

Examples

10

slide-25
SLIDE 25

Evaluating gradient paints

How to effjciently evaluate a ramp

  • Linear search, binary search, uniform sampling

How to effjciently evaluate linear and radial mappings?

  • How many parameters are really needed?

11

slide-26
SLIDE 26

Evaluating gradient paints

How to effjciently evaluate a ramp

  • Linear search, binary search, uniform sampling

How to effjciently evaluate linear and radial mappings?

  • How many parameters are really needed?

11

slide-27
SLIDE 27

Gradients in PostScript and PDF

slide-28
SLIDE 28

Shading types

Type 1: Function-dictionary-based shading

  • Basically texture mapping
  • Show EPS fjle
  • Will discuss in following classes

Type 2: Axial shading

  • Same as linear gradient
  • Show EPS fjle

12

slide-29
SLIDE 29

Shading types

Type 1: Function-dictionary-based shading

  • Basically texture mapping
  • Show EPS fjle
  • Will discuss in following classes

Type 2: Axial shading

  • Same as linear gradient
  • Show EPS fjle

12

slide-30
SLIDE 30

Examples

13

slide-31
SLIDE 31

Examples

14

slide-32
SLIDE 32

Shading types

Type 3: Radial shading

  • Not the same radial gradient
  • Defjne

p r to be the circle centered at p with radius r

  • Inputs are centers and radii for 2 circles p1 r1

p2 r2

  • Maps the “interpolated” circle to the color from a ramp c

1 t p1 r1 t p2 r2 c t

  • Show EPS fjle

15

slide-33
SLIDE 33

Shading types

Type 3: Radial shading

  • Not the same radial gradient
  • Defjne γ(p, r) to be the circle centered at p with radius r
  • Inputs are centers and radii for 2 circles p1 r1

p2 r2

  • Maps the “interpolated” circle to the color from a ramp c

1 t p1 r1 t p2 r2 c t

  • Show EPS fjle

15

slide-34
SLIDE 34

Shading types

Type 3: Radial shading

  • Not the same radial gradient
  • Defjne γ(p, r) to be the circle centered at p with radius r
  • Inputs are centers and radii for 2 circles (p1, r1), (p2, r2)
  • Maps the “interpolated” circle to the color from a ramp c

1 t p1 r1 t p2 r2 c t

  • Show EPS fjle

15

slide-35
SLIDE 35

Shading types

Type 3: Radial shading

  • Not the same radial gradient
  • Defjne γ(p, r) to be the circle centered at p with radius r
  • Inputs are centers and radii for 2 circles (p1, r1), (p2, r2)
  • Maps the “interpolated” circle to the color from a ramp c

γ

  • (1 − t) (p1, r1) + t (p2, r2)
  • → c(t)
  • Show EPS fjle

15

slide-36
SLIDE 36

Shading types

Type 3: Radial shading

  • Not the same radial gradient
  • Defjne γ(p, r) to be the circle centered at p with radius r
  • Inputs are centers and radii for 2 circles (p1, r1), (p2, r2)
  • Maps the “interpolated” circle to the color from a ramp c

γ

  • (1 − t) (p1, r1) + t (p2, r2)
  • → c(t)
  • Show EPS fjle

15

slide-37
SLIDE 37

Examples

16

slide-38
SLIDE 38

Shading types

Type 4: Free-form Gouraud-shaded triangle mesh

  • Inputs are 3 vertices with colors (p1, c1), (p2, c2), (p3, c3)
  • Maps convex combination of points to same combination of colors
  • I.e., given 0

s t 1, Gouraud maps p s t c s t with p s t s p1 t p2 1 s t p3 c s t s c1 t c2 1 s t c3

  • Triangles can be independent, strips, or fans
  • Show EPS fjle and PDF fjle

Type 5: Lattice-form Gouraud-shaded triangle mesh

  • Same, but for a “regular” grid of triangles

17

slide-39
SLIDE 39

Shading types

Type 4: Free-form Gouraud-shaded triangle mesh

  • Inputs are 3 vertices with colors (p1, c1), (p2, c2), (p3, c3)
  • Maps convex combination of points to same combination of colors
  • I.e., given 0

s t 1, Gouraud maps p s t c s t with p s t s p1 t p2 1 s t p3 c s t s c1 t c2 1 s t c3

  • Triangles can be independent, strips, or fans
  • Show EPS fjle and PDF fjle

Type 5: Lattice-form Gouraud-shaded triangle mesh

  • Same, but for a “regular” grid of triangles

17

slide-40
SLIDE 40

Shading types

Type 4: Free-form Gouraud-shaded triangle mesh

  • Inputs are 3 vertices with colors (p1, c1), (p2, c2), (p3, c3)
  • Maps convex combination of points to same combination of colors
  • I.e., given 0 < s, t < 1, Gouraud maps

p(s, t) → c(s, t) with p(s, t) = s p1 + t p2 + (1 − s − t) p3 c(s, t) = s c1 + t c2 + (1 − s − t) c3

  • Triangles can be independent, strips, or fans
  • Show EPS fjle and PDF fjle

Type 5: Lattice-form Gouraud-shaded triangle mesh

  • Same, but for a “regular” grid of triangles

17

slide-41
SLIDE 41

Shading types

Type 4: Free-form Gouraud-shaded triangle mesh

  • Inputs are 3 vertices with colors (p1, c1), (p2, c2), (p3, c3)
  • Maps convex combination of points to same combination of colors
  • I.e., given 0 < s, t < 1, Gouraud maps

p(s, t) → c(s, t) with p(s, t) = s p1 + t p2 + (1 − s − t) p3 c(s, t) = s c1 + t c2 + (1 − s − t) c3

  • Triangles can be independent, strips, or fans
  • Show EPS fjle and PDF fjle

Type 5: Lattice-form Gouraud-shaded triangle mesh

  • Same, but for a “regular” grid of triangles

17

slide-42
SLIDE 42

Shading types

Type 4: Free-form Gouraud-shaded triangle mesh

  • Inputs are 3 vertices with colors (p1, c1), (p2, c2), (p3, c3)
  • Maps convex combination of points to same combination of colors
  • I.e., given 0 < s, t < 1, Gouraud maps

p(s, t) → c(s, t) with p(s, t) = s p1 + t p2 + (1 − s − t) p3 c(s, t) = s c1 + t c2 + (1 − s − t) c3

  • Triangles can be independent, strips, or fans
  • Show EPS fjle and PDF fjle

Type 5: Lattice-form Gouraud-shaded triangle mesh

  • Same, but for a “regular” grid of triangles

17

slide-43
SLIDE 43

Shading types

Type 4: Free-form Gouraud-shaded triangle mesh

  • Inputs are 3 vertices with colors (p1, c1), (p2, c2), (p3, c3)
  • Maps convex combination of points to same combination of colors
  • I.e., given 0 < s, t < 1, Gouraud maps

p(s, t) → c(s, t) with p(s, t) = s p1 + t p2 + (1 − s − t) p3 c(s, t) = s c1 + t c2 + (1 − s − t) c3

  • Triangles can be independent, strips, or fans
  • Show EPS fjle and PDF fjle

Type 5: Lattice-form Gouraud-shaded triangle mesh

  • Same, but for a “regular” grid of triangles

17

slide-44
SLIDE 44

Examples

18

slide-45
SLIDE 45

Examples

19

slide-46
SLIDE 46

Shading types

Type 6: Coons patch mesh

  • Each patch is defjned by 4 connected cubic Bézier segments

h0(s), h1(s), v0(t), and v1(t)

  • Curves are setup to share endpoints like such

v00 v0 0 h0 0 v01 v0 1 h1 0 v10 v1 0 h0 1 v11 v1 1 h1 1

  • Defjne h

0 1 2 R2 to interpolate between curves h0 h1 h s t 1 t h0 s t h1 s

  • Defjne v

0 1 2 R2 to interpolate between v0 v1 v s t 1 s v0 t s v1 t

  • Note that v s t and h s t interpolate all shared vertices

20

slide-47
SLIDE 47

Shading types

Type 6: Coons patch mesh

  • Each patch is defjned by 4 connected cubic Bézier segments

h0(s), h1(s), v0(t), and v1(t)

  • Curves are setup to share endpoints like such

v00 = v0(0) = h0(0) v01 = v0(1) = h1(0) v10 = v1(0) = h0(1) v11 = v1(1) = h1(1)

  • Defjne h

0 1 2 R2 to interpolate between curves h0 h1 h s t 1 t h0 s t h1 s

  • Defjne v

0 1 2 R2 to interpolate between v0 v1 v s t 1 s v0 t s v1 t

  • Note that v s t and h s t interpolate all shared vertices

20

slide-48
SLIDE 48

Shading types

Type 6: Coons patch mesh

  • Each patch is defjned by 4 connected cubic Bézier segments

h0(s), h1(s), v0(t), and v1(t)

  • Curves are setup to share endpoints like such

v00 = v0(0) = h0(0) v01 = v0(1) = h1(0) v10 = v1(0) = h0(1) v11 = v1(1) = h1(1)

  • Defjne h : [0, 1]2 → R2 to interpolate between curves h0, h1

h(s, t) = (1 − t) h0(s) + t h1(s)

  • Defjne v

0 1 2 R2 to interpolate between v0 v1 v s t 1 s v0 t s v1 t

  • Note that v s t and h s t interpolate all shared vertices

20

slide-49
SLIDE 49

Shading types

Type 6: Coons patch mesh

  • Each patch is defjned by 4 connected cubic Bézier segments

h0(s), h1(s), v0(t), and v1(t)

  • Curves are setup to share endpoints like such

v00 = v0(0) = h0(0) v01 = v0(1) = h1(0) v10 = v1(0) = h0(1) v11 = v1(1) = h1(1)

  • Defjne h : [0, 1]2 → R2 to interpolate between curves h0, h1

h(s, t) = (1 − t) h0(s) + t h1(s)

  • Defjne v : [0, 1]2 → R2 to interpolate between v0, v1

v(s, t) = (1 − s) v0(t) + s v1(t)

  • Note that v s t and h s t interpolate all shared vertices

20

slide-50
SLIDE 50

Shading types

Type 6: Coons patch mesh

  • Each patch is defjned by 4 connected cubic Bézier segments

h0(s), h1(s), v0(t), and v1(t)

  • Curves are setup to share endpoints like such

v00 = v0(0) = h0(0) v01 = v0(1) = h1(0) v10 = v1(0) = h0(1) v11 = v1(1) = h1(1)

  • Defjne h : [0, 1]2 → R2 to interpolate between curves h0, h1

h(s, t) = (1 − t) h0(s) + t h1(s)

  • Defjne v : [0, 1]2 → R2 to interpolate between v0, v1

v(s, t) = (1 − s) v0(t) + s v1(t)

  • Note that v(s, t) and h(s, t) interpolate all shared vertices

20

slide-51
SLIDE 51

Shading types

Type 6: Coons patch mesh (continued)

  • Defjne bilinear map m : V4 × [0, 1]2 → R2

ma,b

c,d(s, t) = (1 − s)(1 − t) a + (1 − s) t b + s (1 − t) c + s t d

  • The bilinear map mv00 v01

v10 v11 s t also interpolates the shared vertices

  • Therefore, so does

p s t v s t h s t mv00 v01

v10 v11 s t

  • Given colors c00, c01, c10, and c11, the patch maps

p s t mc00 c01

c10 c11 s t

  • Patches can be defjned independently or connected by strips
  • Show EPS fjle

21

slide-52
SLIDE 52

Shading types

Type 6: Coons patch mesh (continued)

  • Defjne bilinear map m : V4 × [0, 1]2 → R2

ma,b

c,d(s, t) = (1 − s)(1 − t) a + (1 − s) t b + s (1 − t) c + s t d

  • The bilinear map mv00,v01

v10,v11 (s, t) also interpolates the shared vertices

  • Therefore, so does

p s t v s t h s t mv00 v01

v10 v11 s t

  • Given colors c00, c01, c10, and c11, the patch maps

p s t mc00 c01

c10 c11 s t

  • Patches can be defjned independently or connected by strips
  • Show EPS fjle

21

slide-53
SLIDE 53

Shading types

Type 6: Coons patch mesh (continued)

  • Defjne bilinear map m : V4 × [0, 1]2 → R2

ma,b

c,d(s, t) = (1 − s)(1 − t) a + (1 − s) t b + s (1 − t) c + s t d

  • The bilinear map mv00,v01

v10,v11 (s, t) also interpolates the shared vertices

  • Therefore, so does

p(s, t) = v(s, t) + h(s, t) − mv00,v01

v10,v11 (s, t)

  • Given colors c00, c01, c10, and c11, the patch maps

p s t mc00 c01

c10 c11 s t

  • Patches can be defjned independently or connected by strips
  • Show EPS fjle

21

slide-54
SLIDE 54

Shading types

Type 6: Coons patch mesh (continued)

  • Defjne bilinear map m : V4 × [0, 1]2 → R2

ma,b

c,d(s, t) = (1 − s)(1 − t) a + (1 − s) t b + s (1 − t) c + s t d

  • The bilinear map mv00,v01

v10,v11 (s, t) also interpolates the shared vertices

  • Therefore, so does

p(s, t) = v(s, t) + h(s, t) − mv00,v01

v10,v11 (s, t)

  • Given colors c00, c01, c10, and c11, the patch maps

p(s, t) → mc00,c01

c10,c11 (s, t)

  • Patches can be defjned independently or connected by strips
  • Show EPS fjle

21

slide-55
SLIDE 55

Shading types

Type 6: Coons patch mesh (continued)

  • Defjne bilinear map m : V4 × [0, 1]2 → R2

ma,b

c,d(s, t) = (1 − s)(1 − t) a + (1 − s) t b + s (1 − t) c + s t d

  • The bilinear map mv00,v01

v10,v11 (s, t) also interpolates the shared vertices

  • Therefore, so does

p(s, t) = v(s, t) + h(s, t) − mv00,v01

v10,v11 (s, t)

  • Given colors c00, c01, c10, and c11, the patch maps

p(s, t) → mc00,c01

c10,c11 (s, t)

  • Patches can be defjned independently or connected by strips
  • Show EPS fjle

21

slide-56
SLIDE 56

Shading types

Type 6: Coons patch mesh (continued)

  • Defjne bilinear map m : V4 × [0, 1]2 → R2

ma,b

c,d(s, t) = (1 − s)(1 − t) a + (1 − s) t b + s (1 − t) c + s t d

  • The bilinear map mv00,v01

v10,v11 (s, t) also interpolates the shared vertices

  • Therefore, so does

p(s, t) = v(s, t) + h(s, t) − mv00,v01

v10,v11 (s, t)

  • Given colors c00, c01, c10, and c11, the patch maps

p(s, t) → mc00,c01

c10,c11 (s, t)

  • Patches can be defjned independently or connected by strips
  • Show EPS fjle

21

slide-57
SLIDE 57

Examples

22

slide-58
SLIDE 58

Shading types

Type 7: Tensor-product patch mesh

  • This is just a generalization of Bézier curves to patches
  • Given control points pi j, for i j

0 1 2 3 , the tensor product is p s t

3 i 3 j

pi j bi 3 s bj 3 t where bi 3,bj 3 are the cubic Bernstein polynomials

  • Given colors c00, c01, c10, c11, the patch maps

p s t mc00 c01

c10 c11 s t

  • Patches can be defjned independently or connected by strips
  • (Coons patch is a special case of tensor-product patch)
  • Show EPS fjle

23

slide-59
SLIDE 59

Shading types

Type 7: Tensor-product patch mesh

  • This is just a generalization of Bézier curves to patches
  • Given control points pi,j, for i, j ∈ {0, 1, 2, 3}, the tensor product is

p(s, t) =

3

  • i=0

3

  • j=0

pi,j bi,3(s) bj,3(t) where bi,3,bj,3 are the cubic Bernstein polynomials

  • Given colors c00, c01, c10, c11, the patch maps

p s t mc00 c01

c10 c11 s t

  • Patches can be defjned independently or connected by strips
  • (Coons patch is a special case of tensor-product patch)
  • Show EPS fjle

23

slide-60
SLIDE 60

Shading types

Type 7: Tensor-product patch mesh

  • This is just a generalization of Bézier curves to patches
  • Given control points pi,j, for i, j ∈ {0, 1, 2, 3}, the tensor product is

p(s, t) =

3

  • i=0

3

  • j=0

pi,j bi,3(s) bj,3(t) where bi,3,bj,3 are the cubic Bernstein polynomials

  • Given colors c00, c01, c10, c11, the patch maps

p(s, t) → mc00,c01

c10,c11 (s, t)

  • Patches can be defjned independently or connected by strips
  • (Coons patch is a special case of tensor-product patch)
  • Show EPS fjle

23

slide-61
SLIDE 61

Shading types

Type 7: Tensor-product patch mesh

  • This is just a generalization of Bézier curves to patches
  • Given control points pi,j, for i, j ∈ {0, 1, 2, 3}, the tensor product is

p(s, t) =

3

  • i=0

3

  • j=0

pi,j bi,3(s) bj,3(t) where bi,3,bj,3 are the cubic Bernstein polynomials

  • Given colors c00, c01, c10, c11, the patch maps

p(s, t) → mc00,c01

c10,c11 (s, t)

  • Patches can be defjned independently or connected by strips
  • (Coons patch is a special case of tensor-product patch)
  • Show EPS fjle

23

slide-62
SLIDE 62

Shading types

Type 7: Tensor-product patch mesh

  • This is just a generalization of Bézier curves to patches
  • Given control points pi,j, for i, j ∈ {0, 1, 2, 3}, the tensor product is

p(s, t) =

3

  • i=0

3

  • j=0

pi,j bi,3(s) bj,3(t) where bi,3,bj,3 are the cubic Bernstein polynomials

  • Given colors c00, c01, c10, c11, the patch maps

p(s, t) → mc00,c01

c10,c11 (s, t)

  • Patches can be defjned independently or connected by strips
  • (Coons patch is a special case of tensor-product patch)
  • Show EPS fjle

23

slide-63
SLIDE 63

Shading types

Type 7: Tensor-product patch mesh

  • This is just a generalization of Bézier curves to patches
  • Given control points pi,j, for i, j ∈ {0, 1, 2, 3}, the tensor product is

p(s, t) =

3

  • i=0

3

  • j=0

pi,j bi,3(s) bj,3(t) where bi,3,bj,3 are the cubic Bernstein polynomials

  • Given colors c00, c01, c10, c11, the patch maps

p(s, t) → mc00,c01

c10,c11 (s, t)

  • Patches can be defjned independently or connected by strips
  • (Coons patch is a special case of tensor-product patch)
  • Show EPS fjle

23

slide-64
SLIDE 64

Examples

24

slide-65
SLIDE 65

Examples

25

slide-66
SLIDE 66

References

PostScript Language Reference. Adobe Systems Incorporated, third edition, 1999. Adobe Portable Document Format, v. 1.7. Adobe Systems Incorporated, sixth edition, 2006.

  • SVG. Scalable Vector Graphics, v. 1.1. W3C, second edition, 2011.

26