Introduction to Computer Graphics Modeling (1) April 16, 2020 - - PowerPoint PPT Presentation

β–Ά
introduction to computer graphics modeling 1
SMART_READER_LITE
LIVE PREVIEW

Introduction to Computer Graphics Modeling (1) April 16, 2020 - - PowerPoint PPT Presentation

Introduction to Computer Graphics Modeling (1) April 16, 2020 Kenshi Takayama Some additional notes on quaternions 2 Another explanation for quaternions (overview) 1. Any rotation can be decomposed into even number of reflections 2.


slide-1
SLIDE 1

Introduction to Computer Graphics – Modeling (1) –

April 16, 2020 Kenshi Takayama

slide-2
SLIDE 2

Some additional notes on quaternions

2

slide-3
SLIDE 3

Another explanation for quaternions (overview)

  • 1. Any rotation can be decomposed

into even number of reflections

  • 2. Quaternions can concisely describe reflections in 3D

𝑆 βƒ—

" βƒ—

𝑦 = βˆ’ βƒ— 𝑔 βƒ— 𝑦 βƒ— 𝑔#$

  • 3. Combining two reflections equivalent to the rotation leads to the formula

𝑆! 𝑆 βƒ—

# βƒ—

𝑦 = cos $

% + πœ• sin $ %

βƒ— 𝑦 cos $

% βˆ’ πœ• sin $ %

3

slide-4
SLIDE 4

Any rotation can be decomposed into even number of reflections

  • Mathematically proven
  • Valid for any dimensions
  • Not unique (of course!)

4

R

! " ! #

πœ„

R R

! " $! #

πœ„

R

! "

πœ„

R R

One way Another way

slide-5
SLIDE 5

Quaternions recap

  • Complex number: real + imaginary

𝑏 + 𝑐 𝐣

  • Quaternion: scalar + vector

𝑏 + βƒ— 𝑀

  • Definition of quaternion multiplication:

𝑏! + 𝑀! 𝑏" + 𝑀" ≔ 𝑏!𝑏" βˆ’ 𝑀! β‹… 𝑀" + 𝑏!𝑀" + 𝑏"𝑀! + 𝑀!×𝑀"

  • Pure vectors can take multiplication by interpreting them as quaternions:

𝑀! 𝑀" = βˆ’π‘€! β‹… 𝑀" + 𝑀!×𝑀"

  • Notable properties:
  • (Relevant later)

5

βƒ— 𝑀 βƒ— 𝑀 = βˆ’ βƒ— 𝑀 " βƒ— 𝑀#! = βˆ’ βƒ— 𝑀 βƒ— 𝑀 "

If βƒ— 𝑀 β‹… π‘₯ = 0 , then βƒ— 𝑀 π‘₯ = βˆ’π‘₯ βƒ— 𝑀

βƒ— 𝑀× βƒ— 𝑀 is always zero Scalar part Vector part βƒ— 𝑀 π‘₯ = βƒ— 𝑀×π‘₯ = βˆ’π‘₯Γ— βƒ— 𝑀 = βˆ’π‘₯ βƒ— 𝑀 Multiplying βƒ— 𝑀 to rhs produces 1

slide-6
SLIDE 6

Describing reflections using quaternions

  • Reflection of a point βƒ—

𝑦 across a plane

  • rthogonal to βƒ—

𝑔: 𝑆 βƒ—

" βƒ—

𝑦 ≔ βˆ’ βƒ— 𝑔 βƒ— 𝑦 βƒ— 𝑔#$

  • Holds essential properties of reflections:
  • Linearity:

𝑆 βƒ—

' 𝑏 βƒ—

𝑦 + 𝑐 βƒ— 𝑧 = 𝑏 𝑆 βƒ—

' βƒ—

𝑦 + 𝑐 𝑆 βƒ—

' βƒ—

𝑧

  • βƒ—

𝑔 gets mapped to βˆ’ βƒ— 𝑔 :

𝑆 βƒ—

' βƒ—

