Parametric Shapes & Lighting

1 / 15

# Parametric Shapes & Lighting - PowerPoint PPT Presentation

Parametric Shapes & Lighting Jared Jackson Stanford - CS 348b June 6, 2003 - or - How I Went to Stanford Graduate School to Learn Basket Weaving Shapes from Parametric Paths A parametric path in multiple dimensions requires only one variable

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## Parametric Shapes & Lighting

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

### Parametric Shapes & Lighting

Jared Jackson

Stanford - CS 348b

June 6, 2003

### - or -How I Went toStanford Graduate Schoolto Learn Basket Weaving

Shapes from Parametric Paths
• A parametric path in multiple dimensions requires only one variable
• Circle: u -> 0 to 1x(u) = sin(2 pi u), y(u) = cos(2 pi u), z(u) = 0
Shapes from Parametric Paths
• Mapping a 2D path along the 3D path gives a 3D parametric shape
• For a torus, trace a circle along a parametric path
• This requires that we know the normal to the path
shapes/parametric.cc
• Create a shape using S-Expressions for
• x, y, z
• dx, dy, dz
• Ex: sin (2 pi u) -> (sin (mult 2 (mult pi x)))
• Other parameters include:
• Radius of the 2D shape
• Twist angle of the 2D shape
• Min and max of u
• Number of samples to take along u
Parametric Torus

Surface “parametric”

“x” “mult 2 (cos (mult 2 (mult x pi)))”

“y” “mult 2 (sin (mult 2 (mult x pi)))”

“z” “0”

“dx” “mult -1 (sin (mult 2 (mult x pi)))”

“dy” “cos (mult 2 (mult x pi))”

“dz” “0”

“samples” 20

“min” 0

“max” 1

Other Parameters: Shapes
• There are several built-in 2D shapes:
• Circle (tube)
• Square (box, disc)
• Star
• And more
Other Parameters: Complex Shapes
• Shapes can also be described as a 2D parametric path using S-Expressions

“shape” “complex”

“cx” “sub 1 (pow x 3)”

“cy” “x”

“csamples” 20

• The radius is a scaling factor on the 2D shape that can also be specified as an S-Expression

Other Parameters: Twist
• The twist parameter rotates the 2D shape within its plane before mapping it along the path

“twist” “cos (mult 2 (mult x pi))”