[comp.graphics] Generating Polygonal representations of Quadratic Surfaces

shaun@softway.sw.oz.au (Shaun Arrundel) (10/12/90)

I want to convert a number of Quadric surfaces to a collection of
polygons (the basic RenderMan quadratic primitives).

Spheres, Hyperboloids, Cones, Paraboloids, Torus, etc.

I was thinking I could use the parametric form of the
surfaces and then just do a loop through u and v to generate to
generate the verticies of the polygons.

For example, a torus defined in terms of
                
minor_radius - radius from origin to outside of torous
major_radius - radius from inside of torous to outside of torous
phi_min, phi_max - sweep angles around the torus circumfrence
thet_max - sweep angle around the origin

Now we can generate phi, theta and r in terms of the parametric
variables u,v

        theta = u*thetamax
        phi = phimin + v * (phimax - phimin)
        r = minor_radius * cos(phi)

From phi,theta and r we can generate x,y and z

        z = minor_radius * sin(phi)
        x = (major_axis + r) * cos(theta)
        y = (major_axis + r) * sin(theta)

 where Z is positive vertical axis, X positive to right and parallel to
the page and Y is positive and penpendicular to the page.
        
It should be possible to generate the polygonal vertices via

        for(u = 0; u <= 1; u += u_step)
           for(v = 0; v <= 1; v += v_step)
            {
                Caculate theta,phi,r
                Calculate x,y,z
            }

Now I am sure this should work, but I am also sure the it
will have a number of problems or I would have seen more
use of this sort of technique in the literature.

Now my questions

        1. Can I generate four sided polygons from the above
           vertices.
        2. How efficient is the above for generating Quadratics
        3. Can I convert the above quadratic forms to bezier surface
           formulations

				shaun@softway.oz.au