𝑔 = βˆ’ βƒ— 𝑔 βƒ— 𝑔 βƒ— 𝑔() = βˆ’ βƒ— 𝑔

  • If a point βƒ—

𝑦 satisfies βƒ— 𝑦 β‹… βƒ— 𝑔 = 0 (i.e. on the plane), βƒ— 𝑦 doesn’t move:

𝑆 βƒ—

' βƒ—

𝑦 = βˆ’ βƒ— 𝑔 βƒ— 𝑦 βƒ— 𝑔() = βˆ’ βˆ’ βƒ— 𝑦 βƒ— 𝑔 βƒ— 𝑔() = βƒ— 𝑦

6

βƒ— 𝑦 𝑆 βƒ—

# βƒ—

𝑦 βƒ— 𝑔 𝑃

https://math.stackexchange.com/a/7263

Because if βƒ— 𝑦 β‹… βƒ— 𝑔 = 0 , then βƒ— 𝑔 βƒ— 𝑦 = βˆ’ βƒ— 𝑦 βƒ— 𝑔

slide-7
SLIDE 7

Setup for rotation around arbitrary axis

  • Rotation axis (unit vector): πœ•
  • Rotation angle: πœ„
  • Point before rotation: βƒ—

𝑦

  • Point after rotation: βƒ—

𝑧 ≔ 𝑆%, ' βƒ— 𝑦

  • Think of local 2D coordinate system:
  • β€œRight” vector : 𝑣 ≔ βƒ—

𝑦 βˆ’ πœ• β‹… βƒ— 𝑦 πœ•

  • β€œUp” vector: βƒ—

𝑀 ≔ πœ•Γ— βƒ— 𝑦

  • Note that 𝑣

= βƒ— 𝑀

  • (Let’s call it 𝑀)

7

πœ• πœ„ βƒ— 𝑦 βƒ— 𝑧 𝑣 βƒ— 𝑀

https://legacygl-js.glitch.me/demo/quaternion-schematic.html

πœ• β‹… βƒ— 𝑦 𝑀

𝑃

slide-8
SLIDE 8

Decompose rotation into two reflections

8

1st reflection:

βƒ— 𝑔 ≔ βƒ— 𝑀

2nd reflection:

βƒ— 𝑕 ≔ βˆ’ sin $

% 𝑣 + cos $ % βƒ—

𝑀

Top view

βƒ— 𝑔 βƒ— 𝑕 πœ„

https://legacygl-js.glitch.me/demo/quaternion-schematic.html

' ,

slide-9
SLIDE 9

Combining two reflections

  • Formula: 𝑆! 𝑆 βƒ—

# βƒ—

𝑦 = 𝑆! βˆ’ βƒ— 𝑔 βƒ— 𝑦 βƒ— 𝑔23 = βˆ’ βƒ— 𝑕 βˆ’ βƒ— 𝑔 βƒ— 𝑦 βƒ— 𝑔23 βƒ— 𝑕23 = βƒ— 𝑕 βƒ— 𝑔 βƒ— 𝑦 βƒ— 𝑔23 βƒ— 𝑕23

  • Substitute

βƒ— 𝑔 ≔ βƒ— 𝑀, 𝑕 ≔ βˆ’ sin !

" 𝑣 + cos ! " βƒ—

𝑀 to the above

  • For the left part βƒ—

𝑕 βƒ— 𝑔 :

βƒ— 𝑕 β‹… βƒ— 𝑔 = βˆ’ sin !

" 𝑣 + cos ! " βƒ—

𝑀 β‹… βƒ— 𝑀 = 𝑀# cos !

"

βƒ— 𝑕× βƒ— 𝑔 = βˆ’ sin !

" 𝑣 + cos ! " βƒ—

𝑀 Γ— βƒ— 𝑀 = βˆ’π‘€# sin !

" πœ•

Therefore,

βƒ— 𝑕 βƒ— 𝑔 = βˆ’ βƒ— 𝑕 β‹… βƒ— 𝑔 + βƒ— 𝑕× βƒ— 𝑔 = βˆ’π‘€% cos .

