Assignment 9: OpenGL Part 1
Get the tar file opengl.tar.gz which has sample
source. You might have to download GLUT which is available
here.
- What we want to do is to convert the image from the log to an arbitrary
surface given by parametric equations r(s,t) = < x(s,t), y(s,t), z(s,t) >
using both quads and triangles. We want smooth curves so we will use
the formula for the normal given by the cross product of partials r_s and
r_t. Try to make the code so that changing the function is relatively
easy. Here are some surfaces to try it on:
- z = x^2 + y^2 elliptic paraboloid
- z = x^2 - y^2 hyperbolic paraboloid
- z = sin(2 pi x) sin(2 pi y) 0 < x, y < 1 egg crate
- x = sin(phi) cos(theta), y = sin(phi) sin(theta), z = cos(phi)
sphere
- x = (2+cos(phi))cos(theta)/4, y = (2+cos(phi))sin(theta)/4,
z = sin(phi)/4 torus
- x = t cos s, y = t sin s, z = s helicoid