Notes for October 21 class -- Parametric surfaces

Parametric cylinder

You can describe many surfaces parametrically, using the two parameters 0 ≤ u ≤ 1 and 0 ≤ v ≤ 1 to define values of x, y and z over the surface.

For example, the open cylindrical section to the right is described by:

y = cos(θ)
x = sin(θ)
z = 2 * v - 1
where:
θ = 2 π u
 

 


 

Parametric sphere

Similarly, the longitude / latitude parameterization of a sphere to the right is described by:
x = cos(φ) * cos(θ)
y = cos(φ) * sin(θ)
z = sin(φ)
where:
θ = 2 π u
φ = π v - π / 2
 

 


 

Parametric torus (donut)

The longitude / latitude parameterization of a torus is described by:                                  
x = (1 + r * cos(φ)) * cos(θ)
y = (1 + r * cos(φ)) * sin(θ)
z = r * sin(φ)
where:
θ = 2 π u
φ = 2 π v
r = the radius of the "inner tube".
 

 


 

Homework, due by start of class on Wednesday October 28

  • Implement the parametrized cylinder, sphere and torus.

  • Use these shapes, together with what you already know how to do with matrices, to create a scene with some interesting objects (eg: people, animals, machines, etc.).

    See if you can make your scene animated, using the time variable, and also responsive to the cursor.

  • Extra credit: Modify the cylinder equations so that the resulting surface also includes the top and bottom faces of the cylinder.

  • Extra credit: Try to figure how to create some other interesting parametric shapes, such as cones, or curved tubes, or something shaped like a bottle.

  • Extra credit: Try to vary or vary shapes and/or animations using this Javascript implementation of the Noise function.

As always, you get extra points for making something that is fun, exciting, beautiful or original.