/ + πœ• sin . /

  • The right part βƒ—

𝑔23 βƒ— 𝑕23 = 0 1

23 is analogous: βƒ—

𝑔23 βƒ— 𝑕23 = βˆ’π‘€2% cos .

/ βˆ’ πœ• sin . /

  • Finally, we get the formula:

𝑆!, # βƒ— 𝑦 = 𝑆$ 𝑆 βƒ—

& βƒ—

𝑦 = βˆ’π‘€' cos !

" + πœ• sin ! "

βƒ— 𝑦 βˆ’π‘€(' cos !

" βˆ’ πœ• sin ! "

= cos !

" + πœ• sin ! "

βƒ— 𝑦 cos !

" βˆ’ πœ• sin ! " 9

(because 𝑣 β‹… βƒ— 𝑀 = 0 ) (because 𝑣× βƒ— 𝑀 = 𝑀"πœ• )

slide-10
SLIDE 10
  • Any rotations (poses) can be

represented as unit quaternions

  • Points on hypersphere of 4D space
  • Fix πœ• and vary πœ„

Γ¨ unit circle in 4D space

  • A pose after rotating 360Β°about a certain axis

is represented as another quaternion

  • One pose corresponds to two quaternions

(double cover)

  • A geodesic between two points π‘ž, π‘Ÿ on the

hypersphere represents interpolation of these poses

  • Should pick either π‘Ÿ or βˆ’π‘Ÿ which is closer to π‘ž (i.e. 4D dot product is positive)

Representing and blending poses using quaternions

10

ℝ# π‘ž = cos !

" + πœ• sin ! "

π‘Ÿ βˆ’π‘Ÿ (1, 0,0,0) (-1, 0,0,0) (0, πœ•%,πœ•&,πœ•') (0, -πœ•%,-πœ•&,-πœ•') πœ„=0 πœ„=𝜌 πœ„=2𝜌 πœ„=3𝜌

slide-11
SLIDE 11

Normalize quaternions or not?

  • Any quaternions can be written as scaling of unit quaternions

π‘Ÿ = 𝑠 cos !

" + πœ• sin ! " , π‘Ÿ() = 𝑠() cos ! " βˆ’ πœ• sin ! "

  • In the rotation formula, the scaling part is cancelled

π‘Ÿ βƒ— 𝑦 π‘Ÿ() = 𝑠 cos !

" + πœ• sin ! "

βƒ— 𝑦 𝑠() cos !

" βˆ’ πœ• sin ! "

= cos !

" + πœ• sin ! "

βƒ— 𝑦 cos !

" βˆ’ πœ• sin ! "

Γ¨ so, normalization isn’t needed?

  • In practice, don’t use quaternion mults for computing

coordinate transformation (because inefficient)

  • Just do explicit vector calc using axis & angle

βƒ— 𝑦 βˆ’ πœ• β‹… βƒ— 𝑦 πœ• cos πœ„ + πœ•Γ— βƒ— 𝑦 sin πœ„ + πœ• β‹… βƒ— 𝑦 πœ•

  • Can get axis & angle only after normalization
  • Un-normalized can cause artifact when interpolated

11

𝑠 = 1

π‘Ÿ( π‘Ÿ"

)!*)" "

slide-12
SLIDE 12

Modeling curves

12

slide-13
SLIDE 13

Parametric curves

  • X & Y coordinates defined by parameter t (β‰… time)
  • Example: Cycloid

𝑦 𝑒 = 𝑒 βˆ’ sin 𝑒 𝑧 𝑒 = 1 βˆ’ cos 𝑒

  • Tangent (aka. derivative, gradient) vector: 𝑦< 𝑒 , 𝑧< 𝑒
  • Polynomial curve: 𝑦 𝑒 = βˆ‘= 𝑏=𝑒=

13

slide-14
SLIDE 14

Cubic Hermite curves

  • Cubic polynomial curve interpolating

derivative constraints at both ends (Hermite interpolation)

  • 4 constraints Γ¨ 4 DoF needed

Γ¨ 4 coefficients Γ¨ cubic

  • 𝑦 𝑒 = 𝑏@ + 𝑏3𝑒 + 𝑏%𝑒% + 𝑏A𝑒A
  • 𝑦′ 𝑒 = 𝑏3 + 2𝑏%𝑒 + 3𝑏A𝑒%
  • Coeffs determined by substituting

constrained values & derivatives

14

𝑦 0 = 𝑦@ 𝑦 1 = 𝑦3 𝑦′(0) = 𝑦@

B

𝑦B 1 = 𝑦3

B

𝑦 0 = 𝑏@ = 𝑦@ 𝑦 1 = 𝑏@ + 𝑏3 + 𝑏% + 𝑏A = 𝑦3 𝑦B 0 = 𝑏3 = 𝑦@

B

𝑦B 1 = 𝑏3 + 2 𝑏% + 3 𝑏A = 𝑦3

B

Γ¨ 𝑏@ = 𝑦@ 𝑏3 = 𝑦@

B

𝑏% = βˆ’3 𝑦@ + 3 𝑦3 βˆ’ 2 𝑦@

B βˆ’ 𝑦3 B

𝑏A = 2 𝑦@ βˆ’ 2 𝑦3 + 𝑦@

B + 𝑦3 B t x 1

slide-15
SLIDE 15

Bezier curves

  • Input: 3 control points (CPs) 𝑄>, 𝑄

$, 𝑄,

  • Coordinates of points in

arbitrary domain (2D, 3D, ...)

  • Output: Curve 𝑄 𝑒 satisfying

𝑄 0 = 𝑄> 𝑄 1 = 𝑄, while being β€œpulled” by 𝑄

$

15

𝑄 𝑒 = 1 βˆ’ 𝑒 𝑄@ + 𝑒 𝑄% 𝑄 𝑒 = ? 𝑄

3

𝑄% 𝑄@

t=0 t=1

  • Eq. of line segment
  • Eq. of Bezier curve
slide-16
SLIDE 16

Bezier curves

  • 𝑄@3 𝑒 = 1 βˆ’ 𝑒 𝑄@ + 𝑒 𝑄

3

  • 𝑄

3% 𝑒 = 1 βˆ’ 𝑒 𝑄 3 + 𝑒 𝑄%

  • 𝑄*) 0 = 𝑄*
  • 𝑄

)' 1 = 𝑄'

  • Idea: ”Interpolate the interpolation”

