Understanding Swept Surfaces and Linear Interpolation in Parametric Functions, Slides of Fundamentals of E-Commerce

An introduction to swept surfaces, or surfaces of revolution, and linear interpolation in the context of parametric functions. Swept surfaces are created by rotating a 2d mathematical function around an axis to generate a 3d shape. Linear interpolation is a method for finding the point midway between two other points. Examples of 2d rotation matrices, parametric functions, and linear interpolation in animation.

Typology: Slides

2012/2013

Uploaded on 07/30/2013

asif.ali
asif.ali 🇮🇳

5

(3)

129 documents

1 / 12

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Swept Surfaces
Swept Surfaces, or Surfaces of Revolution, are
a standard type of parametric surface.
A swept surface is like a lump of clay on a
potter’s wheel: its a 2D mathematical
function that’s been spun around and around
until it sweeps out a three-dimensional shape.
Remember the rotation matrix for rotation in
two dimensions:
[ cos(θ) sin(θ) ]
[
-
sin(θ) cos(θ) ]
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Understanding Swept Surfaces and Linear Interpolation in Parametric Functions and more Slides Fundamentals of E-Commerce in PDF only on Docsity!

Swept Surfaces

-^ Swept Surfaces

, or^ Surfaces of Revolution

, are

a standard type of parametric surface. • A swept surface is like a lump of clay on apotter’s wheel: it’s a 2D mathematicalfunction that’s been spun around and arounduntil it sweeps out a three-dimensional shape. • Remember the rotation matrix for rotation intwo dimensions:^ [ cos(

θ)^

sin( θ) ]

[^ - sin(

θ)^ cos(

θ) ]

Swept Surfaces

-^ The 2D rotation matrix:^ [ cos(

θ)^ sin(

θ)^

]

[ -sin(

θ)^ cos(

θ) ]

-^ If^ θ=0, the matrix is identity:^ [x^

y]^ *

[ 1

0 ]=

[x

y]

[ 0^

1 ]

-^ If^ θ=90°, the matrix rotates ninety degrees:^ [x^

y]^ *

[ 0

]=^

[-y^

x]

[ -1 0

]

Swept Surfaces

-^ And then we tilt our heads into 3D:X=u

(^2) Y=u

Swept Surfaces

-^ And then we slowly start to spin it around theY axis, by multiplying the X and Z coordinatesby the rotationmatrix:X=R

(^2) (u)x Y=u^2 Z= R(u)z where R isrotation by v°

Linear Interpolation

-^ A common question in graphics is, “How do Islowly and gradually slide from one point toanother?” In other words, how do you findthe spot midway between two other spots? •^ The simplest approach is a method called^ linear interpolation

P1 = (x1,y1)P2 = (x2,y2)Let t go from 0.0 to 1.0; then P(t)=(

- t)P1 +*

tP*

Linear Interpolation

-^ Linear interpolation in action:

P(t)=(1-t)P1 + tP2** – t = 0: •^ P(0)^ = (1-0)P1 + 0P

= P

-^ t = 0.5:^ •^ P(0.5)

= (1-0.5)P1 + 0.5P2 = (P1+P1)/

-^ t = 1:^ •^ P(1)

= (1-1)P1 + 1P

= P

Linear Interpolation in Animation • If you want t to vary from zero to one andback again more smoothly than a sawtooth’edfunction, you can use sin() or cos():^ •^ float t =

0;

-^ float time =

0;

-^ void onIdle(void) -^ { •^ time = time +

π/100.0;

-^ t^ = (sin(time) + 1)/2; t • }

time

Linear Interpolation withParametric Functions

-^ The great thing about a parametric function intwo dimensions is that it defines a nice grid.And that grid is the same grid no matter whatthe 3D output is. •^ That means that you can have two completelydifferent parametric functions, both in thesame two-dimensional range of u, v; and youknow that for any (u,v) in one function there’sa matching (u,v) in the other. •^ If that’s the case… then you can linearly^ interpolate

between the two parametric