We start with a parametrically defined curve which is a trefoil knot. We plot a surface at a constant distance t from the curve. We conceive of this surface as the union of the circles with centers on the curve and with radius t. The plane of the circle is perpendicular to the curve’s tangent. The circle is defined by parameter u which also selects the point on the curve. Parameter v selects a point on the circle defined by these two orthonormal vectors: the curve’s normal, rd, and binormal, bn. The program value stk (a vector) sweeps out the circle from the point on the curve. stk is expressed as a linear combination of the normal and binormal.

In the second version we allow the distance from the curve to be a function g of u and time. Now the surface is swept out by a circle a varying radius moving in perpendicularly to its plane. It is also rotating about the binormal at a rate proportional to the curve’s curvature. The normal to this surface a linear combination of stk and the unit tangent to the curve. normal = stk*(dr/du) - rd*(dv/du) where v is the velocity.

This page has information on controlling frame rate, but it seems limited to an SGI product.
QDFlushPortBuffer is peculiar to the Mac. The OpenGL abstractions seem to wall off access to QDFlushPortBuffer. “WaitNextEvent” seems significant too.
See “VBL syncing” here. AGLSetInteger defined here and AGL_SWAP_INTERVAL defined here.
good background


These files supplant those in the Apple demo. You will need this information to compile for x86.
the ready to run (on PPC Mac) demo.
the ready to run (in Intel Mac) demo.