As 𝑒 changes 0 β†’ 1 , smoothly transition from 𝑄@3 to 𝑄

3%

  • 𝑄@3% 𝑒 = 1 βˆ’ 𝑒 𝑄@3 𝑒 + 𝑒 𝑄

3% 𝑒

= 1 βˆ’ 𝑒 1 βˆ’ 𝑒 𝑄@ + 𝑒 𝑄

3 + 𝑒

1 βˆ’ 𝑒 𝑄

3 + 𝑒 𝑄%

= 1 βˆ’ 𝑒 %𝑄@ + 2𝑒 1 βˆ’ 𝑒 𝑄

3 + 𝑒%𝑄%

16

𝑄

3

𝑄% 𝑄@ 𝑄

3% 𝑒 𝑒 𝑒 𝑒 1 βˆ’ 𝑒 1 βˆ’ 𝑒

𝑄@3 𝑒 𝑄@3% 𝑒

1 βˆ’ 𝑒 Quadratic Bezier curve

  • Eq. of line
  • Eq. of line
slide-17
SLIDE 17

Bezier curves

  • 𝑄@3 𝑒 = 1 βˆ’ 𝑒 𝑄@ + 𝑒 𝑄

3

  • 𝑄

3% 𝑒 = 1 βˆ’ 𝑒 𝑄 3 + 𝑒 𝑄%

  • 𝑄*) 0 = 𝑄*
  • 𝑄

)' 1 = 𝑄'

  • Idea: ”Interpolate the interpolation”

