Ray Tracing Algebraic Surfaces

Ray Tracing Algebraic Surfaces

Computer Graphics Volume 17, Number 3 July 1983 Ray Tracing Algebraic Surfaces Pat Hanrahan Computer Graphics Laboratory New York Institute of Technology Old Westbury, New York Abstract i. Introduction Many interesting surfaces can be Underlying the most spectacular com- written as polynomial functions of the puter generated images is a precise spatial coordinates, often of low degree. geometric model of the scene. A very pro- We present a method based on a ray casting fitable line of recent research has been algorithm, extended to work in more than the development of display algorithms for three dimensions, to produce pictures of a larger range of mathematical models. these surfaces. The method uses a symbolic New display algorithms have been imple- algebra system to automatically derive the mented that are capable of displaying equation of intersection between the ray curved surfaces, some for parametric sur- and the surface and then solves this equa- face patches, most notably the bicubic tion using an exact polynomial root find- patch [Catmull, 1975; Blinn, Carpenter, ing algorithm. Lane and Whitted, 1980] and implicitly defined surfaces, for example quadrics Included are illustrations of the [Duff, 1980; Blinn, 1980], superquadrics cusp catastrophe surface, and two unusu- [Barr, 1981] and exponential density dis- ally shaped quartic surfaces, Kummer's tributions [Blinn, 1982]. The differences quadruple and Steiner's surface. in these algorithms are primarily geometric; that is, for each type of sur- General Terms: Alqorithms. face equation different methods may be needed to transform the object into the Ke~words: Algebraic Surfaces, Curved Sur- viewing coordinate system, and to deter- face Display, Ray Tracing, Symbolic Alge- mine the relative priority between parts bra, Polynomial Roots. of an object or objects so that only the visible surface element will be drawn. CR Categories: 1.3.3 [Computer Graphics]: Once a visible surface patch has been Picture/Image Generation--display algo- found it is rendered into a frame buffer. rithms; 1.3.5 [Computer Graphics]: Compu- This can be done quite realistically using tational Geometry and Object Modelling-- the normal of the surface element and a curve, surface, solid and object represen- local lighting model [Blinn, 1977; Cook tations, geometric algorithms, languages and Torrance, 1981]. and systems; 1.3.5 [Computer Graphics]: Three-Dimensional Graphics and Realism-- Ray tracing [Goldstein and Nagle, visible line/surface algorithms 1971] is a very powerful general approach to rendering surfaces since it reduces the geometric calculations to that of solving for the intersection of a line with the surface. This has been done for the case of planar and quadric surfaces [Goldstein and Nagle, 1971; Potmesil and Chakravarty, 1981; Whitted, 1980] and more recently bicubic surface patches [Whitted, 1980; Potmesil and Chakravarty, 1981; Kajiya, 1982]. Generally there is no need to transform the surface since the view is encoded in the geometry of the light rays. Permission to copy without fee all or part of this material is granted This also has the advantage that rays can provided that the copies are not made or distributed for direct be recursively split [Whirred, 1980], to commercial advantage, the ACM copyright notice and the title of the form new rays representing specular publication and its date appear, and notice is given that copying is by reflections and transmissions, without permission of the Association for Computing Machinery. To copy changing the nature of the calculations. otherwise, or to republish, requires a fee and/or specific permission. © ACM 0-89791-109-1/83/007/0083 $00.75 83 Figure i. The Steiner Surface. Figure 2. Kummer's surface. In this paper we show how to use a ray casting approach to generate pictures of any polynomial function of position. Such surfaces are called algebraic surfaces. Common examples of algebraic surfaces are planes and the quadric sur- faces. The main goal of this work is to enlarge the domain of curved surface algo- rithms while also generating pictures of many mathematically interesting surfaces that have never been properly drawn. Fig- ure 1 shows the Roman or Steiner surface and Figure 2 shows a quadruple; one of the class of surfaces first investigated by Kummer [Hudson, 1905]. Other examples of polynomial surfaces are the catastrophe surfaces; an example is the "cusp" shown in figure 3. The catastrophe surfaces are particularly interesting since they represent a fundamental classification of the types of surfaces that can be formed from polynomials. They are also interest- ing in that they exist in an n-dimensional space and their display requires that the ray trace be capable of proceeding through more than three dimensions. Figure 3. The Cusp Catastrophe. 84 2. Ray tracing implicit surfaces The real zeros, t , t , ..., t , of this 0 1 k Although we are concerned primarily equation are simultaneous solutions to with algebraic surfaces embedded in n- both the ray and surface equations and dimensional space, in this section we will therefore intersections. If there are no outline the steps needed to display any real solutions then the ray does not analytic surface by means of a ray trace. intersect the surface; if there exists a solution t<0 then that intersection is Each point in this space is behind the anchor point of the ray and represented by a vector, the n-tuple therefore physically does not impede the path of the ray. The first physical intersection is the closest point to the (x, y ..... z) (i) anchor and corresponds to the lowest posi- tive real solution to the above equation. Given the solution we can determine the and the surface by the n-I dimensional coordinates of the point of the intersec- subset satisfying the equation: tion by the original ray-equation (4). These in turn can then be substituted into equation (3) to find the surface normal. F(x,y ..... z) = 0 (2) Depending on the illumination model, we can either split the incominq ray into additional rays and recursively trace them The normal to the surface is in the direc- or immediately compute an intensity value tion of the gradient of F evaluated at a using a local shadinq function. point on the surface, To generate a complete frame buffer image a ray is cast at each picture ele- = (~F, ~F ..... ~F) I (3) ment, sampling the surface. To do this we must determine the location of the image plane in space and the type of projection desired. The image plane can be The _ major geometric calculation parameterized by: underlying all ray tracing algorithms is the intersection of a line, which represents a particular light beam, with a Y = [ R+uU+vV : (u,v) e[-l,l] ] (6) surface. The line equation can be written in the following parametric form: where the vector x = x t+x R = (x ,y ..... z ) 1 0 r r r y = y t+y 1 0 (4) is a point on the plane, and the two vec- tors, z = z t+z 1 0 U = (x ,y ..... z ) u u u If the parameter t spans the real numbers and then the line extends infinitely in both directions; if instead we restrict t to v = (x ,y ..... z ), take on only positive values then we are v v v left with a ray anchored at the point, (x , y ..... z ), and pointing in the are two orthogonal vectors contained in 0 0 0 that plane. The parameters u and v are direction (x , y .... , z ), For each ray normalized frame buffer coordinates. The 1 1 1 surface is projected onto this plane by of light we must find which surface it passing a ray through that image point out intersects, if any, and for all the into the object space. There are two com- possible intersections (there may be more mon methods of doing this (i) by forcing than one) the closest intersection along all rays to pass through a common vantage the path of the ray. The intersections ~oint, or (ii) forcing all rays to travel can be found by substituting for the in the same direction. The first method x,y,...,z coordinates of the surface equa- is called a perspective projection; the tion the corresponding ray equations, (4), second method a parallel projection. to yield the new equation in the single variable t, The method outlined above works for arbitrary functions provided we can (i) convert the function F to F*, and (ii) F*(t) = 0 (5) solve for the first positive real zero of 85 F*. The remainder of this paper will ~.!. Symbolic Methods describe a system that performs both these operations for surfaces defined as polyno- The surface compiler is a lisp pro- mial functions of the space coordinates. gram which accepts as input the equation of the surface, substitutes the ray equa- tions into this equation to form expres- ~. Ray tracing algebraic surfaces sions for the coefficients of the polyno- mial P* and outputs them as a series of An algebraic surface are those sur- statements in the programming language C. faces that can be written as a finite The symbolic algebra needed to manipulate number of terms involving coordinates polynomials in these ways is well under- raised to a positive integral power. With stood, therefore we will only outline the this definition a surface defined using methods used. logarithms, exponentials or transcendental functions is not considered an algebraic When the equation is read it is con- surface. The general form is there- verted to the equivalent lisp expression fore:Ill (i.e., from infix to prefix). All the arithmetic operators from the original surface equation are replaced by operators 1 m n which perform polynomial arithmetic and i j k Pcx y ....

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    8 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us