[comp.graphics] I need help with superquadrics

wayne@cpsc.ucalgary.ca (Wayne Mccormick) (03/22/90)

Hi,

	A few months ago I read some articles on superquadrics here on
the net.  It interested me and I decided to try to implement a modeler
based on superquadric shapes.  Since the inside-outside functions are
so easy to use in determining intersections and so forth I thought it would
be somewhat easy to do.  But I stumbled into a small problem.

	Parametrically, a superellipsoid is defined by

	x = c(u,e1) * c(v,e2)
	y = c(u,e1) * s(v,e2)
	z = s(u,e1)

	where -pi <= u <= pi, -2pi <= v <= 2pi, and c(u,e1) = cos(u)^e1,
s(u,e1) = sin(u)^e1.  O.K., this is the easy part.  By varying u and v
through the ranges we generate a bunch of points on the surface of the
ellipsoid.  But, the only place that the functions are defined for real
numbers is in the positive octant because once the sin or cos function
becomes negative and e1 and/or e2 are not integers, the function moves out
into the complex plane.

	I've come up with a few solutions on my own.  They are o.k. but they
have their problems as well.  First I just tried to reflect the positive octant
around into all the other ones, giving me a nice symetric shape.  However,
the inside-outside function is defined only in the positive octant for the
same reason as the parametric formula (I don't remember the implicit
equation for this, it's in my office).

	Then I tried to calculate everything in the complex plane.  There
are two problems here.  1) speed, 2) how do you map back to image space?

	Then in Franklin and Barr's paper on "Faster calculation of
superquadric shapes", they say that using an explicit equation and reflecting
47 times is much faster.  Sure I can see that, but the patch that is generated
by the explicit equation is small and odd shaped, and what 47 directions does
one have to reflect it?

	Any help would be greatly appreciated.  I'm slightly confused and my
math isn't as strong as it should be.

Wayne McCormick
wayne@cpsc.ucalgary.ca