As 𝑒 changes 0 β†’ 1 , smoothly transition from 𝑄@3 to 𝑄

3%

  • 𝑄@3% 𝑒 = 1 βˆ’ 𝑒 𝑄@3 𝑒 + 𝑒 𝑄

3% 𝑒

= 1 βˆ’ 𝑒 1 βˆ’ 𝑒 𝑄@ + 𝑒 𝑄

3 + 𝑒

1 βˆ’ 𝑒 𝑄

3 + 𝑒 𝑄%

= 1 βˆ’ 𝑒 %𝑄@ + 2𝑒 1 βˆ’ 𝑒 𝑄

3 + 𝑒%𝑄%

17

𝑄

3

𝑄% 𝑄@

Quadratic Bezier curve

slide-18
SLIDE 18
  • Exact same idea applied to 4 points 𝑄@, 𝑄

3, 𝑄% 𝑄A:

  • As 𝑒 changes 0 β†’ 1, transition from 𝑄*)' to 𝑄

)'+

  • 𝑄@3%A 𝑒 = 1 βˆ’ 𝑒 𝑄@3% 𝑒 + 𝑒 𝑄

3%A 𝑒

= 1 βˆ’ 𝑒

1 βˆ’ 𝑒 '𝑄* + 2𝑒 1 βˆ’ 𝑒 𝑄

) + 𝑒'𝑄' + 𝑒

1 βˆ’ 𝑒 '𝑄

) + 2𝑒 1 βˆ’ 𝑒 𝑄' + 𝑒'𝑄+

= 1 βˆ’ 𝑒 A𝑄@ + 3𝑒 1 βˆ’ 𝑒 %𝑄

3 + 3𝑒% 1 βˆ’ 𝑒 𝑄% + 𝑒A𝑄A

Cubic Bezier curve

18

𝑄

3%A 𝑒

𝑄@3% 𝑒 𝑄@3%A 𝑒

𝑒 1 βˆ’ 𝑒

𝑄

3

𝑄A 𝑄@ 𝑄%

Cubic Bezier curve

  • Quad. Bezier
  • Quad. Bezier
slide-19
SLIDE 19
  • Exact same idea applied to 4 points 𝑄@, 𝑄

3, 𝑄% 𝑄A:

  • As 𝑒 changes 0 β†’ 1, transition from 𝑄*)' to 𝑄

)'+

  • 𝑄@3%A 𝑒 = 1 βˆ’ 𝑒 𝑄@3% 𝑒 + 𝑒 𝑄

3%A 𝑒

= 1 βˆ’ 𝑒

1 βˆ’ 𝑒 '𝑄* + 2𝑒 1 βˆ’ 𝑒 𝑄

) + 𝑒'𝑄' + 𝑒

1 βˆ’ 𝑒 '𝑄

) + 2𝑒 1 βˆ’ 𝑒 𝑄' + 𝑒'𝑄+

= 1 βˆ’ 𝑒 A𝑄@ + 3𝑒 1 βˆ’ 𝑒 %𝑄

3 + 3𝑒% 1 βˆ’ 𝑒 𝑄% + 𝑒A𝑄A

  • Can easily control tangent at endpoints Γ¨ ubiquitously used in CG

Cubic Bezier curve

19

𝑄

3

𝑄A 𝑄@ 𝑄% 𝑄@3%A 𝑒

Cubic Bezier curve

slide-20
SLIDE 20

n-th order Bezier curve

  • Input: n+1 control points 𝑄>, β‹― , 𝑄

E

𝑄 𝑒 = 8

=F> E EC= 𝑒= 1 βˆ’ 𝑒 E#= 𝑄=

20

𝑐1

2(𝑒)

Bernstein basis function

1 βˆ’ 𝑒 ,𝑄* + 4𝑒 1 βˆ’ 𝑒 +𝑄

)

+ 6𝑒' 1 βˆ’ 𝑒 '𝑄' + 4𝑒+ 1 βˆ’ 𝑒 𝑄+ + 𝑒,𝑄

