Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!sri-spam!ames!ucbcad!ucbvax!ucsfcgl!pixar!ph From: ph@pixar.UUCP Newsgroups: comp.graphics,sci.math Subject: Re: Can You Transform Quadric Surfaces With 4x4 Matrices? Message-ID: <511@pixar.UUCP> Date: Fri, 30-Jan-87 17:38:09 EST Article-I.D.: pixar.511 Posted: Fri Jan 30 17:38:09 1987 Date-Received: Sat, 31-Jan-87 09:19:25 EST References: <255@onion.cs.reading.ac.uk> Organization: Pixar -- Marin County, California Lines: 45 Summary: yes Xref: watmath comp.graphics:221 sci.math:412 Represent the point (x,y,z) by the homogeneous row vector P = [x, y, z, 1] and plane (or normal vector) ax+by+cz+d=0 by column vector N = [a, b, c, d]^t, where M^t means transpose of matrix M. The equation P*N=0 (where '*' denotes matrix multiplication) determines all the planes N passing through point P, or all the points P which lie on plane N. Note the duality of points and planes. Represent the quadric surface axx+bxy+cxz+dx+eyy+fyz+gy+hzz+iz+j=0 by the matrix [ a b/2 c/2 d/2 ] Q = [ b/2 e f/2 g/2 ] [ c/2 f/2 h i/2 ] [ d/2 g/2 i/2 j ] Points on the quadric surface satisfy P*Q*P^t=0 (substitute P and Q above to check) and planes tangent to the surface satisfy N^t*Q^-1*N=0, where M^-1 means matrix inverse or adjoint. Note the duality once again. If T is a 4x4 transformation matrix (perspective, rotation, scaling, translation, etc) then to transform point P by T: P' = P*T and to transform plane N by T: N' = T*N, where M*N is matrix multiplication. To transform a quadric: Q' = T^-1*Q*T^-1^t. You can substitute the expressions above into P'*Q'*P'^t=0 to check that it works. A non-intuitive consequence of this is that any perspective transformation of a quadric is a quadric! A perspective transformation of a sphere, for example, can be a hyperboloid of two sheets. The normal vector or tangent plane can be found by taking the gradient of the quadratic form: N = grad(P*Q*P^t)/2 = Q*P^t for a point P on the surface. If P is not on the surface, this plane N is still geometrically meaningful; it is called the "polar plane" of P, and dually, the "pole" of the plane N is P = N^t*Q^-1. References: E. A. Maxwell, General Homogeneous Coordinates in Space of Three Dimensions, Cambridge U. Press, London, 1951. Paul Heckbert, The Mathematics of Quadric Surface Rendering and SOID, New York Inst. of Tech. Computer Graphics Lab TM4, July 1984. Jim Blinn, The Algebraic Properties of Homogeneous Second Order Surfaces, The Mathematics of Computer Graphics seminar notes, ACM SIGGRAPH '84, July 1984. Paul Heckbert Pixar 415-499-3600 P.O. Box 13719 UUCP: {sun,ucbvax}!pixar!ph San Rafael, CA 94913 ARPA: ph%pixar.uucp@ucbvax.berkeley.edu