What do you mean: "how should I evaluate"? Are you trying to tell usQuote:> What is the best way to compute the normal to a parametric surface. The
> normal to the parametric surface Q(s,t) is the cross product of the s
> tangent vector with the t tangent vector. The s tangent vector is partial
> d/ds(Q(s,t)) and the t tangent vector is partial d/dt(Q(s,t)). How should I
> evaluate the cross product?
probably one doesnt want to use analytical partial derivatives,
because the surface description might be rather complex.
A quadriliteral in the object space (world coordinates) is given
by 4 points Pi(xi,yi,zi), i=1...4 , calculated by the mapping of
the parameter plane si,ti to xi,yi,zi.
Once you decide to use P1 as the reference point, you will find
two edge vectors E21=P2-P1 and E41=P4-P1.
Then calculate the cross product N = E21 x E41 , which is usually
done by a formalistical determinant operation:
i j k
N = E21x E21y E21z
E41x E41y E41z
The normal vector should point outside.
N = -(E21x*E41z-E21z*E41x)
Then normalize N by dividing each component by the Euclidian norm of N.
Special attention is necessary for sphere coordinates near to the poles.
Best regards --Gernot Hoffmann
To obtain the normal to a parametric surface (at a particular point
s,t) you can sample 3 points on the surface:
Point A = P(s,t)
Point B = P(s+x,t)
Point C = P(s,t+y)
(x and y are small offsets (0.0 < x,y < 1)).
Then use these three points to compute two vectors:
As you noted, the cross product of these two vectors is (a good
approximation of) the normal to the surface at point (s,t).
The smaller the x and y chosen, the more accurate the normal is, but
you may choose x and y proportional to the tesselation rate if you are
using polygons to render the surface.
On Mon, 16 Dec 2002 14:54:25 +1100, "Jason Heyes"
What is the best way to compute the normal to a parametric surface. The
normal to the parametric surface Q(s,t) is the cross product of the s
tangent vector with the t tangent vector. The s tangent vector is partial
d/ds(Q(s,t)) and the t tangent vector is partial d/dt(Q(s,t)). How should I
evaluate the cross product?