,

1 βˆ’ 𝑒 -𝑄* + 5𝑒 1 βˆ’ 𝑒 ,𝑄

)

+ 10𝑒' 1 βˆ’ 𝑒 +𝑄' + 10𝑒+ 1 βˆ’ 𝑒 '𝑄+ + 5𝑒, 1 βˆ’ 𝑒 𝑄

,

+ 𝑒-𝑄-

Quartic (4th) Quintic (5th)

slide-21
SLIDE 21

Cubic Bezier curves & cubic Hermite curves

  • Cubic Bezier curve & its derivative:
  • 𝑄 𝑒 = 1 βˆ’ 𝑒 A𝑄@ + 3𝑒 1 βˆ’ 𝑒 %𝑄

3 + 3𝑒% 1 βˆ’ 𝑒 𝑄% + 𝑒A𝑄A

  • 𝑄B(𝑒) = βˆ’3 1 βˆ’ 𝑒 %𝑄@ + 3

1 βˆ’ 𝑒 % βˆ’ 2𝑒(1 βˆ’ 𝑒) 𝑄

3 + 3 2𝑒 1 βˆ’ 𝑒 βˆ’ 𝑒% 𝑄% + 3𝑒%𝑄A

  • Derivatives at endpoints:
  • 𝑄B 0 = βˆ’3𝑄@ + 3𝑄

3

Γ¨ 𝑄

3 = 𝑄@ + 3 A 𝑄B 0

  • 𝑄B 1 = βˆ’3𝑄% + 3𝑄A

Γ¨ 𝑄% = 𝑄A βˆ’ 3

A 𝑄B 1

  • Different ways of looking at cubic curves,

essentially the same

21

𝑄

3

𝑄A 𝑄@ 𝑄%

𝑄′(0) 𝑄′(1)

slide-22
SLIDE 22

Evaluating Bezier curves

  • Method 1: Direct evaluation of polynomials
  • Simple & fastJ, could be numerically unstableL
  • Method 2: de Casteljau’s algorithm
  • Directly after the recursive definition of Bezier curves
  • More computation stepsL, numerically stableJ
  • Also useful for splitting Bezier curves

22

t 1-t t 1-t t 1

  • t

t 1-t t 1-t t 1-t

slide-23
SLIDE 23

Drawing Bezier curves

  • In the end, everything is drawn as polyline
  • Main question: How to sample parameter t?
  • Method 1: Uniform sampling
  • Simple
  • Potentially insufficient sampling density
  • Method 2: Adaptive sampling
  • If control points deviate too much from straight line,

split by de Casteljau’s algorithm

23

slide-24
SLIDE 24

Further control: Rational Bezier curve

  • Another view on Bezier curve:

β€œWeighted average” of control points

  • 𝑄*)' 𝑒 = 1 βˆ’ 𝑒 '𝑄* + 2𝑒 1 βˆ’ 𝑒 𝑄

) + 𝑒'

𝑄' = πœ‡* 𝑒 𝑄*+ πœ‡) 𝑒 𝑄

)+ πœ‡' 𝑒 𝑄'

  • Important property: partition of unity

πœ‡* 𝑒 + πœ‡) 𝑒 + πœ‡' 𝑒 = 1 βˆ€π‘’

  • Multiply each πœ‡I 𝑒 by arbitrary coeff π‘₯I:

𝜊I 𝑒 = π‘₯I πœ‡I(𝑒)

  • Normalize to obtain new weights:

πœ‡I

B 𝑒 = J6 K βˆ‘7 J7 K

24

w* = w' = 1

Non-polynomial curve Γ¨ can represent arcs etc.

slide-25
SLIDE 25

Cubic splines

  • Series of connected cubic curves
  • Piecewise polynomial
  • Share value & derivative at every transition
  • f intervals (C1 continuity)
  • Parameter range can be other than [0, 1]
  • Assumption: 𝑒M < 𝑒MN3
  • Given values as only input,

