[comp.graphics] Perfect Sphere

wanger@hpfcdq.HP.COM (Leonard Wanger) (04/19/88)

	A short time ago on in this notesgroup someone had a way to
create a perfect sphere out of rational b-splines. Can someone
repost how it is done?

	Len Wanger -- HP GTD

spencer@spline.eecs.umich.edu (Spencer W. Thomas) (04/22/88)

Here is one answer (and, hey, it was over a month ago...):

Date: Fri, 18 Mar 88 10:24:10 MST
From: jcobb%gr@cs.utah.edu (Jim Cobb)
Subject: Re: Defining a sphere with Bezier patches

It is impossible to exactly parametrize a sphere with polynomial
patches.  I will describe here a simple rational quadratic Bezier patch
that is exact.  This patch covers an octant of the sphere.

Let sq = sqrt(2)/2.  Define homogeneous control points P_ij as

    P_00 =	[   0   0   -1   1 ]
    P_01 =	[  sq   0  -sq  sq ]
    P_02 =	[   1   0    0   1 ]

    P_10 =	[   0   0  -sq  sq ]
    P_11 =	[ 0.5 0.5 -0.5 0.5 ]
    P_12 =	[  sq  sq    0  sq ]

    P_20 =	[   0   0   -1   1 ]
    P_21 =	[   0  sq  -sq  sq ]
    P_22 =	[   0   1    0   1 ]

A note about the interpretation of these coefficients: There are two
conflicting conventions for the meaning of control points for a rational
Bezier curve or surface.  I am using the convention that denotes the
components of the points as [ X Y Z W ], with resulting surface
evaluation given by

    	    	 sum [X_ij Y_ij Z_ij] theta_i(u) theta_j(v)
    S( u, v ) =  ------------------------------------------
    	    	      sum W_ij theta_i(u) theta_j(v)


There is a slight problem with this parametrization: the patch is
degenerate along one of its edges (an entire edge curve collapses into a
single point).  There are alternative schemes to avoid this difficulty,
and there are ways of dealing with the degeneracy (see Faux & Pratt p.
235 ff.).

Jim

=Spencer (spencer@crim.eecs.umich.edu)