we want to automatically set derivatives

25

t x t0 t1 t2 t3 t4 t5 x0(t) x1(t) x2(t) x3(t) x4(t) Curve tool in PowerPoint

slide-26
SLIDE 26

Cubic Catmull-Rom spline

  • Cubic function 𝑦M(𝑒) for range 𝑒M ≀ 𝑒 ≀ 𝑒MN$ is defined by

adjacent constrained values 𝑦M#$, 𝑦M, 𝑦MN$, 𝑦MN,

26

𝑒.() 𝑒. 𝑒./) 𝑒./' 𝑒 𝑦 𝑦. 𝑦.() 𝑦./) 𝑦./' 𝑦.(𝑒)

slide-27
SLIDE 27

Cubic Catmull-Rom spline: Step 1

  • As 𝑒M β†’ 𝑒MN$, interpolate such that 𝑦M β†’ 𝑦MN$ Γ¨ Line

π‘šM(𝑒) = 1 βˆ’ 𝑒 βˆ’ 𝑒M 𝑒MN$ βˆ’ 𝑒M 𝑦M + 𝑒 βˆ’ 𝑒M 𝑒MN$ βˆ’ 𝑒M 𝑦MN$

27

𝑒.() 𝑒. 𝑒./) 𝑒./' 𝑒 𝑦 π‘š.()(𝑒) π‘š.(𝑒) π‘š./)(𝑒)

slide-28
SLIDE 28

Cubic Catmull-Rom spline: Step 2

  • As 𝑒M#$ β†’ 𝑒MN$, interpolate such that π‘šM#$ β†’ π‘šM Γ¨ Quadratic curve

π‘ŸM(𝑒) = 1 βˆ’ 𝑒 βˆ’ 𝑒M#$ 𝑒MN$ βˆ’ 𝑒M#$ π‘šM#$(𝑒) + 𝑒 βˆ’ 𝑒M#$ 𝑒MN$ βˆ’ 𝑒M#$ π‘šM(𝑒)

  • Passes through 3 points 𝑒M23, 𝑦M23 , 𝑒M, 𝑦M , 𝑒MN3, 𝑦MN3

28

𝑒.() 𝑒. 𝑒./) 𝑒./' 𝑒 𝑦 π‘Ÿ.(𝑒) π‘Ÿ./)(𝑒)

slide-29
SLIDE 29

Cubic Catmull-Rom spline: Step 3

  • As 𝑒M β†’ 𝑒MN$, interpolate such that π‘ŸM β†’ π‘ŸMN$ Γ¨ Cubic curve

𝑦M 𝑒 = 1 βˆ’ 𝑒 βˆ’ 𝑒M 𝑒MN$ βˆ’ 𝑒M π‘ŸM 𝑒 + 𝑒 βˆ’ 𝑒M 𝑒MN$ βˆ’ 𝑒M π‘ŸMN$(𝑒)

29

𝑒.() 𝑒. 𝑒./) 𝑒./' 𝑒 𝑦 𝑦.(𝑒)

Summary:

  • Derivative at each CP is defined by a quadratic

curve passing through its adjacent CPs

  • Each interval is a cubic curve satisfying derivative

constraints at both ends

slide-30
SLIDE 30

Evaluating cubic Catmull-Rom spline

30

A recursive evaluation algorithm for a class of Catmull-Rom splines [Barry,Colgman,SIGGRAPH88]

𝑄 𝑒@ = 𝑄@ 𝑄 𝑒3 = 𝑄

3

𝑄 𝑒% = 𝑄% 𝑄 𝑒A = 𝑄A 𝑄 𝑒 𝑒3 ≀ 𝑒 ≀ 𝑒%

slide-31
SLIDE 31

Ways of setting parameter values 𝑒! (aka. knot sequence)

  • Assume: 𝑒@ = 0
  • Uniform

𝑒M = 𝑒M23 + 1

  • Chordal

𝑒M = 𝑒M23 + 𝑄M23 βˆ’ 𝑄M

  • Centripetal

𝑒M = 𝑒M23 + 𝑄M23 βˆ’ 𝑄M

31

Parameterization of Catmull-Rom Curves [Yuksel,Schaefer,Keyser,CAD11]

slide-32
SLIDE 32

Application of cubic Catmull-Rom spline: Hair modeling

32

Parameterization of Catmull-Rom Curves [Yuksel,Schaefer,Keyser,CAD11]

slide-33
SLIDE 33

Recent exciting development: πœ†-Curves

  • Collaboration between

university & company (Adobe)

  • Features:
  • C2 continuous (smoother)
  • Curvature maxima always on control points

33

πœ†-Curves: Interpolation at Local Maximum Curvature [Yan, Schiller, Wilensky, Carr, Schaefer, SIGGRAPH 2017] Control points Catmull-Rom πœ†-Curves

https://www.youtube.com/watch?v=MLg8xQgEIfk

slide-34
SLIDE 34

Key ideas of πœ†-Curves

  • Cubic Bezier is difficult to control
  • Actually, quadratic Bezier is easier to use!
  • At most one curvature maximum can exist
  • User specifies curvature maxima

Γ¨ reverse compute control points of quadratic Bezier

34

Curvature maxima

i-th quad Bezier (i+1)-th quad Bezier

Possible configurations with cubic Bezier

slide-35
SLIDE 35

35

Global/nonlinear formulation = iterative computation Change of one CP = change of entire shape ”Buckling” always occurs on CPs Curvature discontinuity at convex/concave boundary

slide-36
SLIDE 36

B-spline

  • Another way of defining polynomial spline
  • Represent curve as sum of basis functions
  • Cubic basis is the most commonly used
  • Deeply related to subdivision surfaces

Γ¨ Next lecture

  • Non-Uniform Rational B-Spline
  • Non-Uniform = varying spacing of knots (𝑒$)
  • Rational = arbitrary weights for CPs
  • (Complex stuff, not covered)
  • Cool Flash demo:

http://geometrie.foretnik.net/files/NURBS-en.swf

36

slide-37
SLIDE 37

Parametric surfaces

  • One parameter Γ¨ Curve 𝑄(𝑒)
  • Two parameters Γ¨ Surface 𝑄 𝑑, 𝑒
  • Cubic Bezier surface:
  • Input: 4Γ—4=16 control points 𝑄IP

𝑄 𝑑, 𝑒 = J

IQ@ A

J

PQ@ A

𝑐I

A 𝑑 𝑐 P A 𝑒 𝑄IP

37

Bernstein basis functions 𝑐+

$ 𝑒 = 1 βˆ’ 𝑒 $

𝑐(

$ 𝑒 = 3𝑒 1 βˆ’ 𝑒 "

𝑐"

$ 𝑒 = 3𝑒"(1 βˆ’ 𝑒)

𝑐$

$ 𝑒 = 𝑒$

slide-38
SLIDE 38

Coons patch

  • Given four curves joining at endpoints,

evaluate pairs of opposing curves, then interpolate them Γ¨ a surface patch

38

https://en.wikipedia.org/wiki/Coons_patch Patch function: where is the bilinear interpolation of four corners c0 c1 d0 d1 s t

slide-39
SLIDE 39

3D modeling using parametric surface patches

  • Pros
  • Can compactly represent smooth surfaces
  • Can accurately represent spheres, cones, etc
  • Cons
  • Hard to design nice layout of patches
  • Hard to maintain continuity across patches
  • Often used for designing man-made objects

consisting of simple parts

39

slide-40
SLIDE 40

Pointers

  • http://en.wikipedia.org/wiki/Bezier_curve
  • http://antigrain.com/research/adaptive_bezier/
  • https://groups.google.com/forum/#!topic/comp.graphics.algorithms/2FypAv

29dG4

  • http://en.wikipedia.org/wiki/Cubic_Hermite_spline
  • http://en.wikipedia.org/wiki/Centripetal_Catmull%E2%80%93Rom_spline

40