Home » Archimedes archive » Archimedes World » AW-1991-09.adf » AWSept91 » !AWSep91/Goodies/PD/QRTinfo/UserMan
!AWSep91/Goodies/PD/QRTinfo/UserMan
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Archimedes archive » Archimedes World » AW-1991-09.adf » AWSept91 |
Filename: | !AWSep91/Goodies/PD/QRTinfo/UserMan |
Read OK: | ✔ |
File size: | 57D1 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
QRT Users Manual INTRODUCTION QRT (Quick Ray Tracer) is an easy to use image generation system that uses a ray tracing algorithm for image rendering. Here are some features of QRT: o Multiple primitive types, including user defined quadratic surfaces o Arbitrary levels of diffuse reflection, spectral reflection, transmission, ambient lighting, and gloss o User defined pattern information for objects o Bounding boxes for groups of objects o Shadows o Multiple light sources with different characteristics o Arbitrary Phong spectral reflection coefficients o Colour dithering to increase the apparent number of colours o Easy to use, free format input language with error checking. Parameters are by keyword and may appear in any order. Each of these features of QRT will be discussed is greater detail in this document. THE QRT WORLD QRT constructs an image of the world by performing certain manipulations on an internal representation of a group of objects. You must provide a description of these objects to QRT through the QRT input language. QRT writes a machine independent bitmap file which can be read by a computer specific post processor. The post processor either displays the image or converts it into the proper form for display by system programs. (See the Machine Dependent Information section of this manual for details). QRT is capable of dealing with 5 types of primitive objects: spheres, parallelograms, triangles, rings (annulus), and quadratic surfaces. The latter can be used to model cones, oblong spheroids, and other interesting surfaces. Each of these objects can have an arbitrary orientation in space, and arbitrary surface characteristics. QRT INPUT LANGUAGE The QRT input language is free format, in that commands may be placed anywhere on a line, and newlines may be placed at any point. This makes it easy to use indentation. Comments are also supported by surrounding text with curly braces '{' and '}'. Comments may span lines. The QRT input language is not case sensitive. A full description of the language and a shorter, context free grammar can be found elsewhere in this manual. THE QRT ILLUMINATION MODEL Before meaningful images can be created, the QRT illumination model must be understood. The light that reaches the observer from each object is composed of several components: o Diffuse light - The "color" of the object o Ambient light - The color of the light that falls on the surface of the object if no lamps are shining on this spot. Note that this specifies the color of light, not the color of the object itself. o Reflected light - If the object acts as a mirror, some light is reflected. o Specular highlights - The "bright spots" of a shiny object viewed in a light. o Transmitted light - The object may transmit some of the light that strikes the back of the object (glass surfaces) All of these light characteristics can be specified for any object. If none are specified, the current defaults are assumed. These defaults can be changed (see DEFAULT in Language Reference Guide). Most of these light characteristics deal with a percentage of light. For example, a light may reflect 80% of the red light that strikes it, 20% of the green, and 40% of the blue. This is the "color" of the object (diffuse light), and would be specified in QRT by the following syntax: diff = (.80, .20, .40) In QRT, 1.00 is 100%. The language is also free-format, so the above is equivalent to: diff = (.80, .20, .40 ) The commas between parameters are optional, but make the input easier to read. Semicolons can also be used. Ambient light is specified in a similar manner: amb = (.20, .20, .20) The ambient light values should be fairly small. Most of the light hitting the object comes from lamps, but some parts of the object may be in the shadow of another object. If no ambient light is specified, these shadows will appear totally black, which looks unrealistic. Ambient light will give the affect of a small amount of light hitting areas in a shadow, producing a more realistic looking image. Reflection is specified using the MIRROR attribute: mirror = (.90, .90, .90) If a true mirrored surface is desired, the mirror values should be fairly high. If one of the values has a higher value than the others, the mirror will appear red, green, or blue. Transmission is specified as follows: trans = (.80, .80, .80) density = (.022, .022, .022) index = 1.33 Note the addition of another parameter, the index of refraction. An explanation of the index of refraction for an object is beyond the scope of this document - see a book on elementary optics for details. The density factor is a light attenuation factor per unit distance the light travels through the object. The trans parameter tells QRT how much light to remove from shadows cast by this object. In addition, specular highlights are specified with two parameters: reflect = .50, sreflect = 45 "REFLECT" is the percentage of light reflected in the specular highlight, and sreflect is the Phong spectral reflection coefficient. Again, an explanation of the Phong coefficient is beyond the scope of this document; however, a higher value for the coefficient will result in smaller, tighter highlights for a more metallic looking object. Lower values of sreflect should be accompanied by lower values in reflect, and will produce duller looking surfaces, such as paper. QRT also accepts a dithering amount for each object: dither = 3 Dithering is a mechanism for simulating colors not available on the display by blending other colors. The default dithering coefficient is 3; it should be kept small. Values of 1 to 6 are good. Larger objects should employ more dithering, and mirrored or glass objects should have little or no dithering. QRT also accepts an attribute "FUZZ", but this is not used in the present implementation. In a future implementation of QRT, FUZZ will effect small, random perturbations of the normal vector at a given location on an object. This will simulate rough surfaces, matted glass, or imperfectly reflecting mirrors. All of the above light characteristics may be attached to any object. The default is for a white, non reflecting, non transmitting dull surface with an average amount of dithering. In addition, any of the above colour information (which will be referred to from now on as COLORINFO) may also be attached to a pattern structure (see the PATTERN section of this document). LIGHT SOURCES Light sources in QRT are called "LAMPS". The lamp structure is simple: LAMP ( loc = (12, 34, 56), dist = 50, radius = 10 ) The default is for a bright white lamp, but if you wish to change this, you can specify different values for the lamp's ambient light. The radius value is ignored by this implementation of QRT, but it must be supplied. In a future version, the radius may be used to implement penumbral shadows. I didn't include them in this version, since they take a very long time to compute, and don't add much to the image quality. The "dist" entry in the lamp structure specifies at what distance the light from the lamp is at full intensity. Beyond this value, the light will decrease in intensity. This value should be set so that the nearest object in the scene is slightly more than "dist" distance units from the lamp. This does not have to be exact. If objects are nearer than dist" units, they will be so bright that shading will not take place. Objects very far away will be dimly illuminated. By the way, QRT distance units are not tied to any real world unit. They can stand for feet, nautical miles, or furlongs, at your choice. THE OBSERVER After defining the world, you must tell QRT the position and orientation of the observer. This is done as follows: OBSERVER ( loc = (0, 10, 20), lookat = (5, 5, 120), up = (0, 1, 0) ) The x,y, and z are the location of the observer. The "lookat" variables give a location in space that the observer is looking at. Most ray tracers require you to give two angles for the observers view direction, but it is MUCH easier to know the location of an object or point in space you wish the observer to look at. This will be the center of your scene. The "up" variables define which direction is up. Usually, you will wish to use the values given above. QRT uses a right hand coordinate system: positive y is up, positive z is out of the screen, and positive x is to the right if you are looking in the negative z direction. The "up" parameter is optional, and if omitted, defaults to (0,1,0). QRT will generate an error message if no observer is defined. OUTPUT FILENAME QRT places its output in a file, so you must give it the name of this file: FILE_NAME = outfile.tmp This file must observe any file naming restrictions of the operating system and computer you are using. See the Machine Dependent Information section of this manual for information on file naming restrictions. FOCAL LENGTH This is the focal length of the "lens" used by the observer. Think of it as a 35mm camera lens - higher numbers produce a telephoto effect, and smaller numbers are for wide angle lenses. Note that small numbers may produce some distortion of the image around the edges. FOC_LENGTH = 60 SKY AND GROUND QRT has facilities for generating the sky and ground. To define the sky, you must give it two colors - one for the sky overhead (zenith), and one for the horizon: SKY ( zenith = (.10, .2, .4), horiz = (.10, .2, .65), dither = 6 ) This will produce a blue sky, with a brighter color near the horizon. (The sky need not be blue - it could be red or hot pink, or vary from red to green). QRT will smoothly blend the colors from the zenith to the horizon. Since the sky is so large, you may want to specify a greater amount of dithering to compensate for the displays color resolution limit. The SKY structure will also produce sky colors below the horizon; any ray that does not strike an object will strike the SKY. To fix this, define a ground. There is no dedicated GROUND command, since you can define a very large parallelogram with the same effect. You can make it brown with patches of green using a PATTERN, or checkered green and yellow in the classic ray-tracing ground pattern. A very large sphere can also be used for the ground, which yields better results with mirrored objects. BOUNDING BOXES QRT supports the use of bounding boxes to speed the ray tracing process. For images composed of only a few (1 to 3) objects, bounding boxes will not do much to increase speed. However, for images where there are groups of objects physically close to each other, they can greatly reduce execution times. A bounding box is a conceptual structure that encloses a group of objects. When the ray tracer is finding line/object intersections, if a line does not strike a bounding box, it cannot possibly strike any objects within that bounding box. This saves the ray tracer the trouble of checking intersections with all objects within the box. In the case where the ray DOES enter the box, some additional overhead is incurred; however, this cost is easily justified by reduced times for negative tests. Bounding boxes can occasionally be useful for complex objects, such as quadratic surfaces, when the object is fairly small. Since the time to find the intersection with a quadratic surface is large, but bounding box intersections are fast, the ray tracer can save time for all the negative tests. Bounding boxes can contain other bounding boxes, in a recursive manner. This recursive structure defines an "object tree". There are two keywords that define the beginning and end of a bounding box: BEGIN_BBOX and END_BBOX. Here is an example: { ** QRT Code for a chessman ** } BEGIN_BBOX QUADRATIC ( { ** quadr defn ** } ) QUADRATIC ( { ** quadr defn 2 ** } ) SPHERE ( { ** sphere defn ** } ) BEGIN_BBOX SPHERE ( ) { ** two spheres ** } SPHERE ( ) END_BBOX END_BBOX This structure may be nested to an arbitrary level; if you had a closely spaced group of chessmen, you could enclose all of them with a bounding box. There is no simple algorithm for knowing exactly where to place bounding boxes. You have to use common sense. Typically, bounding boxes do the most good for closely spaced objects, but if the entire group of objects is less than a third of the image area, it will be useful to enclose them all in a bounding box. PATTERNS QRT permits user defined patterns which can be mapped to the surface of any object. A pattern is basically an organized method for changing an object's COLORINFO over the surface of that object. For example, a checkered surface can be created, or a surface given the appearance of brick or tile. The current patterning in QRT is limited, yet powerful enough to describe many common patterns. A pattern is composed of a series of sub-patterns. Each sub-pattern defines a region on the surface of an object which will contain a given COLORINFO. These regions are presently limited to rectangles, but this may be expanded in a future implementation of QRT. A pattern can be defined once, and used for many objects. For example, a brick pattern might be defined: PATTERN ( name = BRICK, { ** other pattern info here ** } ) SPHERE ( { ** sphere definition ** } pattern = BRICK ) PARALLELOGRAM ( { ** parallelogram definition ** } pattern = BRICK ) This example ignores what is actually in the pattern definition to demonstrate how patterns are attached to objects. A pattern must be defined before it can be used. It is given a name, such as BRICK, and any object can specify this pattern with "PATTERN = BRICK". There are no practical restrictions on the length of pattern names (if your computer has 1 megabyte of ram, you cannot have a pattern name longer than 1 million characters). Multiple patterns may be defined at the top of an input file, and used for any object in the file. What exactly makes up a pattern, you ask? A pattern can be viewed as a rectangle that is repeated over the surface of an object. If the pattern size is 10 x 10, and you have an object (say a parallelogram) that is 50 x 50, the pattern will repeat 5 times in each direction. Within this repeating rectangle, sub patterns can be defined. A sub-pattern is a rectangle or circle within the pattern rectangle with a certain COLORINFO. Any number of these sub-patterns can be created within one pattern definition. To create a brick wall, you might define several sub-patterns, each with a slightly different color of red or brown. The sub patterns need not cover the entire pattern rectangle; if they do not, the COLORINFO you defined for the object is used instead of the pattern COLORINFO. If you defined sub-patterns for bricks, the area not covered would be mortar, and the objects COLORINFO would define the color of the mortar. An actual brick pattern is given in appendix C. The proper use of patterns can be very effective in producing realistic looking scenes. However, complicated patterns will slow image creation, so it is recommended that you first display test scenes with no patterns, and then add pattern information when the scene is right. Patterns have one other use, in the REMOVE command. A pattern can be defined and thought of as a cut out from a surface. For example, suppose you wish to make a flat surface in the shape of a grand piano top. Rather than creating the piano top out of many parallelograms and triangles, define a pattern that includes everything in a parallelogram but NOT in the piano top; that is, the pattern maps the area to remove, not the area to keep. Attach this pattern to a planar object with the REMOVE command. In this case, since the area is removed, any associated COLORINFO is ignored. INSTANCES Often, several copies of a complex object must be created. Specifying their component primitives each time would be difficult. There is a solution to both these problems: INSTANCES. An INSTANCE is a method by which several primitives (actually, an arbitrary object tree) can be grouped and given a name. Copies of these objects may be easily created with one command. Here is an example of an instance definition. BEGIN_INSTANCES NAME = object1 BEGIN_BBOX { ** a bunch of primitives here ** } END_BBOX NAME = object2 BEGIN_BBOX { ** a bunch more primitives here ** } NAME = spheres BEGIN_BBOX SPHERE ( ) { ** two sphere definitions ** } SPHERE ( ) END_BBOX END_BBOX END_INSTANCES There can be only one of these instance definitions, and it must appear before any instances are used. However, any arbitrary object tree can appear within the begin/end instance statements. Several instances are now available for use. For example: INSTANCE_OF ( name = object1, loc = (100, 10, 20), ) INSTANCE_OF ( name = spheres, loc = (12.3, 24.5, 999) ) This example shows that any named portion of the object subtree can function as an instance (the "spheres" object is at a lower level than the "object1' object). The "offset" parameters are required. They specify a new position for the instance (offset from the origin). In the instance definition segment, all objects are defined relative to 0,0,0. They can then be moved in the INSTANCE_OF statement with the offset command. In addition, the instance can be given a new size: INSTANCE_OF ( name = object2, loc = (200, 100, 50), scale = (1.5, 2.0, .25) ) The scale factors are optional, and are given the default of 1. The instance will be resized by the indicated amount in each of the directions. Note that there are some restrictions to this: if spheres are given a different scale factor in each direction, they will remain spheres (not change to QUADRATIC types). The new radius will be the old radius scaled by the smallest of the scale factors. DEFAULTS Each object in QRT is given certain default surface light characteristics (see the section on surface characteristics). If these defaults are not suitable, they can be changed with the DEFAULT command: DEFAULT ( diff = (1.00, .1, .1) no_shadow ) This will make all future objects red unless specified otherwise. More than one default command can be used in a file: each one affects all the objects created after it, but before the next default command. Any light characteristics can be changed (MIRROR, DITHER, etc). In addition, the keyword "no_shadow" can be included (as above). Ordinarily, QRT computes shadow information for all objects. This takes a lot of time, especially for scenes composed of many objects and many lamps. The "no_shadow" command causes QRT to bypass the shadow routines. This will result in a much faster image generation time, but the picture will not look as realistic. X and Y screen resolution and aspect ratio can also be changed with this command. If you wish to generate a preliminary image in a smaller resolution, say, 127 x 127, you would use the following default: DEFAULT ( x_res = 127, y_res = 127, aspect = .56 ) The aspect ratio of .56 is correct for the Amiga in 4096 color mode; use 1.0 for high resolution mode. PROBLEMS WITH QRT There are several limitations in this version of QRT: o Patterning does not work well with some quadratic surfaces. This is a problem with the 3d to 2d mapping function used for quadratics. o User defined texturing is not implemented - all objects in QRT appear smooth. I have some ideas on how to add textures to objects, but these have not been tested and are not incorporated into this version of QRT. FUTURE ENHANCEMENTS TO QRT The following are some things I'd like to add to QRT: o Enhanced patterning capability. The ability to use enumerated (bit-mapped) patterns as well as analytic patterns would be useful. o Anti-dithering routines. These routines are very computationally expensive (they can increase image generation times by a factor of 3 to 5), so they were not included in this version. o Penumbral shadows. This is also very computationally expensive for a minimal utility level, so I didn't bother to include this feature. o Fractal generation. Fractals are, again, computationally expensive, but some things, such as mountains, cannot be modeled with a ray tracer any other way. o Wavy surfaces. This is useful for modeling water, rippled mirrors, etc. I know how to do it, I just didn't have time to add it yet. It would be nice if the waves were user definable in amplitude and x and y wavelength. Wavy surfaces are very similar in implementation to textures. o Snowy surfaces. This is an idea from DBW, which adds snow to a surface depending on its slope and altitude. o Interpolated normal surfaces. This is a mechanism to model arbitrary curved surfaces by using a polygonal approximation to the surface, and interpolating the normal vector between surfaces to avoid angular looking surfaces. o Image plane object lists. This is a technique for increasing the speed for positive line/object intersection test. (Bounding boxes increase speed for negative line/object intersection tests). o Heuristics for faster completion of images using area coherence. o An interactive editor. This is another large scale project in itself, and I can't forsee having time to do it for a long time, but it would be useful. The editor would display a preliminary image of the scene, and when the user had placed objects to his satisfaction, it would write a QRT input file and call QRT as a background task. There are certain problems here - for instance, how do you quickly generate the outline of a user defined quadratic that can take many forms (cone, spheroid, etc)? And how can the user easily specify the object tree structure (bounding boxes) with an interactive editor?
00000000 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00000020 51 52 54 20 55 73 65 72 73 20 4d 61 6e 75 61 6c |QRT Users Manual| 00000030 0a 0a 49 4e 54 52 4f 44 55 43 54 49 4f 4e 0a 20 |..INTRODUCTION. | 00000040 20 20 20 20 20 20 20 20 20 20 0a 20 51 52 54 20 | . QRT | 00000050 28 51 75 69 63 6b 20 52 61 79 20 54 72 61 63 65 |(Quick Ray Trace| 00000060 72 29 20 69 73 20 61 6e 20 65 61 73 79 20 74 6f |r) is an easy to| 00000070 20 75 73 65 20 69 6d 61 67 65 20 67 65 6e 65 72 | use image gener| 00000080 61 74 69 6f 6e 20 73 79 73 74 65 6d 20 74 68 61 |ation system tha| 00000090 74 20 75 73 65 73 0a 61 20 72 61 79 20 74 72 61 |t uses.a ray tra| 000000a0 63 69 6e 67 20 61 6c 67 6f 72 69 74 68 6d 20 66 |cing algorithm f| 000000b0 6f 72 20 69 6d 61 67 65 20 72 65 6e 64 65 72 69 |or image renderi| 000000c0 6e 67 2e 0a 0a 48 65 72 65 20 61 72 65 20 73 6f |ng...Here are so| 000000d0 6d 65 20 66 65 61 74 75 72 65 73 20 6f 66 20 51 |me features of Q| 000000e0 52 54 3a 0a 20 0a 20 6f 20 4d 75 6c 74 69 70 6c |RT:. . o Multipl| 000000f0 65 20 70 72 69 6d 69 74 69 76 65 20 74 79 70 65 |e primitive type| 00000100 73 2c 20 69 6e 63 6c 75 64 69 6e 67 20 75 73 65 |s, including use| 00000110 72 20 64 65 66 69 6e 65 64 20 71 75 61 64 72 61 |r defined quadra| 00000120 74 69 63 20 73 75 72 66 61 63 65 73 0a 20 0a 20 |tic surfaces. . | 00000130 6f 20 41 72 62 69 74 72 61 72 79 20 6c 65 76 65 |o Arbitrary leve| 00000140 6c 73 20 6f 66 20 64 69 66 66 75 73 65 20 72 65 |ls of diffuse re| 00000150 66 6c 65 63 74 69 6f 6e 2c 20 73 70 65 63 74 72 |flection, spectr| 00000160 61 6c 20 72 65 66 6c 65 63 74 69 6f 6e 2c 0a 20 |al reflection,. | 00000170 20 20 74 72 61 6e 73 6d 69 73 73 69 6f 6e 2c 20 | transmission, | 00000180 61 6d 62 69 65 6e 74 20 6c 69 67 68 74 69 6e 67 |ambient lighting| 00000190 2c 20 61 6e 64 20 67 6c 6f 73 73 0a 20 0a 20 6f |, and gloss. . o| 000001a0 20 55 73 65 72 20 64 65 66 69 6e 65 64 20 70 61 | User defined pa| 000001b0 74 74 65 72 6e 20 69 6e 66 6f 72 6d 61 74 69 6f |ttern informatio| 000001c0 6e 20 66 6f 72 20 6f 62 6a 65 63 74 73 0a 20 0a |n for objects. .| 000001d0 20 6f 20 42 6f 75 6e 64 69 6e 67 20 62 6f 78 65 | o Bounding boxe| 000001e0 73 20 66 6f 72 20 67 72 6f 75 70 73 20 6f 66 20 |s for groups of | 000001f0 6f 62 6a 65 63 74 73 0a 20 0a 20 6f 20 53 68 61 |objects. . o Sha| 00000200 64 6f 77 73 0a 20 0a 20 6f 20 4d 75 6c 74 69 70 |dows. . o Multip| 00000210 6c 65 20 6c 69 67 68 74 20 73 6f 75 72 63 65 73 |le light sources| 00000220 20 77 69 74 68 20 64 69 66 66 65 72 65 6e 74 20 | with different | 00000230 63 68 61 72 61 63 74 65 72 69 73 74 69 63 73 0a |characteristics.| 00000240 20 0a 20 6f 20 41 72 62 69 74 72 61 72 79 20 50 | . o Arbitrary P| 00000250 68 6f 6e 67 20 73 70 65 63 74 72 61 6c 20 72 65 |hong spectral re| 00000260 66 6c 65 63 74 69 6f 6e 20 63 6f 65 66 66 69 63 |flection coeffic| 00000270 69 65 6e 74 73 0a 20 0a 20 6f 20 43 6f 6c 6f 75 |ients. . o Colou| 00000280 72 20 64 69 74 68 65 72 69 6e 67 20 74 6f 20 69 |r dithering to i| 00000290 6e 63 72 65 61 73 65 20 74 68 65 20 61 70 70 61 |ncrease the appa| 000002a0 72 65 6e 74 20 6e 75 6d 62 65 72 20 6f 66 20 63 |rent number of c| 000002b0 6f 6c 6f 75 72 73 0a 20 0a 20 6f 20 45 61 73 79 |olours. . o Easy| 000002c0 20 74 6f 20 75 73 65 2c 20 66 72 65 65 20 66 6f | to use, free fo| 000002d0 72 6d 61 74 20 69 6e 70 75 74 20 6c 61 6e 67 75 |rmat input langu| 000002e0 61 67 65 20 77 69 74 68 20 65 72 72 6f 72 20 63 |age with error c| 000002f0 68 65 63 6b 69 6e 67 2e 20 50 61 72 61 6d 65 74 |hecking. Paramet| 00000300 65 72 73 0a 20 20 20 61 72 65 20 62 79 20 6b 65 |ers. are by ke| 00000310 79 77 6f 72 64 20 61 6e 64 20 6d 61 79 20 61 70 |yword and may ap| 00000320 70 65 61 72 20 69 6e 20 61 6e 79 20 6f 72 64 65 |pear in any orde| 00000330 72 2e 0a 20 0a 20 45 61 63 68 20 6f 66 20 74 68 |r.. . Each of th| 00000340 65 73 65 20 66 65 61 74 75 72 65 73 20 6f 66 20 |ese features of | 00000350 51 52 54 20 77 69 6c 6c 20 62 65 20 64 69 73 63 |QRT will be disc| 00000360 75 73 73 65 64 20 69 73 20 67 72 65 61 74 65 72 |ussed is greater| 00000370 20 64 65 74 61 69 6c 20 69 6e 20 74 68 69 73 0a | detail in this.| 00000380 64 6f 63 75 6d 65 6e 74 2e 0a 0a 0a 54 48 45 20 |document....THE | 00000390 51 52 54 20 57 4f 52 4c 44 0a 20 0a 20 51 52 54 |QRT WORLD. . QRT| 000003a0 20 63 6f 6e 73 74 72 75 63 74 73 20 61 6e 20 69 | constructs an i| 000003b0 6d 61 67 65 20 6f 66 20 74 68 65 20 77 6f 72 6c |mage of the worl| 000003c0 64 20 62 79 20 70 65 72 66 6f 72 6d 69 6e 67 20 |d by performing | 000003d0 63 65 72 74 61 69 6e 20 6d 61 6e 69 70 75 6c 61 |certain manipula| 000003e0 74 69 6f 6e 73 20 6f 6e 0a 61 6e 20 69 6e 74 65 |tions on.an inte| 000003f0 72 6e 61 6c 20 72 65 70 72 65 73 65 6e 74 61 74 |rnal representat| 00000400 69 6f 6e 20 6f 66 20 61 20 67 72 6f 75 70 20 6f |ion of a group o| 00000410 66 20 6f 62 6a 65 63 74 73 2e 20 59 6f 75 20 6d |f objects. You m| 00000420 75 73 74 20 70 72 6f 76 69 64 65 20 61 0a 64 65 |ust provide a.de| 00000430 73 63 72 69 70 74 69 6f 6e 20 6f 66 20 74 68 65 |scription of the| 00000440 73 65 20 6f 62 6a 65 63 74 73 20 74 6f 20 51 52 |se objects to QR| 00000450 54 20 74 68 72 6f 75 67 68 20 74 68 65 20 51 52 |T through the QR| 00000460 54 20 69 6e 70 75 74 20 6c 61 6e 67 75 61 67 65 |T input language| 00000470 2e 0a 20 0a 20 51 52 54 20 77 72 69 74 65 73 20 |.. . QRT writes | 00000480 61 20 6d 61 63 68 69 6e 65 20 69 6e 64 65 70 65 |a machine indepe| 00000490 6e 64 65 6e 74 20 62 69 74 6d 61 70 20 66 69 6c |ndent bitmap fil| 000004a0 65 20 77 68 69 63 68 20 63 61 6e 20 62 65 20 72 |e which can be r| 000004b0 65 61 64 20 62 79 20 20 61 0a 63 6f 6d 70 75 74 |ead by a.comput| 000004c0 65 72 20 73 70 65 63 69 66 69 63 20 70 6f 73 74 |er specific post| 000004d0 20 70 72 6f 63 65 73 73 6f 72 2e 20 54 68 65 20 | processor. The | 000004e0 70 6f 73 74 20 70 72 6f 63 65 73 73 6f 72 20 65 |post processor e| 000004f0 69 74 68 65 72 20 64 69 73 70 6c 61 79 73 20 74 |ither displays t| 00000500 68 65 0a 69 6d 61 67 65 20 6f 72 20 63 6f 6e 76 |he.image or conv| 00000510 65 72 74 73 20 69 74 20 69 6e 74 6f 20 74 68 65 |erts it into the| 00000520 20 70 72 6f 70 65 72 20 66 6f 72 6d 20 66 6f 72 | proper form for| 00000530 20 64 69 73 70 6c 61 79 20 62 79 20 73 79 73 74 | display by syst| 00000540 65 6d 20 70 72 6f 67 72 61 6d 73 2e 0a 28 53 65 |em programs..(Se| 00000550 65 20 74 68 65 20 4d 61 63 68 69 6e 65 20 44 65 |e the Machine De| 00000560 70 65 6e 64 65 6e 74 20 49 6e 66 6f 72 6d 61 74 |pendent Informat| 00000570 69 6f 6e 20 73 65 63 74 69 6f 6e 20 6f 66 20 74 |ion section of t| 00000580 68 69 73 20 6d 61 6e 75 61 6c 20 66 6f 72 20 64 |his manual for d| 00000590 65 74 61 69 6c 73 29 2e 0a 20 0a 20 51 52 54 20 |etails).. . QRT | 000005a0 69 73 20 63 61 70 61 62 6c 65 20 6f 66 20 64 65 |is capable of de| 000005b0 61 6c 69 6e 67 20 77 69 74 68 20 35 20 74 79 70 |aling with 5 typ| 000005c0 65 73 20 6f 66 20 70 72 69 6d 69 74 69 76 65 20 |es of primitive | 000005d0 6f 62 6a 65 63 74 73 3a 20 73 70 68 65 72 65 73 |objects: spheres| 000005e0 2c 0a 70 61 72 61 6c 6c 65 6c 6f 67 72 61 6d 73 |,.parallelograms| 000005f0 2c 20 74 72 69 61 6e 67 6c 65 73 2c 20 72 69 6e |, triangles, rin| 00000600 67 73 20 28 61 6e 6e 75 6c 75 73 29 2c 20 61 6e |gs (annulus), an| 00000610 64 20 71 75 61 64 72 61 74 69 63 20 73 75 72 66 |d quadratic surf| 00000620 61 63 65 73 2e 20 54 68 65 0a 6c 61 74 74 65 72 |aces. The.latter| 00000630 20 63 61 6e 20 62 65 20 75 73 65 64 20 74 6f 20 | can be used to | 00000640 6d 6f 64 65 6c 20 63 6f 6e 65 73 2c 20 6f 62 6c |model cones, obl| 00000650 6f 6e 67 20 73 70 68 65 72 6f 69 64 73 2c 20 61 |ong spheroids, a| 00000660 6e 64 20 6f 74 68 65 72 20 69 6e 74 65 72 65 73 |nd other interes| 00000670 74 69 6e 67 0a 73 75 72 66 61 63 65 73 2e 20 45 |ting.surfaces. E| 00000680 61 63 68 20 6f 66 20 74 68 65 73 65 20 6f 62 6a |ach of these obj| 00000690 65 63 74 73 20 63 61 6e 20 68 61 76 65 20 61 6e |ects can have an| 000006a0 20 61 72 62 69 74 72 61 72 79 20 6f 72 69 65 6e | arbitrary orien| 000006b0 74 61 74 69 6f 6e 20 69 6e 20 73 70 61 63 65 2c |tation in space,| 000006c0 0a 61 6e 64 20 61 72 62 69 74 72 61 72 79 20 73 |.and arbitrary s| 000006d0 75 72 66 61 63 65 20 63 68 61 72 61 63 74 65 72 |urface character| 000006e0 69 73 74 69 63 73 2e 0a 20 0a 0a 51 52 54 20 49 |istics.. ..QRT I| 000006f0 4e 50 55 54 20 4c 41 4e 47 55 41 47 45 0a 20 0a |NPUT LANGUAGE. .| 00000700 20 54 68 65 20 51 52 54 20 69 6e 70 75 74 20 6c | The QRT input l| 00000710 61 6e 67 75 61 67 65 20 69 73 20 66 72 65 65 20 |anguage is free | 00000720 66 6f 72 6d 61 74 2c 20 69 6e 20 74 68 61 74 20 |format, in that | 00000730 63 6f 6d 6d 61 6e 64 73 20 6d 61 79 20 62 65 20 |commands may be | 00000740 70 6c 61 63 65 64 0a 61 6e 79 77 68 65 72 65 20 |placed.anywhere | 00000750 6f 6e 20 61 20 6c 69 6e 65 2c 20 61 6e 64 20 6e |on a line, and n| 00000760 65 77 6c 69 6e 65 73 20 6d 61 79 20 62 65 20 70 |ewlines may be p| 00000770 6c 61 63 65 64 20 61 74 20 61 6e 79 20 70 6f 69 |laced at any poi| 00000780 6e 74 2e 20 54 68 69 73 20 6d 61 6b 65 73 20 69 |nt. This makes i| 00000790 74 0a 65 61 73 79 20 74 6f 20 75 73 65 20 69 6e |t.easy to use in| 000007a0 64 65 6e 74 61 74 69 6f 6e 2e 20 43 6f 6d 6d 65 |dentation. Comme| 000007b0 6e 74 73 20 61 72 65 20 61 6c 73 6f 20 73 75 70 |nts are also sup| 000007c0 70 6f 72 74 65 64 20 62 79 20 73 75 72 72 6f 75 |ported by surrou| 000007d0 6e 64 69 6e 67 20 74 65 78 74 0a 77 69 74 68 20 |nding text.with | 000007e0 63 75 72 6c 79 20 62 72 61 63 65 73 20 27 7b 27 |curly braces '{'| 000007f0 20 61 6e 64 20 27 7d 27 2e 20 43 6f 6d 6d 65 6e | and '}'. Commen| 00000800 74 73 20 6d 61 79 20 73 70 61 6e 20 6c 69 6e 65 |ts may span line| 00000810 73 2e 0a 20 0a 20 54 68 65 20 51 52 54 20 69 6e |s.. . The QRT in| 00000820 70 75 74 20 6c 61 6e 67 75 61 67 65 20 69 73 20 |put language is | 00000830 6e 6f 74 20 63 61 73 65 20 73 65 6e 73 69 74 69 |not case sensiti| 00000840 76 65 2e 20 41 20 66 75 6c 6c 20 64 65 73 63 72 |ve. A full descr| 00000850 69 70 74 69 6f 6e 20 6f 66 20 74 68 65 0a 6c 61 |iption of the.la| 00000860 6e 67 75 61 67 65 20 61 6e 64 20 61 20 73 68 6f |nguage and a sho| 00000870 72 74 65 72 2c 20 63 6f 6e 74 65 78 74 20 66 72 |rter, context fr| 00000880 65 65 20 67 72 61 6d 6d 61 72 20 63 61 6e 20 62 |ee grammar can b| 00000890 65 20 66 6f 75 6e 64 20 65 6c 73 65 77 68 65 72 |e found elsewher| 000008a0 65 20 69 6e 20 74 68 69 73 0a 6d 61 6e 75 61 6c |e in this.manual| 000008b0 2e 0a 20 0a 0a 54 48 45 20 51 52 54 20 49 4c 4c |.. ..THE QRT ILL| 000008c0 55 4d 49 4e 41 54 49 4f 4e 20 4d 4f 44 45 4c 0a |UMINATION MODEL.| 000008d0 20 0a 20 42 65 66 6f 72 65 20 6d 65 61 6e 69 6e | . Before meanin| 000008e0 67 66 75 6c 20 69 6d 61 67 65 73 20 63 61 6e 20 |gful images can | 000008f0 62 65 20 63 72 65 61 74 65 64 2c 20 74 68 65 20 |be created, the | 00000900 51 52 54 20 69 6c 6c 75 6d 69 6e 61 74 69 6f 6e |QRT illumination| 00000910 20 6d 6f 64 65 6c 20 6d 75 73 74 20 62 65 0a 75 | model must be.u| 00000920 6e 64 65 72 73 74 6f 6f 64 2e 20 54 68 65 20 6c |nderstood. The l| 00000930 69 67 68 74 20 74 68 61 74 20 72 65 61 63 68 65 |ight that reache| 00000940 73 20 74 68 65 20 6f 62 73 65 72 76 65 72 20 66 |s the observer f| 00000950 72 6f 6d 20 65 61 63 68 20 6f 62 6a 65 63 74 20 |rom each object | 00000960 69 73 20 63 6f 6d 70 6f 73 65 64 0a 6f 66 20 73 |is composed.of s| 00000970 65 76 65 72 61 6c 20 63 6f 6d 70 6f 6e 65 6e 74 |everal component| 00000980 73 3a 0a 20 0a 20 6f 20 44 69 66 66 75 73 65 20 |s:. . o Diffuse | 00000990 6c 69 67 68 74 20 2d 20 54 68 65 20 22 63 6f 6c |light - The "col| 000009a0 6f 72 22 20 6f 66 20 74 68 65 20 6f 62 6a 65 63 |or" of the objec| 000009b0 74 0a 20 0a 20 6f 20 41 6d 62 69 65 6e 74 20 6c |t. . o Ambient l| 000009c0 69 67 68 74 20 2d 20 54 68 65 20 63 6f 6c 6f 72 |ight - The color| 000009d0 20 6f 66 20 74 68 65 20 6c 69 67 68 74 20 74 68 | of the light th| 000009e0 61 74 20 66 61 6c 6c 73 20 6f 6e 20 74 68 65 20 |at falls on the | 000009f0 73 75 72 66 61 63 65 20 6f 66 20 74 68 65 0a 20 |surface of the. | 00000a00 20 20 6f 62 6a 65 63 74 20 69 66 20 6e 6f 20 6c | object if no l| 00000a10 61 6d 70 73 20 61 72 65 20 73 68 69 6e 69 6e 67 |amps are shining| 00000a20 20 6f 6e 20 74 68 69 73 20 73 70 6f 74 2e 20 4e | on this spot. N| 00000a30 6f 74 65 20 74 68 61 74 20 74 68 69 73 20 73 70 |ote that this sp| 00000a40 65 63 69 66 69 65 73 20 74 68 65 0a 20 20 20 63 |ecifies the. c| 00000a50 6f 6c 6f 72 20 6f 66 20 6c 69 67 68 74 2c 20 6e |olor of light, n| 00000a60 6f 74 20 74 68 65 20 63 6f 6c 6f 72 20 6f 66 20 |ot the color of | 00000a70 74 68 65 20 6f 62 6a 65 63 74 20 69 74 73 65 6c |the object itsel| 00000a80 66 2e 0a 20 0a 20 6f 20 52 65 66 6c 65 63 74 65 |f.. . o Reflecte| 00000a90 64 20 6c 69 67 68 74 20 2d 20 49 66 20 74 68 65 |d light - If the| 00000aa0 20 6f 62 6a 65 63 74 20 61 63 74 73 20 61 73 20 | object acts as | 00000ab0 61 20 6d 69 72 72 6f 72 2c 20 73 6f 6d 65 20 6c |a mirror, some l| 00000ac0 69 67 68 74 20 69 73 0a 20 20 20 72 65 66 6c 65 |ight is. refle| 00000ad0 63 74 65 64 2e 0a 20 0a 20 6f 20 53 70 65 63 75 |cted.. . o Specu| 00000ae0 6c 61 72 20 68 69 67 68 6c 69 67 68 74 73 20 2d |lar highlights -| 00000af0 20 54 68 65 20 22 62 72 69 67 68 74 20 73 70 6f | The "bright spo| 00000b00 74 73 22 20 6f 66 20 61 20 73 68 69 6e 79 20 6f |ts" of a shiny o| 00000b10 62 6a 65 63 74 20 76 69 65 77 65 64 20 69 6e 20 |bject viewed in | 00000b20 61 0a 20 20 20 6c 69 67 68 74 2e 0a 20 0a 20 6f |a. light.. . o| 00000b30 20 54 72 61 6e 73 6d 69 74 74 65 64 20 6c 69 67 | Transmitted lig| 00000b40 68 74 20 2d 20 54 68 65 20 6f 62 6a 65 63 74 20 |ht - The object | 00000b50 6d 61 79 20 74 72 61 6e 73 6d 69 74 20 73 6f 6d |may transmit som| 00000b60 65 20 6f 66 20 74 68 65 20 6c 69 67 68 74 20 74 |e of the light t| 00000b70 68 61 74 0a 20 20 20 73 74 72 69 6b 65 73 20 74 |hat. strikes t| 00000b80 68 65 20 62 61 63 6b 20 6f 66 20 74 68 65 20 6f |he back of the o| 00000b90 62 6a 65 63 74 20 28 67 6c 61 73 73 20 73 75 72 |bject (glass sur| 00000ba0 66 61 63 65 73 29 0a 20 0a 20 41 6c 6c 20 6f 66 |faces). . All of| 00000bb0 20 74 68 65 73 65 20 6c 69 67 68 74 20 63 68 61 | these light cha| 00000bc0 72 61 63 74 65 72 69 73 74 69 63 73 20 63 61 6e |racteristics can| 00000bd0 20 62 65 20 73 70 65 63 69 66 69 65 64 20 66 6f | be specified fo| 00000be0 72 20 61 6e 79 20 6f 62 6a 65 63 74 2e 20 49 66 |r any object. If| 00000bf0 20 6e 6f 6e 65 0a 61 72 65 20 73 70 65 63 69 66 | none.are specif| 00000c00 69 65 64 2c 20 74 68 65 20 63 75 72 72 65 6e 74 |ied, the current| 00000c10 20 64 65 66 61 75 6c 74 73 20 61 72 65 20 61 73 | defaults are as| 00000c20 73 75 6d 65 64 2e 20 54 68 65 73 65 20 64 65 66 |sumed. These def| 00000c30 61 75 6c 74 73 20 63 61 6e 20 62 65 0a 63 68 61 |aults can be.cha| 00000c40 6e 67 65 64 20 28 73 65 65 20 44 45 46 41 55 4c |nged (see DEFAUL| 00000c50 54 20 69 6e 20 4c 61 6e 67 75 61 67 65 20 52 65 |T in Language Re| 00000c60 66 65 72 65 6e 63 65 20 47 75 69 64 65 29 2e 0a |ference Guide)..| 00000c70 20 0a 20 4d 6f 73 74 20 6f 66 20 74 68 65 73 65 | . Most of these| 00000c80 20 6c 69 67 68 74 20 63 68 61 72 61 63 74 65 72 | light character| 00000c90 69 73 74 69 63 73 20 64 65 61 6c 20 77 69 74 68 |istics deal with| 00000ca0 20 61 20 70 65 72 63 65 6e 74 61 67 65 20 6f 66 | a percentage of| 00000cb0 20 6c 69 67 68 74 2e 20 46 6f 72 0a 65 78 61 6d | light. For.exam| 00000cc0 70 6c 65 2c 20 61 20 6c 69 67 68 74 20 6d 61 79 |ple, a light may| 00000cd0 20 72 65 66 6c 65 63 74 20 38 30 25 20 6f 66 20 | reflect 80% of | 00000ce0 74 68 65 20 72 65 64 20 6c 69 67 68 74 20 74 68 |the red light th| 00000cf0 61 74 20 73 74 72 69 6b 65 73 20 69 74 2c 20 32 |at strikes it, 2| 00000d00 30 25 20 6f 66 0a 74 68 65 20 67 72 65 65 6e 2c |0% of.the green,| 00000d10 20 61 6e 64 20 34 30 25 20 6f 66 20 74 68 65 20 | and 40% of the | 00000d20 62 6c 75 65 2e 20 54 68 69 73 20 69 73 20 74 68 |blue. This is th| 00000d30 65 20 22 63 6f 6c 6f 72 22 20 6f 66 20 74 68 65 |e "color" of the| 00000d40 20 6f 62 6a 65 63 74 20 28 64 69 66 66 75 73 65 | object (diffuse| 00000d50 0a 6c 69 67 68 74 29 2c 20 61 6e 64 20 77 6f 75 |.light), and wou| 00000d60 6c 64 20 62 65 20 73 70 65 63 69 66 69 65 64 20 |ld be specified | 00000d70 69 6e 20 51 52 54 20 62 79 20 74 68 65 20 66 6f |in QRT by the fo| 00000d80 6c 6c 6f 77 69 6e 67 20 73 79 6e 74 61 78 3a 0a |llowing syntax:.| 00000d90 20 0a 20 64 69 66 66 20 3d 20 28 2e 38 30 2c 20 | . diff = (.80, | 00000da0 2e 32 30 2c 20 2e 34 30 29 0a 20 0a 20 49 6e 20 |.20, .40). . In | 00000db0 51 52 54 2c 20 31 2e 30 30 20 69 73 20 31 30 30 |QRT, 1.00 is 100| 00000dc0 25 2e 20 54 68 65 20 6c 61 6e 67 75 61 67 65 20 |%. The language | 00000dd0 69 73 20 61 6c 73 6f 20 66 72 65 65 2d 66 6f 72 |is also free-for| 00000de0 6d 61 74 2c 20 73 6f 20 74 68 65 20 61 62 6f 76 |mat, so the abov| 00000df0 65 20 69 73 0a 65 71 75 69 76 61 6c 65 6e 74 20 |e is.equivalent | 00000e00 74 6f 3a 0a 20 0a 20 64 69 66 66 20 3d 20 28 2e |to:. . diff = (.| 00000e10 38 30 2c 0a 20 20 20 20 20 20 20 20 20 2e 32 30 |80,. .20| 00000e20 2c 0a 20 20 20 20 20 20 20 20 20 2e 34 30 20 29 |,. .40 )| 00000e30 0a 20 0a 20 54 68 65 20 63 6f 6d 6d 61 73 20 62 |. . The commas b| 00000e40 65 74 77 65 65 6e 20 70 61 72 61 6d 65 74 65 72 |etween parameter| 00000e50 73 20 61 72 65 20 6f 70 74 69 6f 6e 61 6c 2c 20 |s are optional, | 00000e60 62 75 74 20 6d 61 6b 65 20 74 68 65 20 69 6e 70 |but make the inp| 00000e70 75 74 20 65 61 73 69 65 72 20 74 6f 0a 72 65 61 |ut easier to.rea| 00000e80 64 2e 20 53 65 6d 69 63 6f 6c 6f 6e 73 20 63 61 |d. Semicolons ca| 00000e90 6e 20 61 6c 73 6f 20 62 65 20 75 73 65 64 2e 0a |n also be used..| 00000ea0 20 0a 20 41 6d 62 69 65 6e 74 20 6c 69 67 68 74 | . Ambient light| 00000eb0 20 69 73 20 73 70 65 63 69 66 69 65 64 20 69 6e | is specified in| 00000ec0 20 61 20 73 69 6d 69 6c 61 72 20 6d 61 6e 6e 65 | a similar manne| 00000ed0 72 3a 0a 0a 20 61 6d 62 20 3d 20 28 2e 32 30 2c |r:.. amb = (.20,| 00000ee0 20 2e 32 30 2c 20 2e 32 30 29 0a 20 0a 20 54 68 | .20, .20). . Th| 00000ef0 65 20 61 6d 62 69 65 6e 74 20 6c 69 67 68 74 20 |e ambient light | 00000f00 76 61 6c 75 65 73 20 73 68 6f 75 6c 64 20 62 65 |values should be| 00000f10 20 66 61 69 72 6c 79 20 73 6d 61 6c 6c 2e 20 4d | fairly small. M| 00000f20 6f 73 74 20 6f 66 20 74 68 65 20 6c 69 67 68 74 |ost of the light| 00000f30 20 68 69 74 74 69 6e 67 0a 74 68 65 20 6f 62 6a | hitting.the obj| 00000f40 65 63 74 20 63 6f 6d 65 73 20 66 72 6f 6d 20 6c |ect comes from l| 00000f50 61 6d 70 73 2c 20 62 75 74 20 73 6f 6d 65 20 70 |amps, but some p| 00000f60 61 72 74 73 20 6f 66 20 74 68 65 20 6f 62 6a 65 |arts of the obje| 00000f70 63 74 20 6d 61 79 20 62 65 20 69 6e 20 74 68 65 |ct may be in the| 00000f80 0a 73 68 61 64 6f 77 20 6f 66 20 61 6e 6f 74 68 |.shadow of anoth| 00000f90 65 72 20 6f 62 6a 65 63 74 2e 20 49 66 20 6e 6f |er object. If no| 00000fa0 20 61 6d 62 69 65 6e 74 20 6c 69 67 68 74 20 69 | ambient light i| 00000fb0 73 20 73 70 65 63 69 66 69 65 64 2c 20 74 68 65 |s specified, the| 00000fc0 73 65 20 73 68 61 64 6f 77 73 0a 77 69 6c 6c 20 |se shadows.will | 00000fd0 61 70 70 65 61 72 20 74 6f 74 61 6c 6c 79 20 62 |appear totally b| 00000fe0 6c 61 63 6b 2c 20 77 68 69 63 68 20 6c 6f 6f 6b |lack, which look| 00000ff0 73 20 75 6e 72 65 61 6c 69 73 74 69 63 2e 20 41 |s unrealistic. A| 00001000 6d 62 69 65 6e 74 20 6c 69 67 68 74 20 77 69 6c |mbient light wil| 00001010 6c 20 67 69 76 65 0a 74 68 65 20 61 66 66 65 63 |l give.the affec| 00001020 74 20 6f 66 20 61 20 73 6d 61 6c 6c 20 61 6d 6f |t of a small amo| 00001030 75 6e 74 20 6f 66 20 6c 69 67 68 74 20 68 69 74 |unt of light hit| 00001040 74 69 6e 67 20 61 72 65 61 73 20 69 6e 20 61 20 |ting areas in a | 00001050 73 68 61 64 6f 77 2c 20 70 72 6f 64 75 63 69 6e |shadow, producin| 00001060 67 20 61 0a 6d 6f 72 65 20 72 65 61 6c 69 73 74 |g a.more realist| 00001070 69 63 20 6c 6f 6f 6b 69 6e 67 20 69 6d 61 67 65 |ic looking image| 00001080 2e 0a 20 0a 20 52 65 66 6c 65 63 74 69 6f 6e 20 |.. . Reflection | 00001090 69 73 20 73 70 65 63 69 66 69 65 64 20 75 73 69 |is specified usi| 000010a0 6e 67 20 74 68 65 20 4d 49 52 52 4f 52 20 61 74 |ng the MIRROR at| 000010b0 74 72 69 62 75 74 65 3a 0a 20 0a 20 6d 69 72 72 |tribute:. . mirr| 000010c0 6f 72 20 3d 20 28 2e 39 30 2c 20 2e 39 30 2c 20 |or = (.90, .90, | 000010d0 2e 39 30 29 0a 20 0a 20 49 66 20 61 20 74 72 75 |.90). . If a tru| 000010e0 65 20 6d 69 72 72 6f 72 65 64 20 73 75 72 66 61 |e mirrored surfa| 000010f0 63 65 20 69 73 20 64 65 73 69 72 65 64 2c 20 74 |ce is desired, t| 00001100 68 65 20 6d 69 72 72 6f 72 20 76 61 6c 75 65 73 |he mirror values| 00001110 20 73 68 6f 75 6c 64 20 62 65 20 66 61 69 72 6c | should be fairl| 00001120 79 0a 68 69 67 68 2e 20 49 66 20 6f 6e 65 20 6f |y.high. If one o| 00001130 66 20 74 68 65 20 76 61 6c 75 65 73 20 68 61 73 |f the values has| 00001140 20 61 20 68 69 67 68 65 72 20 76 61 6c 75 65 20 | a higher value | 00001150 74 68 61 6e 20 74 68 65 20 6f 74 68 65 72 73 2c |than the others,| 00001160 20 74 68 65 20 6d 69 72 72 6f 72 0a 77 69 6c 6c | the mirror.will| 00001170 20 61 70 70 65 61 72 20 72 65 64 2c 20 67 72 65 | appear red, gre| 00001180 65 6e 2c 20 6f 72 20 62 6c 75 65 2e 0a 20 0a 20 |en, or blue.. . | 00001190 54 72 61 6e 73 6d 69 73 73 69 6f 6e 20 69 73 20 |Transmission is | 000011a0 73 70 65 63 69 66 69 65 64 20 61 73 20 66 6f 6c |specified as fol| 000011b0 6c 6f 77 73 3a 0a 20 0a 20 74 72 61 6e 73 20 3d |lows:. . trans =| 000011c0 20 28 2e 38 30 2c 20 2e 38 30 2c 20 2e 38 30 29 | (.80, .80, .80)| 000011d0 0a 20 64 65 6e 73 69 74 79 20 3d 20 28 2e 30 32 |. density = (.02| 000011e0 32 2c 20 2e 30 32 32 2c 20 2e 30 32 32 29 0a 20 |2, .022, .022). | 000011f0 69 6e 64 65 78 20 3d 20 31 2e 33 33 0a 20 0a 20 |index = 1.33. . | 00001200 4e 6f 74 65 20 74 68 65 20 61 64 64 69 74 69 6f |Note the additio| 00001210 6e 20 6f 66 20 61 6e 6f 74 68 65 72 20 70 61 72 |n of another par| 00001220 61 6d 65 74 65 72 2c 20 74 68 65 20 69 6e 64 65 |ameter, the inde| 00001230 78 20 6f 66 20 72 65 66 72 61 63 74 69 6f 6e 2e |x of refraction.| 00001240 20 41 6e 0a 65 78 70 6c 61 6e 61 74 69 6f 6e 20 | An.explanation | 00001250 6f 66 20 74 68 65 20 69 6e 64 65 78 20 6f 66 20 |of the index of | 00001260 72 65 66 72 61 63 74 69 6f 6e 20 66 6f 72 20 61 |refraction for a| 00001270 6e 20 6f 62 6a 65 63 74 20 69 73 20 62 65 79 6f |n object is beyo| 00001280 6e 64 20 74 68 65 20 73 63 6f 70 65 20 6f 66 0a |nd the scope of.| 00001290 74 68 69 73 20 64 6f 63 75 6d 65 6e 74 20 2d 20 |this document - | 000012a0 73 65 65 20 61 20 62 6f 6f 6b 20 6f 6e 20 65 6c |see a book on el| 000012b0 65 6d 65 6e 74 61 72 79 20 6f 70 74 69 63 73 20 |ementary optics | 000012c0 66 6f 72 20 64 65 74 61 69 6c 73 2e 20 54 68 65 |for details. The| 000012d0 20 64 65 6e 73 69 74 79 0a 66 61 63 74 6f 72 20 | density.factor | 000012e0 69 73 20 61 20 6c 69 67 68 74 20 61 74 74 65 6e |is a light atten| 000012f0 75 61 74 69 6f 6e 20 66 61 63 74 6f 72 20 70 65 |uation factor pe| 00001300 72 20 75 6e 69 74 20 64 69 73 74 61 6e 63 65 20 |r unit distance | 00001310 74 68 65 20 6c 69 67 68 74 20 74 72 61 76 65 6c |the light travel| 00001320 73 0a 74 68 72 6f 75 67 68 20 74 68 65 20 6f 62 |s.through the ob| 00001330 6a 65 63 74 2e 20 54 68 65 20 74 72 61 6e 73 20 |ject. The trans | 00001340 70 61 72 61 6d 65 74 65 72 20 74 65 6c 6c 73 20 |parameter tells | 00001350 51 52 54 20 68 6f 77 20 6d 75 63 68 20 6c 69 67 |QRT how much lig| 00001360 68 74 20 74 6f 20 72 65 6d 6f 76 65 0a 66 72 6f |ht to remove.fro| 00001370 6d 20 73 68 61 64 6f 77 73 20 63 61 73 74 20 62 |m shadows cast b| 00001380 79 20 74 68 69 73 20 6f 62 6a 65 63 74 2e 0a 20 |y this object.. | 00001390 0a 20 49 6e 20 61 64 64 69 74 69 6f 6e 2c 20 73 |. In addition, s| 000013a0 70 65 63 75 6c 61 72 20 68 69 67 68 6c 69 67 68 |pecular highligh| 000013b0 74 73 20 61 72 65 20 73 70 65 63 69 66 69 65 64 |ts are specified| 000013c0 20 77 69 74 68 20 74 77 6f 20 70 61 72 61 6d 65 | with two parame| 000013d0 74 65 72 73 3a 0a 20 0a 20 72 65 66 6c 65 63 74 |ters:. . reflect| 000013e0 20 3d 20 2e 35 30 2c 0a 20 73 72 65 66 6c 65 63 | = .50,. sreflec| 000013f0 74 20 3d 20 34 35 0a 20 0a 20 22 52 45 46 4c 45 |t = 45. . "REFLE| 00001400 43 54 22 20 69 73 20 74 68 65 20 70 65 72 63 65 |CT" is the perce| 00001410 6e 74 61 67 65 20 6f 66 20 6c 69 67 68 74 20 72 |ntage of light r| 00001420 65 66 6c 65 63 74 65 64 20 69 6e 20 74 68 65 20 |eflected in the | 00001430 73 70 65 63 75 6c 61 72 20 68 69 67 68 6c 69 67 |specular highlig| 00001440 68 74 2c 0a 61 6e 64 20 73 72 65 66 6c 65 63 74 |ht,.and sreflect| 00001450 20 69 73 20 74 68 65 20 50 68 6f 6e 67 20 73 70 | is the Phong sp| 00001460 65 63 74 72 61 6c 20 72 65 66 6c 65 63 74 69 6f |ectral reflectio| 00001470 6e 20 63 6f 65 66 66 69 63 69 65 6e 74 2e 20 41 |n coefficient. A| 00001480 67 61 69 6e 2c 20 61 6e 0a 65 78 70 6c 61 6e 61 |gain, an.explana| 00001490 74 69 6f 6e 20 6f 66 20 74 68 65 20 50 68 6f 6e |tion of the Phon| 000014a0 67 20 63 6f 65 66 66 69 63 69 65 6e 74 20 69 73 |g coefficient is| 000014b0 20 62 65 79 6f 6e 64 20 74 68 65 20 73 63 6f 70 | beyond the scop| 000014c0 65 20 6f 66 20 74 68 69 73 20 64 6f 63 75 6d 65 |e of this docume| 000014d0 6e 74 3b 0a 68 6f 77 65 76 65 72 2c 20 61 20 68 |nt;.however, a h| 000014e0 69 67 68 65 72 20 76 61 6c 75 65 20 66 6f 72 20 |igher value for | 000014f0 74 68 65 20 63 6f 65 66 66 69 63 69 65 6e 74 20 |the coefficient | 00001500 77 69 6c 6c 20 72 65 73 75 6c 74 20 69 6e 20 73 |will result in s| 00001510 6d 61 6c 6c 65 72 2c 20 74 69 67 68 74 65 72 0a |maller, tighter.| 00001520 68 69 67 68 6c 69 67 68 74 73 20 66 6f 72 20 61 |highlights for a| 00001530 20 6d 6f 72 65 20 6d 65 74 61 6c 6c 69 63 20 6c | more metallic l| 00001540 6f 6f 6b 69 6e 67 20 6f 62 6a 65 63 74 2e 20 4c |ooking object. L| 00001550 6f 77 65 72 20 76 61 6c 75 65 73 20 6f 66 20 73 |ower values of s| 00001560 72 65 66 6c 65 63 74 0a 73 68 6f 75 6c 64 20 62 |reflect.should b| 00001570 65 20 61 63 63 6f 6d 70 61 6e 69 65 64 20 62 79 |e accompanied by| 00001580 20 6c 6f 77 65 72 20 76 61 6c 75 65 73 20 69 6e | lower values in| 00001590 20 72 65 66 6c 65 63 74 2c 20 61 6e 64 20 77 69 | reflect, and wi| 000015a0 6c 6c 20 70 72 6f 64 75 63 65 20 64 75 6c 6c 65 |ll produce dulle| 000015b0 72 0a 6c 6f 6f 6b 69 6e 67 20 73 75 72 66 61 63 |r.looking surfac| 000015c0 65 73 2c 20 73 75 63 68 20 61 73 20 70 61 70 65 |es, such as pape| 000015d0 72 2e 0a 20 0a 20 51 52 54 20 61 6c 73 6f 20 61 |r.. . QRT also a| 000015e0 63 63 65 70 74 73 20 61 20 64 69 74 68 65 72 69 |ccepts a ditheri| 000015f0 6e 67 20 61 6d 6f 75 6e 74 20 66 6f 72 20 65 61 |ng amount for ea| 00001600 63 68 20 6f 62 6a 65 63 74 3a 0a 20 0a 20 64 69 |ch object:. . di| 00001610 74 68 65 72 20 3d 20 33 0a 20 0a 20 44 69 74 68 |ther = 3. . Dith| 00001620 65 72 69 6e 67 20 69 73 20 61 20 6d 65 63 68 61 |ering is a mecha| 00001630 6e 69 73 6d 20 66 6f 72 20 73 69 6d 75 6c 61 74 |nism for simulat| 00001640 69 6e 67 20 63 6f 6c 6f 72 73 20 6e 6f 74 20 61 |ing colors not a| 00001650 76 61 69 6c 61 62 6c 65 20 6f 6e 20 74 68 65 20 |vailable on the | 00001660 64 69 73 70 6c 61 79 0a 62 79 20 62 6c 65 6e 64 |display.by blend| 00001670 69 6e 67 20 6f 74 68 65 72 20 63 6f 6c 6f 72 73 |ing other colors| 00001680 2e 20 54 68 65 20 64 65 66 61 75 6c 74 20 64 69 |. The default di| 00001690 74 68 65 72 69 6e 67 20 63 6f 65 66 66 69 63 69 |thering coeffici| 000016a0 65 6e 74 20 69 73 20 33 3b 20 69 74 20 73 68 6f |ent is 3; it sho| 000016b0 75 6c 64 0a 62 65 20 6b 65 70 74 20 73 6d 61 6c |uld.be kept smal| 000016c0 6c 2e 20 56 61 6c 75 65 73 20 6f 66 20 31 20 74 |l. Values of 1 t| 000016d0 6f 20 36 20 61 72 65 20 67 6f 6f 64 2e 20 4c 61 |o 6 are good. La| 000016e0 72 67 65 72 20 6f 62 6a 65 63 74 73 20 73 68 6f |rger objects sho| 000016f0 75 6c 64 20 65 6d 70 6c 6f 79 20 6d 6f 72 65 0a |uld employ more.| 00001700 64 69 74 68 65 72 69 6e 67 2c 20 61 6e 64 20 6d |dithering, and m| 00001710 69 72 72 6f 72 65 64 20 6f 72 20 67 6c 61 73 73 |irrored or glass| 00001720 20 6f 62 6a 65 63 74 73 20 73 68 6f 75 6c 64 20 | objects should | 00001730 68 61 76 65 20 6c 69 74 74 6c 65 20 6f 72 20 6e |have little or n| 00001740 6f 20 64 69 74 68 65 72 69 6e 67 2e 0a 20 0a 20 |o dithering.. . | 00001750 51 52 54 20 61 6c 73 6f 20 61 63 63 65 70 74 73 |QRT also accepts| 00001760 20 61 6e 20 61 74 74 72 69 62 75 74 65 20 22 46 | an attribute "F| 00001770 55 5a 5a 22 2c 20 62 75 74 20 74 68 69 73 20 69 |UZZ", but this i| 00001780 73 20 6e 6f 74 20 75 73 65 64 20 69 6e 20 74 68 |s not used in th| 00001790 65 20 70 72 65 73 65 6e 74 0a 69 6d 70 6c 65 6d |e present.implem| 000017a0 65 6e 74 61 74 69 6f 6e 2e 20 49 6e 20 61 20 66 |entation. In a f| 000017b0 75 74 75 72 65 20 69 6d 70 6c 65 6d 65 6e 74 61 |uture implementa| 000017c0 74 69 6f 6e 20 6f 66 20 51 52 54 2c 20 46 55 5a |tion of QRT, FUZ| 000017d0 5a 20 77 69 6c 6c 20 65 66 66 65 63 74 20 73 6d |Z will effect sm| 000017e0 61 6c 6c 2c 0a 72 61 6e 64 6f 6d 20 70 65 72 74 |all,.random pert| 000017f0 75 72 62 61 74 69 6f 6e 73 20 6f 66 20 74 68 65 |urbations of the| 00001800 20 6e 6f 72 6d 61 6c 20 76 65 63 74 6f 72 20 61 | normal vector a| 00001810 74 20 61 20 67 69 76 65 6e 20 6c 6f 63 61 74 69 |t a given locati| 00001820 6f 6e 20 6f 6e 20 61 6e 20 6f 62 6a 65 63 74 2e |on on an object.| 00001830 0a 54 68 69 73 20 77 69 6c 6c 20 73 69 6d 75 6c |.This will simul| 00001840 61 74 65 20 72 6f 75 67 68 20 73 75 72 66 61 63 |ate rough surfac| 00001850 65 73 2c 20 6d 61 74 74 65 64 20 67 6c 61 73 73 |es, matted glass| 00001860 2c 20 6f 72 20 69 6d 70 65 72 66 65 63 74 6c 79 |, or imperfectly| 00001870 20 72 65 66 6c 65 63 74 69 6e 67 0a 6d 69 72 72 | reflecting.mirr| 00001880 6f 72 73 2e 0a 20 0a 20 41 6c 6c 20 6f 66 20 74 |ors.. . All of t| 00001890 68 65 20 61 62 6f 76 65 20 6c 69 67 68 74 20 63 |he above light c| 000018a0 68 61 72 61 63 74 65 72 69 73 74 69 63 73 20 6d |haracteristics m| 000018b0 61 79 20 62 65 20 61 74 74 61 63 68 65 64 20 74 |ay be attached t| 000018c0 6f 20 61 6e 79 20 6f 62 6a 65 63 74 2e 20 54 68 |o any object. Th| 000018d0 65 0a 64 65 66 61 75 6c 74 20 69 73 20 66 6f 72 |e.default is for| 000018e0 20 61 20 77 68 69 74 65 2c 20 6e 6f 6e 20 72 65 | a white, non re| 000018f0 66 6c 65 63 74 69 6e 67 2c 20 6e 6f 6e 20 74 72 |flecting, non tr| 00001900 61 6e 73 6d 69 74 74 69 6e 67 20 64 75 6c 6c 20 |ansmitting dull | 00001910 73 75 72 66 61 63 65 20 77 69 74 68 0a 61 6e 20 |surface with.an | 00001920 61 76 65 72 61 67 65 20 61 6d 6f 75 6e 74 20 6f |average amount o| 00001930 66 20 64 69 74 68 65 72 69 6e 67 2e 20 49 6e 20 |f dithering. In | 00001940 61 64 64 69 74 69 6f 6e 2c 20 61 6e 79 20 6f 66 |addition, any of| 00001950 20 74 68 65 20 61 62 6f 76 65 20 63 6f 6c 6f 75 | the above colou| 00001960 72 0a 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 28 77 |r.information (w| 00001970 68 69 63 68 20 77 69 6c 6c 20 62 65 20 72 65 66 |hich will be ref| 00001980 65 72 72 65 64 20 74 6f 20 66 72 6f 6d 20 6e 6f |erred to from no| 00001990 77 20 6f 6e 20 61 73 20 43 4f 4c 4f 52 49 4e 46 |w on as COLORINF| 000019a0 4f 29 20 6d 61 79 20 61 6c 73 6f 20 62 65 0a 61 |O) may also be.a| 000019b0 74 74 61 63 68 65 64 20 74 6f 20 61 20 70 61 74 |ttached to a pat| 000019c0 74 65 72 6e 20 73 74 72 75 63 74 75 72 65 20 28 |tern structure (| 000019d0 73 65 65 20 74 68 65 20 50 41 54 54 45 52 4e 20 |see the PATTERN | 000019e0 73 65 63 74 69 6f 6e 20 6f 66 20 74 68 69 73 20 |section of this | 000019f0 64 6f 63 75 6d 65 6e 74 29 2e 0a 20 0a 0a 4c 49 |document).. ..LI| 00001a00 47 48 54 20 53 4f 55 52 43 45 53 0a 20 0a 20 4c |GHT SOURCES. . L| 00001a10 69 67 68 74 20 73 6f 75 72 63 65 73 20 69 6e 20 |ight sources in | 00001a20 51 52 54 20 61 72 65 20 63 61 6c 6c 65 64 20 22 |QRT are called "| 00001a30 4c 41 4d 50 53 22 2e 20 54 68 65 20 6c 61 6d 70 |LAMPS". The lamp| 00001a40 20 73 74 72 75 63 74 75 72 65 20 69 73 20 73 69 | structure is si| 00001a50 6d 70 6c 65 3a 0a 20 0a 20 4c 41 4d 50 20 28 20 |mple:. . LAMP ( | 00001a60 6c 6f 63 20 3d 20 28 31 32 2c 20 33 34 2c 20 35 |loc = (12, 34, 5| 00001a70 36 29 2c 0a 20 20 20 20 20 20 20 20 64 69 73 74 |6),. dist| 00001a80 20 3d 20 35 30 2c 0a 20 20 20 20 20 20 20 20 72 | = 50,. r| 00001a90 61 64 69 75 73 20 3d 20 31 30 20 29 0a 20 0a 20 |adius = 10 ). . | 00001aa0 54 68 65 20 64 65 66 61 75 6c 74 20 69 73 20 66 |The default is f| 00001ab0 6f 72 20 61 20 62 72 69 67 68 74 20 77 68 69 74 |or a bright whit| 00001ac0 65 20 6c 61 6d 70 2c 20 62 75 74 20 69 66 20 79 |e lamp, but if y| 00001ad0 6f 75 20 77 69 73 68 20 74 6f 20 63 68 61 6e 67 |ou wish to chang| 00001ae0 65 20 74 68 69 73 2c 20 79 6f 75 0a 63 61 6e 20 |e this, you.can | 00001af0 73 70 65 63 69 66 79 20 64 69 66 66 65 72 65 6e |specify differen| 00001b00 74 20 76 61 6c 75 65 73 20 66 6f 72 20 74 68 65 |t values for the| 00001b10 20 6c 61 6d 70 27 73 20 61 6d 62 69 65 6e 74 20 | lamp's ambient | 00001b20 6c 69 67 68 74 2e 20 54 68 65 20 72 61 64 69 75 |light. The radiu| 00001b30 73 20 76 61 6c 75 65 0a 69 73 20 69 67 6e 6f 72 |s value.is ignor| 00001b40 65 64 20 62 79 20 74 68 69 73 20 69 6d 70 6c 65 |ed by this imple| 00001b50 6d 65 6e 74 61 74 69 6f 6e 20 6f 66 20 51 52 54 |mentation of QRT| 00001b60 2c 20 62 75 74 20 69 74 20 6d 75 73 74 20 62 65 |, but it must be| 00001b70 20 73 75 70 70 6c 69 65 64 2e 20 49 6e 20 61 0a | supplied. In a.| 00001b80 66 75 74 75 72 65 20 76 65 72 73 69 6f 6e 2c 20 |future version, | 00001b90 74 68 65 20 72 61 64 69 75 73 20 6d 61 79 20 62 |the radius may b| 00001ba0 65 20 75 73 65 64 20 74 6f 20 69 6d 70 6c 65 6d |e used to implem| 00001bb0 65 6e 74 20 70 65 6e 75 6d 62 72 61 6c 20 73 68 |ent penumbral sh| 00001bc0 61 64 6f 77 73 2e 20 49 0a 64 69 64 6e 27 74 20 |adows. I.didn't | 00001bd0 69 6e 63 6c 75 64 65 20 74 68 65 6d 20 69 6e 20 |include them in | 00001be0 74 68 69 73 20 76 65 72 73 69 6f 6e 2c 20 73 69 |this version, si| 00001bf0 6e 63 65 20 74 68 65 79 20 74 61 6b 65 20 61 20 |nce they take a | 00001c00 76 65 72 79 20 6c 6f 6e 67 20 74 69 6d 65 20 74 |very long time t| 00001c10 6f 0a 63 6f 6d 70 75 74 65 2c 20 61 6e 64 20 64 |o.compute, and d| 00001c20 6f 6e 27 74 20 61 64 64 20 6d 75 63 68 20 74 6f |on't add much to| 00001c30 20 74 68 65 20 69 6d 61 67 65 20 71 75 61 6c 69 | the image quali| 00001c40 74 79 2e 0a 20 0a 20 54 68 65 20 22 64 69 73 74 |ty.. . The "dist| 00001c50 22 20 65 6e 74 72 79 20 69 6e 20 74 68 65 20 6c |" entry in the l| 00001c60 61 6d 70 20 73 74 72 75 63 74 75 72 65 20 73 70 |amp structure sp| 00001c70 65 63 69 66 69 65 73 20 61 74 20 77 68 61 74 20 |ecifies at what | 00001c80 64 69 73 74 61 6e 63 65 20 74 68 65 20 6c 69 67 |distance the lig| 00001c90 68 74 0a 66 72 6f 6d 20 74 68 65 20 6c 61 6d 70 |ht.from the lamp| 00001ca0 20 69 73 20 61 74 20 66 75 6c 6c 20 69 6e 74 65 | is at full inte| 00001cb0 6e 73 69 74 79 2e 20 42 65 79 6f 6e 64 20 74 68 |nsity. Beyond th| 00001cc0 69 73 20 76 61 6c 75 65 2c 20 74 68 65 20 6c 69 |is value, the li| 00001cd0 67 68 74 20 77 69 6c 6c 0a 64 65 63 72 65 61 73 |ght will.decreas| 00001ce0 65 20 69 6e 20 69 6e 74 65 6e 73 69 74 79 2e 20 |e in intensity. | 00001cf0 54 68 69 73 20 76 61 6c 75 65 20 73 68 6f 75 6c |This value shoul| 00001d00 64 20 62 65 20 73 65 74 20 73 6f 20 74 68 61 74 |d be set so that| 00001d10 20 74 68 65 20 6e 65 61 72 65 73 74 20 6f 62 6a | the nearest obj| 00001d20 65 63 74 0a 69 6e 20 74 68 65 20 73 63 65 6e 65 |ect.in the scene| 00001d30 20 69 73 20 73 6c 69 67 68 74 6c 79 20 6d 6f 72 | is slightly mor| 00001d40 65 20 74 68 61 6e 20 22 64 69 73 74 22 20 64 69 |e than "dist" di| 00001d50 73 74 61 6e 63 65 20 75 6e 69 74 73 20 66 72 6f |stance units fro| 00001d60 6d 20 74 68 65 20 6c 61 6d 70 2e 20 54 68 69 73 |m the lamp. This| 00001d70 0a 64 6f 65 73 20 6e 6f 74 20 68 61 76 65 20 74 |.does not have t| 00001d80 6f 20 62 65 20 65 78 61 63 74 2e 20 49 66 20 6f |o be exact. If o| 00001d90 62 6a 65 63 74 73 20 61 72 65 20 6e 65 61 72 65 |bjects are neare| 00001da0 72 20 74 68 61 6e 20 64 69 73 74 22 20 75 6e 69 |r than dist" uni| 00001db0 74 73 2c 20 74 68 65 79 20 77 69 6c 6c 0a 62 65 |ts, they will.be| 00001dc0 20 73 6f 20 62 72 69 67 68 74 20 74 68 61 74 20 | so bright that | 00001dd0 73 68 61 64 69 6e 67 20 77 69 6c 6c 20 6e 6f 74 |shading will not| 00001de0 20 74 61 6b 65 20 70 6c 61 63 65 2e 20 4f 62 6a | take place. Obj| 00001df0 65 63 74 73 20 76 65 72 79 20 66 61 72 20 61 77 |ects very far aw| 00001e00 61 79 20 77 69 6c 6c 20 62 65 0a 64 69 6d 6c 79 |ay will be.dimly| 00001e10 20 69 6c 6c 75 6d 69 6e 61 74 65 64 2e 0a 20 0a | illuminated.. .| 00001e20 20 42 79 20 74 68 65 20 77 61 79 2c 20 51 52 54 | By the way, QRT| 00001e30 20 64 69 73 74 61 6e 63 65 20 75 6e 69 74 73 20 | distance units | 00001e40 61 72 65 20 6e 6f 74 20 74 69 65 64 20 74 6f 20 |are not tied to | 00001e50 61 6e 79 20 72 65 61 6c 20 77 6f 72 6c 64 20 75 |any real world u| 00001e60 6e 69 74 2e 20 54 68 65 79 0a 63 61 6e 20 73 74 |nit. They.can st| 00001e70 61 6e 64 20 66 6f 72 20 66 65 65 74 2c 20 6e 61 |and for feet, na| 00001e80 75 74 69 63 61 6c 20 6d 69 6c 65 73 2c 20 6f 72 |utical miles, or| 00001e90 20 66 75 72 6c 6f 6e 67 73 2c 20 61 74 20 79 6f | furlongs, at yo| 00001ea0 75 72 20 63 68 6f 69 63 65 2e 0a 20 0a 0a 54 48 |ur choice.. ..TH| 00001eb0 45 20 4f 42 53 45 52 56 45 52 0a 20 0a 20 41 66 |E OBSERVER. . Af| 00001ec0 74 65 72 20 64 65 66 69 6e 69 6e 67 20 74 68 65 |ter defining the| 00001ed0 20 77 6f 72 6c 64 2c 20 79 6f 75 20 6d 75 73 74 | world, you must| 00001ee0 20 74 65 6c 6c 20 51 52 54 20 74 68 65 20 70 6f | tell QRT the po| 00001ef0 73 69 74 69 6f 6e 20 61 6e 64 20 6f 72 69 65 6e |sition and orien| 00001f00 74 61 74 69 6f 6e 20 6f 66 0a 74 68 65 20 6f 62 |tation of.the ob| 00001f10 73 65 72 76 65 72 2e 20 54 68 69 73 20 69 73 20 |server. This is | 00001f20 64 6f 6e 65 20 61 73 20 66 6f 6c 6c 6f 77 73 3a |done as follows:| 00001f30 0a 20 0a 20 4f 42 53 45 52 56 45 52 20 28 20 6c |. . OBSERVER ( l| 00001f40 6f 63 20 3d 20 28 30 2c 20 31 30 2c 20 32 30 29 |oc = (0, 10, 20)| 00001f50 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 6c 6f |,. lo| 00001f60 6f 6b 61 74 20 3d 20 28 35 2c 20 35 2c 20 31 32 |okat = (5, 5, 12| 00001f70 30 29 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 |0),. | 00001f80 75 70 20 3d 20 28 30 2c 20 31 2c 20 30 29 0a 20 |up = (0, 1, 0). | 00001f90 20 20 20 20 20 20 20 20 20 29 0a 20 0a 20 54 68 | ). . Th| 00001fa0 65 20 78 2c 79 2c 20 61 6e 64 20 7a 20 61 72 65 |e x,y, and z are| 00001fb0 20 74 68 65 20 6c 6f 63 61 74 69 6f 6e 20 6f 66 | the location of| 00001fc0 20 74 68 65 20 6f 62 73 65 72 76 65 72 2e 20 54 | the observer. T| 00001fd0 68 65 20 22 6c 6f 6f 6b 61 74 22 20 76 61 72 69 |he "lookat" vari| 00001fe0 61 62 6c 65 73 0a 67 69 76 65 20 61 20 6c 6f 63 |ables.give a loc| 00001ff0 61 74 69 6f 6e 20 69 6e 20 73 70 61 63 65 20 74 |ation in space t| 00002000 68 61 74 20 74 68 65 20 6f 62 73 65 72 76 65 72 |hat the observer| 00002010 20 69 73 20 6c 6f 6f 6b 69 6e 67 20 61 74 2e 20 | is looking at. | 00002020 4d 6f 73 74 20 72 61 79 20 74 72 61 63 65 72 73 |Most ray tracers| 00002030 0a 72 65 71 75 69 72 65 20 79 6f 75 20 74 6f 20 |.require you to | 00002040 67 69 76 65 20 74 77 6f 20 61 6e 67 6c 65 73 20 |give two angles | 00002050 66 6f 72 20 74 68 65 20 6f 62 73 65 72 76 65 72 |for the observer| 00002060 73 20 76 69 65 77 20 64 69 72 65 63 74 69 6f 6e |s view direction| 00002070 2c 20 62 75 74 20 69 74 20 69 73 0a 4d 55 43 48 |, but it is.MUCH| 00002080 20 65 61 73 69 65 72 20 74 6f 20 6b 6e 6f 77 20 | easier to know | 00002090 74 68 65 20 6c 6f 63 61 74 69 6f 6e 20 6f 66 20 |the location of | 000020a0 61 6e 20 6f 62 6a 65 63 74 20 6f 72 20 70 6f 69 |an object or poi| 000020b0 6e 74 20 69 6e 20 73 70 61 63 65 20 79 6f 75 20 |nt in space you | 000020c0 77 69 73 68 20 74 68 65 0a 6f 62 73 65 72 76 65 |wish the.observe| 000020d0 72 20 74 6f 20 6c 6f 6f 6b 20 61 74 2e 20 54 68 |r to look at. Th| 000020e0 69 73 20 77 69 6c 6c 20 62 65 20 74 68 65 20 63 |is will be the c| 000020f0 65 6e 74 65 72 20 6f 66 20 79 6f 75 72 20 73 63 |enter of your sc| 00002100 65 6e 65 2e 0a 20 0a 20 54 68 65 20 22 75 70 22 |ene.. . The "up"| 00002110 20 76 61 72 69 61 62 6c 65 73 20 64 65 66 69 6e | variables defin| 00002120 65 20 77 68 69 63 68 20 64 69 72 65 63 74 69 6f |e which directio| 00002130 6e 20 69 73 20 75 70 2e 20 55 73 75 61 6c 6c 79 |n is up. Usually| 00002140 2c 20 79 6f 75 20 77 69 6c 6c 20 77 69 73 68 20 |, you will wish | 00002150 74 6f 0a 75 73 65 20 74 68 65 20 76 61 6c 75 65 |to.use the value| 00002160 73 20 67 69 76 65 6e 20 61 62 6f 76 65 2e 20 51 |s given above. Q| 00002170 52 54 20 75 73 65 73 20 61 20 72 69 67 68 74 20 |RT uses a right | 00002180 68 61 6e 64 20 63 6f 6f 72 64 69 6e 61 74 65 20 |hand coordinate | 00002190 73 79 73 74 65 6d 3a 0a 70 6f 73 69 74 69 76 65 |system:.positive| 000021a0 20 79 20 69 73 20 75 70 2c 20 70 6f 73 69 74 69 | y is up, positi| 000021b0 76 65 20 7a 20 69 73 20 6f 75 74 20 6f 66 20 74 |ve z is out of t| 000021c0 68 65 20 73 63 72 65 65 6e 2c 20 61 6e 64 20 70 |he screen, and p| 000021d0 6f 73 69 74 69 76 65 20 78 20 69 73 20 74 6f 20 |ositive x is to | 000021e0 74 68 65 0a 72 69 67 68 74 20 69 66 20 79 6f 75 |the.right if you| 000021f0 20 61 72 65 20 6c 6f 6f 6b 69 6e 67 20 69 6e 20 | are looking in | 00002200 74 68 65 20 6e 65 67 61 74 69 76 65 20 7a 20 64 |the negative z d| 00002210 69 72 65 63 74 69 6f 6e 2e 20 54 68 65 20 22 75 |irection. The "u| 00002220 70 22 20 70 61 72 61 6d 65 74 65 72 20 69 73 0a |p" parameter is.| 00002230 6f 70 74 69 6f 6e 61 6c 2c 20 61 6e 64 20 69 66 |optional, and if| 00002240 20 6f 6d 69 74 74 65 64 2c 20 64 65 66 61 75 6c | omitted, defaul| 00002250 74 73 20 74 6f 20 28 30 2c 31 2c 30 29 2e 0a 20 |ts to (0,1,0).. | 00002260 0a 20 51 52 54 20 77 69 6c 6c 20 67 65 6e 65 72 |. QRT will gener| 00002270 61 74 65 20 61 6e 20 65 72 72 6f 72 20 6d 65 73 |ate an error mes| 00002280 73 61 67 65 20 69 66 20 6e 6f 20 6f 62 73 65 72 |sage if no obser| 00002290 76 65 72 20 69 73 20 64 65 66 69 6e 65 64 2e 0a |ver is defined..| 000022a0 20 0a 0a 4f 55 54 50 55 54 20 46 49 4c 45 4e 41 | ..OUTPUT FILENA| 000022b0 4d 45 0a 20 0a 20 51 52 54 20 70 6c 61 63 65 73 |ME. . QRT places| 000022c0 20 69 74 73 20 6f 75 74 70 75 74 20 69 6e 20 61 | its output in a| 000022d0 20 66 69 6c 65 2c 20 73 6f 20 79 6f 75 20 6d 75 | file, so you mu| 000022e0 73 74 20 67 69 76 65 20 69 74 20 74 68 65 20 6e |st give it the n| 000022f0 61 6d 65 20 6f 66 20 74 68 69 73 20 66 69 6c 65 |ame of this file| 00002300 3a 0a 20 0a 20 46 49 4c 45 5f 4e 41 4d 45 20 3d |:. . FILE_NAME =| 00002310 20 6f 75 74 66 69 6c 65 2e 74 6d 70 0a 20 0a 20 | outfile.tmp. . | 00002320 54 68 69 73 20 66 69 6c 65 20 6d 75 73 74 20 6f |This file must o| 00002330 62 73 65 72 76 65 20 61 6e 79 20 66 69 6c 65 20 |bserve any file | 00002340 6e 61 6d 69 6e 67 20 72 65 73 74 72 69 63 74 69 |naming restricti| 00002350 6f 6e 73 20 6f 66 20 74 68 65 20 6f 70 65 72 61 |ons of the opera| 00002360 74 69 6e 67 20 73 79 73 74 65 6d 0a 61 6e 64 20 |ting system.and | 00002370 63 6f 6d 70 75 74 65 72 20 79 6f 75 20 61 72 65 |computer you are| 00002380 20 75 73 69 6e 67 2e 20 53 65 65 20 74 68 65 20 | using. See the | 00002390 4d 61 63 68 69 6e 65 20 44 65 70 65 6e 64 65 6e |Machine Dependen| 000023a0 74 20 49 6e 66 6f 72 6d 61 74 69 6f 6e 20 73 65 |t Information se| 000023b0 63 74 69 6f 6e 20 6f 66 0a 74 68 69 73 20 6d 61 |ction of.this ma| 000023c0 6e 75 61 6c 20 66 6f 72 20 69 6e 66 6f 72 6d 61 |nual for informa| 000023d0 74 69 6f 6e 20 6f 6e 20 66 69 6c 65 20 6e 61 6d |tion on file nam| 000023e0 69 6e 67 20 72 65 73 74 72 69 63 74 69 6f 6e 73 |ing restrictions| 000023f0 2e 0a 20 0a 20 0a 20 46 4f 43 41 4c 20 4c 45 4e |.. . . FOCAL LEN| 00002400 47 54 48 0a 20 0a 20 54 68 69 73 20 69 73 20 74 |GTH. . This is t| 00002410 68 65 20 66 6f 63 61 6c 20 6c 65 6e 67 74 68 20 |he focal length | 00002420 6f 66 20 74 68 65 20 22 6c 65 6e 73 22 20 75 73 |of the "lens" us| 00002430 65 64 20 62 79 20 74 68 65 20 6f 62 73 65 72 76 |ed by the observ| 00002440 65 72 2e 20 54 68 69 6e 6b 20 6f 66 20 69 74 20 |er. Think of it | 00002450 61 73 0a 61 20 33 35 6d 6d 20 63 61 6d 65 72 61 |as.a 35mm camera| 00002460 20 6c 65 6e 73 20 2d 20 68 69 67 68 65 72 20 6e | lens - higher n| 00002470 75 6d 62 65 72 73 20 70 72 6f 64 75 63 65 20 61 |umbers produce a| 00002480 20 74 65 6c 65 70 68 6f 74 6f 20 65 66 66 65 63 | telephoto effec| 00002490 74 2c 20 61 6e 64 20 73 6d 61 6c 6c 65 72 0a 6e |t, and smaller.n| 000024a0 75 6d 62 65 72 73 20 61 72 65 20 66 6f 72 20 77 |umbers are for w| 000024b0 69 64 65 20 61 6e 67 6c 65 20 6c 65 6e 73 65 73 |ide angle lenses| 000024c0 2e 20 4e 6f 74 65 20 74 68 61 74 20 73 6d 61 6c |. Note that smal| 000024d0 6c 20 6e 75 6d 62 65 72 73 20 6d 61 79 20 70 72 |l numbers may pr| 000024e0 6f 64 75 63 65 20 73 6f 6d 65 0a 64 69 73 74 6f |oduce some.disto| 000024f0 72 74 69 6f 6e 20 6f 66 20 74 68 65 20 69 6d 61 |rtion of the ima| 00002500 67 65 20 61 72 6f 75 6e 64 20 74 68 65 20 65 64 |ge around the ed| 00002510 67 65 73 2e 0a 20 0a 20 46 4f 43 5f 4c 45 4e 47 |ges.. . FOC_LENG| 00002520 54 48 20 3d 20 36 30 0a 20 0a 0a 53 4b 59 20 41 |TH = 60. ..SKY A| 00002530 4e 44 20 47 52 4f 55 4e 44 0a 20 0a 20 51 52 54 |ND GROUND. . QRT| 00002540 20 68 61 73 20 66 61 63 69 6c 69 74 69 65 73 20 | has facilities | 00002550 66 6f 72 20 67 65 6e 65 72 61 74 69 6e 67 20 74 |for generating t| 00002560 68 65 20 73 6b 79 20 61 6e 64 20 67 72 6f 75 6e |he sky and groun| 00002570 64 2e 20 54 6f 20 64 65 66 69 6e 65 20 74 68 65 |d. To define the| 00002580 20 73 6b 79 2c 0a 79 6f 75 20 6d 75 73 74 20 67 | sky,.you must g| 00002590 69 76 65 20 69 74 20 74 77 6f 20 63 6f 6c 6f 72 |ive it two color| 000025a0 73 20 2d 20 6f 6e 65 20 66 6f 72 20 74 68 65 20 |s - one for the | 000025b0 73 6b 79 20 6f 76 65 72 68 65 61 64 20 28 7a 65 |sky overhead (ze| 000025c0 6e 69 74 68 29 2c 20 61 6e 64 20 6f 6e 65 20 66 |nith), and one f| 000025d0 6f 72 0a 74 68 65 20 68 6f 72 69 7a 6f 6e 3a 0a |or.the horizon:.| 000025e0 20 0a 20 53 4b 59 20 28 20 7a 65 6e 69 74 68 20 | . SKY ( zenith | 000025f0 3d 20 28 2e 31 30 2c 20 2e 32 2c 20 2e 34 29 2c |= (.10, .2, .4),| 00002600 0a 20 20 20 20 20 20 20 68 6f 72 69 7a 20 3d 20 |. horiz = | 00002610 28 2e 31 30 2c 20 2e 32 2c 20 2e 36 35 29 2c 0a |(.10, .2, .65),.| 00002620 20 20 20 20 20 20 20 64 69 74 68 65 72 20 3d 20 | dither = | 00002630 36 0a 20 20 20 20 20 29 0a 20 0a 20 54 68 69 73 |6. ). . This| 00002640 20 77 69 6c 6c 20 70 72 6f 64 75 63 65 20 61 20 | will produce a | 00002650 62 6c 75 65 20 73 6b 79 2c 20 77 69 74 68 20 61 |blue sky, with a| 00002660 20 62 72 69 67 68 74 65 72 20 63 6f 6c 6f 72 20 | brighter color | 00002670 6e 65 61 72 20 74 68 65 20 68 6f 72 69 7a 6f 6e |near the horizon| 00002680 2e 20 28 54 68 65 0a 73 6b 79 20 6e 65 65 64 20 |. (The.sky need | 00002690 6e 6f 74 20 62 65 20 62 6c 75 65 20 2d 20 69 74 |not be blue - it| 000026a0 20 63 6f 75 6c 64 20 62 65 20 72 65 64 20 6f 72 | could be red or| 000026b0 20 68 6f 74 20 70 69 6e 6b 2c 20 6f 72 20 76 61 | hot pink, or va| 000026c0 72 79 20 66 72 6f 6d 20 72 65 64 20 74 6f 0a 67 |ry from red to.g| 000026d0 72 65 65 6e 29 2e 20 51 52 54 20 77 69 6c 6c 20 |reen). QRT will | 000026e0 73 6d 6f 6f 74 68 6c 79 20 62 6c 65 6e 64 20 74 |smoothly blend t| 000026f0 68 65 20 63 6f 6c 6f 72 73 20 66 72 6f 6d 20 74 |he colors from t| 00002700 68 65 20 7a 65 6e 69 74 68 20 74 6f 20 74 68 65 |he zenith to the| 00002710 20 68 6f 72 69 7a 6f 6e 2e 0a 53 69 6e 63 65 20 | horizon..Since | 00002720 74 68 65 20 73 6b 79 20 69 73 20 73 6f 20 6c 61 |the sky is so la| 00002730 72 67 65 2c 20 79 6f 75 20 6d 61 79 20 77 61 6e |rge, you may wan| 00002740 74 20 74 6f 20 73 70 65 63 69 66 79 20 61 20 67 |t to specify a g| 00002750 72 65 61 74 65 72 20 61 6d 6f 75 6e 74 20 6f 66 |reater amount of| 00002760 0a 64 69 74 68 65 72 69 6e 67 20 74 6f 20 63 6f |.dithering to co| 00002770 6d 70 65 6e 73 61 74 65 20 66 6f 72 20 74 68 65 |mpensate for the| 00002780 20 64 69 73 70 6c 61 79 73 20 63 6f 6c 6f 72 20 | displays color | 00002790 72 65 73 6f 6c 75 74 69 6f 6e 20 6c 69 6d 69 74 |resolution limit| 000027a0 2e 0a 20 0a 20 54 68 65 20 53 4b 59 20 73 74 72 |.. . The SKY str| 000027b0 75 63 74 75 72 65 20 77 69 6c 6c 20 61 6c 73 6f |ucture will also| 000027c0 20 70 72 6f 64 75 63 65 20 73 6b 79 20 63 6f 6c | produce sky col| 000027d0 6f 72 73 20 62 65 6c 6f 77 20 74 68 65 20 68 6f |ors below the ho| 000027e0 72 69 7a 6f 6e 3b 20 61 6e 79 20 72 61 79 0a 74 |rizon; any ray.t| 000027f0 68 61 74 20 64 6f 65 73 20 6e 6f 74 20 73 74 72 |hat does not str| 00002800 69 6b 65 20 61 6e 20 6f 62 6a 65 63 74 20 77 69 |ike an object wi| 00002810 6c 6c 20 73 74 72 69 6b 65 20 74 68 65 20 53 4b |ll strike the SK| 00002820 59 2e 20 54 6f 20 66 69 78 20 74 68 69 73 2c 20 |Y. To fix this, | 00002830 64 65 66 69 6e 65 20 61 0a 67 72 6f 75 6e 64 2e |define a.ground.| 00002840 20 54 68 65 72 65 20 69 73 20 6e 6f 20 64 65 64 | There is no ded| 00002850 69 63 61 74 65 64 20 47 52 4f 55 4e 44 20 63 6f |icated GROUND co| 00002860 6d 6d 61 6e 64 2c 20 73 69 6e 63 65 20 79 6f 75 |mmand, since you| 00002870 20 63 61 6e 20 64 65 66 69 6e 65 20 61 20 76 65 | can define a ve| 00002880 72 79 0a 6c 61 72 67 65 20 70 61 72 61 6c 6c 65 |ry.large paralle| 00002890 6c 6f 67 72 61 6d 20 77 69 74 68 20 74 68 65 20 |logram with the | 000028a0 73 61 6d 65 20 65 66 66 65 63 74 2e 20 59 6f 75 |same effect. You| 000028b0 20 63 61 6e 20 6d 61 6b 65 20 69 74 20 62 72 6f | can make it bro| 000028c0 77 6e 20 77 69 74 68 20 70 61 74 63 68 65 73 0a |wn with patches.| 000028d0 6f 66 20 67 72 65 65 6e 20 75 73 69 6e 67 20 61 |of green using a| 000028e0 20 50 41 54 54 45 52 4e 2c 20 6f 72 20 63 68 65 | PATTERN, or che| 000028f0 63 6b 65 72 65 64 20 67 72 65 65 6e 20 61 6e 64 |ckered green and| 00002900 20 79 65 6c 6c 6f 77 20 69 6e 20 74 68 65 20 63 | yellow in the c| 00002910 6c 61 73 73 69 63 0a 72 61 79 2d 74 72 61 63 69 |lassic.ray-traci| 00002920 6e 67 20 67 72 6f 75 6e 64 20 70 61 74 74 65 72 |ng ground patter| 00002930 6e 2e 20 41 20 76 65 72 79 20 6c 61 72 67 65 20 |n. A very large | 00002940 73 70 68 65 72 65 20 63 61 6e 20 61 6c 73 6f 20 |sphere can also | 00002950 62 65 20 75 73 65 64 20 66 6f 72 20 74 68 65 0a |be used for the.| 00002960 67 72 6f 75 6e 64 2c 20 77 68 69 63 68 20 79 69 |ground, which yi| 00002970 65 6c 64 73 20 62 65 74 74 65 72 20 72 65 73 75 |elds better resu| 00002980 6c 74 73 20 77 69 74 68 20 6d 69 72 72 6f 72 65 |lts with mirrore| 00002990 64 20 6f 62 6a 65 63 74 73 2e 0a 20 0a 0a 42 4f |d objects.. ..BO| 000029a0 55 4e 44 49 4e 47 20 42 4f 58 45 53 0a 0a 20 51 |UNDING BOXES.. Q| 000029b0 52 54 20 73 75 70 70 6f 72 74 73 20 74 68 65 20 |RT supports the | 000029c0 75 73 65 20 6f 66 20 62 6f 75 6e 64 69 6e 67 20 |use of bounding | 000029d0 62 6f 78 65 73 20 74 6f 20 73 70 65 65 64 20 74 |boxes to speed t| 000029e0 68 65 20 72 61 79 20 74 72 61 63 69 6e 67 20 70 |he ray tracing p| 000029f0 72 6f 63 65 73 73 2e 0a 46 6f 72 20 69 6d 61 67 |rocess..For imag| 00002a00 65 73 20 63 6f 6d 70 6f 73 65 64 20 6f 66 20 6f |es composed of o| 00002a10 6e 6c 79 20 61 20 66 65 77 20 28 31 20 74 6f 20 |nly a few (1 to | 00002a20 33 29 20 6f 62 6a 65 63 74 73 2c 20 62 6f 75 6e |3) objects, boun| 00002a30 64 69 6e 67 20 62 6f 78 65 73 20 77 69 6c 6c 20 |ding boxes will | 00002a40 6e 6f 74 0a 64 6f 20 6d 75 63 68 20 74 6f 20 69 |not.do much to i| 00002a50 6e 63 72 65 61 73 65 20 73 70 65 65 64 2e 20 48 |ncrease speed. H| 00002a60 6f 77 65 76 65 72 2c 20 66 6f 72 20 69 6d 61 67 |owever, for imag| 00002a70 65 73 20 77 68 65 72 65 20 74 68 65 72 65 20 61 |es where there a| 00002a80 72 65 20 67 72 6f 75 70 73 20 6f 66 0a 6f 62 6a |re groups of.obj| 00002a90 65 63 74 73 20 70 68 79 73 69 63 61 6c 6c 79 20 |ects physically | 00002aa0 63 6c 6f 73 65 20 74 6f 20 65 61 63 68 20 6f 74 |close to each ot| 00002ab0 68 65 72 2c 20 74 68 65 79 20 63 61 6e 20 67 72 |her, they can gr| 00002ac0 65 61 74 6c 79 20 72 65 64 75 63 65 20 65 78 65 |eatly reduce exe| 00002ad0 63 75 74 69 6f 6e 0a 74 69 6d 65 73 2e 20 41 20 |cution.times. A | 00002ae0 62 6f 75 6e 64 69 6e 67 20 62 6f 78 20 69 73 20 |bounding box is | 00002af0 61 20 63 6f 6e 63 65 70 74 75 61 6c 20 73 74 72 |a conceptual str| 00002b00 75 63 74 75 72 65 20 74 68 61 74 20 65 6e 63 6c |ucture that encl| 00002b10 6f 73 65 73 20 61 20 67 72 6f 75 70 20 6f 66 0a |oses a group of.| 00002b20 6f 62 6a 65 63 74 73 2e 20 57 68 65 6e 20 74 68 |objects. When th| 00002b30 65 20 72 61 79 20 74 72 61 63 65 72 20 69 73 20 |e ray tracer is | 00002b40 66 69 6e 64 69 6e 67 20 6c 69 6e 65 2f 6f 62 6a |finding line/obj| 00002b50 65 63 74 20 69 6e 74 65 72 73 65 63 74 69 6f 6e |ect intersection| 00002b60 73 2c 20 69 66 20 61 20 6c 69 6e 65 0a 64 6f 65 |s, if a line.doe| 00002b70 73 20 6e 6f 74 20 73 74 72 69 6b 65 20 61 20 62 |s not strike a b| 00002b80 6f 75 6e 64 69 6e 67 20 62 6f 78 2c 20 69 74 20 |ounding box, it | 00002b90 63 61 6e 6e 6f 74 20 70 6f 73 73 69 62 6c 79 20 |cannot possibly | 00002ba0 73 74 72 69 6b 65 20 61 6e 79 20 6f 62 6a 65 63 |strike any objec| 00002bb0 74 73 20 77 69 74 68 69 6e 0a 74 68 61 74 20 62 |ts within.that b| 00002bc0 6f 75 6e 64 69 6e 67 20 62 6f 78 2e 20 54 68 69 |ounding box. Thi| 00002bd0 73 20 73 61 76 65 73 20 74 68 65 20 72 61 79 20 |s saves the ray | 00002be0 74 72 61 63 65 72 20 74 68 65 20 74 72 6f 75 62 |tracer the troub| 00002bf0 6c 65 20 6f 66 20 63 68 65 63 6b 69 6e 67 0a 69 |le of checking.i| 00002c00 6e 74 65 72 73 65 63 74 69 6f 6e 73 20 77 69 74 |ntersections wit| 00002c10 68 20 61 6c 6c 20 6f 62 6a 65 63 74 73 20 77 69 |h all objects wi| 00002c20 74 68 69 6e 20 74 68 65 20 62 6f 78 2e 20 49 6e |thin the box. In| 00002c30 20 74 68 65 20 63 61 73 65 20 77 68 65 72 65 20 | the case where | 00002c40 74 68 65 20 72 61 79 0a 44 4f 45 53 20 65 6e 74 |the ray.DOES ent| 00002c50 65 72 20 74 68 65 20 62 6f 78 2c 20 73 6f 6d 65 |er the box, some| 00002c60 20 61 64 64 69 74 69 6f 6e 61 6c 20 6f 76 65 72 | additional over| 00002c70 68 65 61 64 20 69 73 20 69 6e 63 75 72 72 65 64 |head is incurred| 00002c80 3b 20 68 6f 77 65 76 65 72 2c 20 74 68 69 73 20 |; however, this | 00002c90 63 6f 73 74 0a 69 73 20 65 61 73 69 6c 79 20 6a |cost.is easily j| 00002ca0 75 73 74 69 66 69 65 64 20 62 79 20 72 65 64 75 |ustified by redu| 00002cb0 63 65 64 20 74 69 6d 65 73 20 66 6f 72 20 6e 65 |ced times for ne| 00002cc0 67 61 74 69 76 65 20 74 65 73 74 73 2e 0a 20 0a |gative tests.. .| 00002cd0 20 42 6f 75 6e 64 69 6e 67 20 62 6f 78 65 73 20 | Bounding boxes | 00002ce0 63 61 6e 20 6f 63 63 61 73 69 6f 6e 61 6c 6c 79 |can occasionally| 00002cf0 20 62 65 20 75 73 65 66 75 6c 20 66 6f 72 20 63 | be useful for c| 00002d00 6f 6d 70 6c 65 78 20 6f 62 6a 65 63 74 73 2c 20 |omplex objects, | 00002d10 73 75 63 68 20 61 73 0a 71 75 61 64 72 61 74 69 |such as.quadrati| 00002d20 63 20 73 75 72 66 61 63 65 73 2c 20 77 68 65 6e |c surfaces, when| 00002d30 20 74 68 65 20 6f 62 6a 65 63 74 20 69 73 20 66 | the object is f| 00002d40 61 69 72 6c 79 20 73 6d 61 6c 6c 2e 20 53 69 6e |airly small. Sin| 00002d50 63 65 20 74 68 65 20 74 69 6d 65 20 74 6f 20 66 |ce the time to f| 00002d60 69 6e 64 0a 74 68 65 20 69 6e 74 65 72 73 65 63 |ind.the intersec| 00002d70 74 69 6f 6e 20 77 69 74 68 20 61 20 71 75 61 64 |tion with a quad| 00002d80 72 61 74 69 63 20 73 75 72 66 61 63 65 20 69 73 |ratic surface is| 00002d90 20 6c 61 72 67 65 2c 20 62 75 74 20 62 6f 75 6e | large, but boun| 00002da0 64 69 6e 67 20 62 6f 78 0a 69 6e 74 65 72 73 65 |ding box.interse| 00002db0 63 74 69 6f 6e 73 20 61 72 65 20 66 61 73 74 2c |ctions are fast,| 00002dc0 20 74 68 65 20 72 61 79 20 74 72 61 63 65 72 20 | the ray tracer | 00002dd0 63 61 6e 20 73 61 76 65 20 74 69 6d 65 20 66 6f |can save time fo| 00002de0 72 20 61 6c 6c 20 74 68 65 20 6e 65 67 61 74 69 |r all the negati| 00002df0 76 65 0a 74 65 73 74 73 2e 0a 20 0a 20 42 6f 75 |ve.tests.. . Bou| 00002e00 6e 64 69 6e 67 20 62 6f 78 65 73 20 63 61 6e 20 |nding boxes can | 00002e10 63 6f 6e 74 61 69 6e 20 6f 74 68 65 72 20 62 6f |contain other bo| 00002e20 75 6e 64 69 6e 67 20 62 6f 78 65 73 2c 20 69 6e |unding boxes, in| 00002e30 20 61 20 72 65 63 75 72 73 69 76 65 20 6d 61 6e | a recursive man| 00002e40 6e 65 72 2e 0a 54 68 69 73 20 72 65 63 75 72 73 |ner..This recurs| 00002e50 69 76 65 20 73 74 72 75 63 74 75 72 65 20 64 65 |ive structure de| 00002e60 66 69 6e 65 73 20 61 6e 20 22 6f 62 6a 65 63 74 |fines an "object| 00002e70 20 74 72 65 65 22 2e 20 54 68 65 72 65 20 61 72 | tree". There ar| 00002e80 65 20 74 77 6f 20 6b 65 79 77 6f 72 64 73 0a 74 |e two keywords.t| 00002e90 68 61 74 20 64 65 66 69 6e 65 20 74 68 65 20 62 |hat define the b| 00002ea0 65 67 69 6e 6e 69 6e 67 20 61 6e 64 20 65 6e 64 |eginning and end| 00002eb0 20 6f 66 20 61 20 62 6f 75 6e 64 69 6e 67 20 62 | of a bounding b| 00002ec0 6f 78 3a 20 42 45 47 49 4e 5f 42 42 4f 58 20 61 |ox: BEGIN_BBOX a| 00002ed0 6e 64 0a 45 4e 44 5f 42 42 4f 58 2e 20 48 65 72 |nd.END_BBOX. Her| 00002ee0 65 20 69 73 20 61 6e 20 65 78 61 6d 70 6c 65 3a |e is an example:| 00002ef0 0a 20 0a 20 7b 20 2a 2a 20 51 52 54 20 43 6f 64 |. . { ** QRT Cod| 00002f00 65 20 66 6f 72 20 61 20 63 68 65 73 73 6d 61 6e |e for a chessman| 00002f10 20 2a 2a 20 7d 0a 20 0a 20 42 45 47 49 4e 5f 42 | ** }. . BEGIN_B| 00002f20 42 4f 58 0a 20 0a 20 20 20 51 55 41 44 52 41 54 |BOX. . QUADRAT| 00002f30 49 43 20 28 20 7b 20 2a 2a 20 71 75 61 64 72 20 |IC ( { ** quadr | 00002f40 64 65 66 6e 20 2a 2a 20 7d 0a 20 20 20 20 20 20 |defn ** }. | 00002f50 20 20 20 20 20 20 20 29 0a 20 0a 20 20 20 51 55 | ). . QU| 00002f60 41 44 52 41 54 49 43 20 28 20 7b 20 2a 2a 20 71 |ADRATIC ( { ** q| 00002f70 75 61 64 72 20 64 65 66 6e 20 32 20 2a 2a 20 7d |uadr defn 2 ** }| 00002f80 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 29 0a |. ).| 00002f90 20 0a 20 20 20 53 50 48 45 52 45 20 28 20 7b 20 | . SPHERE ( { | 00002fa0 2a 2a 20 73 70 68 65 72 65 20 64 65 66 6e 20 2a |** sphere defn *| 00002fb0 2a 20 7d 0a 20 20 20 20 20 20 20 20 20 20 29 0a |* }. ).| 00002fc0 20 0a 20 20 20 42 45 47 49 4e 5f 42 42 4f 58 0a | . BEGIN_BBOX.| 00002fd0 20 0a 20 20 20 20 20 53 50 48 45 52 45 20 28 20 | . SPHERE ( | 00002fe0 29 20 7b 20 2a 2a 20 74 77 6f 20 73 70 68 65 72 |) { ** two spher| 00002ff0 65 73 20 2a 2a 20 7d 0a 20 20 20 20 20 53 50 48 |es ** }. SPH| 00003000 45 52 45 20 28 20 29 0a 20 0a 20 20 20 45 4e 44 |ERE ( ). . END| 00003010 5f 42 42 4f 58 0a 20 0a 20 45 4e 44 5f 42 42 4f |_BBOX. . END_BBO| 00003020 58 0a 0a 0a 20 54 68 69 73 20 73 74 72 75 63 74 |X... This struct| 00003030 75 72 65 20 6d 61 79 20 62 65 20 6e 65 73 74 65 |ure may be neste| 00003040 64 20 74 6f 20 61 6e 20 61 72 62 69 74 72 61 72 |d to an arbitrar| 00003050 79 20 6c 65 76 65 6c 3b 20 69 66 20 79 6f 75 20 |y level; if you | 00003060 68 61 64 20 61 20 63 6c 6f 73 65 6c 79 0a 73 70 |had a closely.sp| 00003070 61 63 65 64 20 67 72 6f 75 70 20 6f 66 20 63 68 |aced group of ch| 00003080 65 73 73 6d 65 6e 2c 20 79 6f 75 20 63 6f 75 6c |essmen, you coul| 00003090 64 20 65 6e 63 6c 6f 73 65 20 61 6c 6c 20 6f 66 |d enclose all of| 000030a0 20 74 68 65 6d 20 77 69 74 68 20 61 20 62 6f 75 | them with a bou| 000030b0 6e 64 69 6e 67 20 62 6f 78 2e 0a 20 0a 20 54 68 |nding box.. . Th| 000030c0 65 72 65 20 69 73 20 6e 6f 20 73 69 6d 70 6c 65 |ere is no simple| 000030d0 20 61 6c 67 6f 72 69 74 68 6d 20 66 6f 72 20 6b | algorithm for k| 000030e0 6e 6f 77 69 6e 67 20 65 78 61 63 74 6c 79 20 77 |nowing exactly w| 000030f0 68 65 72 65 20 74 6f 20 70 6c 61 63 65 20 62 6f |here to place bo| 00003100 75 6e 64 69 6e 67 0a 62 6f 78 65 73 2e 20 59 6f |unding.boxes. Yo| 00003110 75 20 68 61 76 65 20 74 6f 20 75 73 65 20 63 6f |u have to use co| 00003120 6d 6d 6f 6e 20 73 65 6e 73 65 2e 20 54 79 70 69 |mmon sense. Typi| 00003130 63 61 6c 6c 79 2c 20 62 6f 75 6e 64 69 6e 67 20 |cally, bounding | 00003140 62 6f 78 65 73 20 64 6f 20 74 68 65 20 6d 6f 73 |boxes do the mos| 00003150 74 0a 67 6f 6f 64 20 66 6f 72 20 63 6c 6f 73 65 |t.good for close| 00003160 6c 79 20 73 70 61 63 65 64 20 6f 62 6a 65 63 74 |ly spaced object| 00003170 73 2c 20 62 75 74 20 69 66 20 74 68 65 20 65 6e |s, but if the en| 00003180 74 69 72 65 20 67 72 6f 75 70 20 6f 66 20 6f 62 |tire group of ob| 00003190 6a 65 63 74 73 20 69 73 20 6c 65 73 73 0a 74 68 |jects is less.th| 000031a0 61 6e 20 61 20 74 68 69 72 64 20 6f 66 20 74 68 |an a third of th| 000031b0 65 20 69 6d 61 67 65 20 61 72 65 61 2c 20 69 74 |e image area, it| 000031c0 20 77 69 6c 6c 20 62 65 20 75 73 65 66 75 6c 20 | will be useful | 000031d0 74 6f 20 65 6e 63 6c 6f 73 65 20 74 68 65 6d 20 |to enclose them | 000031e0 61 6c 6c 20 69 6e 20 61 0a 62 6f 75 6e 64 69 6e |all in a.boundin| 000031f0 67 20 62 6f 78 2e 0a 20 0a 0a 50 41 54 54 45 52 |g box.. ..PATTER| 00003200 4e 53 0a 20 0a 20 51 52 54 20 70 65 72 6d 69 74 |NS. . QRT permit| 00003210 73 20 75 73 65 72 20 64 65 66 69 6e 65 64 20 70 |s user defined p| 00003220 61 74 74 65 72 6e 73 20 77 68 69 63 68 20 63 61 |atterns which ca| 00003230 6e 20 62 65 20 6d 61 70 70 65 64 20 74 6f 20 74 |n be mapped to t| 00003240 68 65 20 73 75 72 66 61 63 65 20 6f 66 20 61 6e |he surface of an| 00003250 79 0a 6f 62 6a 65 63 74 2e 20 41 20 70 61 74 74 |y.object. A patt| 00003260 65 72 6e 20 69 73 20 62 61 73 69 63 61 6c 6c 79 |ern is basically| 00003270 20 61 6e 20 6f 72 67 61 6e 69 7a 65 64 20 6d 65 | an organized me| 00003280 74 68 6f 64 20 66 6f 72 20 63 68 61 6e 67 69 6e |thod for changin| 00003290 67 20 61 6e 20 6f 62 6a 65 63 74 27 73 0a 43 4f |g an object's.CO| 000032a0 4c 4f 52 49 4e 46 4f 20 6f 76 65 72 20 74 68 65 |LORINFO over the| 000032b0 20 73 75 72 66 61 63 65 20 6f 66 20 74 68 61 74 | surface of that| 000032c0 20 6f 62 6a 65 63 74 2e 20 46 6f 72 20 65 78 61 | object. For exa| 000032d0 6d 70 6c 65 2c 20 61 20 63 68 65 63 6b 65 72 65 |mple, a checkere| 000032e0 64 20 73 75 72 66 61 63 65 0a 63 61 6e 20 62 65 |d surface.can be| 000032f0 20 63 72 65 61 74 65 64 2c 20 6f 72 20 61 20 73 | created, or a s| 00003300 75 72 66 61 63 65 20 67 69 76 65 6e 20 74 68 65 |urface given the| 00003310 20 61 70 70 65 61 72 61 6e 63 65 20 6f 66 20 62 | appearance of b| 00003320 72 69 63 6b 20 6f 72 20 74 69 6c 65 2e 20 54 68 |rick or tile. Th| 00003330 65 0a 63 75 72 72 65 6e 74 20 70 61 74 74 65 72 |e.current patter| 00003340 6e 69 6e 67 20 69 6e 20 51 52 54 20 69 73 20 6c |ning in QRT is l| 00003350 69 6d 69 74 65 64 2c 20 79 65 74 20 70 6f 77 65 |imited, yet powe| 00003360 72 66 75 6c 20 65 6e 6f 75 67 68 20 74 6f 20 64 |rful enough to d| 00003370 65 73 63 72 69 62 65 20 6d 61 6e 79 0a 63 6f 6d |escribe many.com| 00003380 6d 6f 6e 20 70 61 74 74 65 72 6e 73 2e 0a 20 0a |mon patterns.. .| 00003390 20 41 20 70 61 74 74 65 72 6e 20 69 73 20 63 6f | A pattern is co| 000033a0 6d 70 6f 73 65 64 20 6f 66 20 61 20 73 65 72 69 |mposed of a seri| 000033b0 65 73 20 6f 66 20 73 75 62 2d 70 61 74 74 65 72 |es of sub-patter| 000033c0 6e 73 2e 20 45 61 63 68 20 73 75 62 2d 70 61 74 |ns. Each sub-pat| 000033d0 74 65 72 6e 20 64 65 66 69 6e 65 73 0a 61 20 72 |tern defines.a r| 000033e0 65 67 69 6f 6e 20 6f 6e 20 74 68 65 20 73 75 72 |egion on the sur| 000033f0 66 61 63 65 20 6f 66 20 61 6e 20 6f 62 6a 65 63 |face of an objec| 00003400 74 20 77 68 69 63 68 20 77 69 6c 6c 20 63 6f 6e |t which will con| 00003410 74 61 69 6e 20 61 20 67 69 76 65 6e 20 43 4f 4c |tain a given COL| 00003420 4f 52 49 4e 46 4f 2e 0a 54 68 65 73 65 20 72 65 |ORINFO..These re| 00003430 67 69 6f 6e 73 20 61 72 65 20 70 72 65 73 65 6e |gions are presen| 00003440 74 6c 79 20 6c 69 6d 69 74 65 64 20 74 6f 20 72 |tly limited to r| 00003450 65 63 74 61 6e 67 6c 65 73 2c 20 62 75 74 20 74 |ectangles, but t| 00003460 68 69 73 20 6d 61 79 20 62 65 20 65 78 70 61 6e |his may be expan| 00003470 64 65 64 0a 69 6e 20 61 20 66 75 74 75 72 65 20 |ded.in a future | 00003480 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 20 6f |implementation o| 00003490 66 20 51 52 54 2e 0a 20 0a 20 41 20 70 61 74 74 |f QRT.. . A patt| 000034a0 65 72 6e 20 63 61 6e 20 62 65 20 64 65 66 69 6e |ern can be defin| 000034b0 65 64 20 6f 6e 63 65 2c 20 61 6e 64 20 75 73 65 |ed once, and use| 000034c0 64 20 66 6f 72 20 6d 61 6e 79 20 6f 62 6a 65 63 |d for many objec| 000034d0 74 73 2e 20 46 6f 72 20 65 78 61 6d 70 6c 65 2c |ts. For example,| 000034e0 20 61 0a 62 72 69 63 6b 20 70 61 74 74 65 72 6e | a.brick pattern| 000034f0 20 6d 69 67 68 74 20 62 65 20 64 65 66 69 6e 65 | might be define| 00003500 64 3a 0a 20 0a 20 0a 20 50 41 54 54 45 52 4e 20 |d:. . . PATTERN | 00003510 28 20 6e 61 6d 65 20 3d 20 42 52 49 43 4b 2c 0a |( name = BRICK,.| 00003520 20 20 20 20 20 20 20 20 20 20 20 7b 20 2a 2a 20 | { ** | 00003530 6f 74 68 65 72 20 70 61 74 74 65 72 6e 20 69 6e |other pattern in| 00003540 66 6f 20 68 65 72 65 20 2a 2a 20 7d 0a 20 20 20 |fo here ** }. | 00003550 20 20 20 20 20 20 29 0a 20 0a 20 53 50 48 45 52 | ). . SPHER| 00003560 45 20 28 20 7b 20 2a 2a 20 73 70 68 65 72 65 20 |E ( { ** sphere | 00003570 64 65 66 69 6e 69 74 69 6f 6e 20 2a 2a 20 7d 0a |definition ** }.| 00003580 20 20 20 20 20 20 20 20 20 20 70 61 74 74 65 72 | patter| 00003590 6e 20 3d 20 42 52 49 43 4b 0a 20 20 20 20 20 20 |n = BRICK. | 000035a0 20 20 29 0a 20 0a 20 50 41 52 41 4c 4c 45 4c 4f | ). . PARALLELO| 000035b0 47 52 41 4d 20 28 20 7b 20 2a 2a 20 70 61 72 61 |GRAM ( { ** para| 000035c0 6c 6c 65 6c 6f 67 72 61 6d 20 64 65 66 69 6e 69 |llelogram defini| 000035d0 74 69 6f 6e 20 2a 2a 20 7d 0a 20 20 20 20 20 20 |tion ** }. | 000035e0 20 20 20 20 20 20 20 20 20 20 20 70 61 74 74 65 | patte| 000035f0 72 6e 20 3d 20 42 52 49 43 4b 0a 20 20 20 20 20 |rn = BRICK. | 00003600 20 20 20 20 20 20 20 20 20 20 29 0a 20 0a 20 54 | ). . T| 00003610 68 69 73 20 65 78 61 6d 70 6c 65 20 69 67 6e 6f |his example igno| 00003620 72 65 73 20 77 68 61 74 20 69 73 20 61 63 74 75 |res what is actu| 00003630 61 6c 6c 79 20 69 6e 20 74 68 65 20 70 61 74 74 |ally in the patt| 00003640 65 72 6e 20 64 65 66 69 6e 69 74 69 6f 6e 20 74 |ern definition t| 00003650 6f 0a 64 65 6d 6f 6e 73 74 72 61 74 65 20 68 6f |o.demonstrate ho| 00003660 77 20 70 61 74 74 65 72 6e 73 20 61 72 65 20 61 |w patterns are a| 00003670 74 74 61 63 68 65 64 20 74 6f 20 6f 62 6a 65 63 |ttached to objec| 00003680 74 73 2e 20 41 20 70 61 74 74 65 72 6e 20 6d 75 |ts. A pattern mu| 00003690 73 74 20 62 65 20 64 65 66 69 6e 65 64 0a 62 65 |st be defined.be| 000036a0 66 6f 72 65 20 69 74 20 63 61 6e 20 62 65 20 75 |fore it can be u| 000036b0 73 65 64 2e 20 49 74 20 69 73 20 67 69 76 65 6e |sed. It is given| 000036c0 20 61 20 6e 61 6d 65 2c 20 73 75 63 68 20 61 73 | a name, such as| 000036d0 20 42 52 49 43 4b 2c 20 61 6e 64 20 61 6e 79 20 | BRICK, and any | 000036e0 6f 62 6a 65 63 74 20 63 61 6e 0a 73 70 65 63 69 |object can.speci| 000036f0 66 79 20 74 68 69 73 20 70 61 74 74 65 72 6e 20 |fy this pattern | 00003700 77 69 74 68 20 22 50 41 54 54 45 52 4e 20 3d 20 |with "PATTERN = | 00003710 42 52 49 43 4b 22 2e 20 54 68 65 72 65 20 61 72 |BRICK". There ar| 00003720 65 20 6e 6f 20 70 72 61 63 74 69 63 61 6c 0a 72 |e no practical.r| 00003730 65 73 74 72 69 63 74 69 6f 6e 73 20 6f 6e 20 74 |estrictions on t| 00003740 68 65 20 6c 65 6e 67 74 68 20 6f 66 20 70 61 74 |he length of pat| 00003750 74 65 72 6e 20 6e 61 6d 65 73 20 28 69 66 20 79 |tern names (if y| 00003760 6f 75 72 20 63 6f 6d 70 75 74 65 72 20 68 61 73 |our computer has| 00003770 20 31 20 6d 65 67 61 62 79 74 65 0a 6f 66 20 72 | 1 megabyte.of r| 00003780 61 6d 2c 20 79 6f 75 20 63 61 6e 6e 6f 74 20 68 |am, you cannot h| 00003790 61 76 65 20 61 20 70 61 74 74 65 72 6e 20 6e 61 |ave a pattern na| 000037a0 6d 65 20 6c 6f 6e 67 65 72 20 74 68 61 6e 20 31 |me longer than 1| 000037b0 20 6d 69 6c 6c 69 6f 6e 20 63 68 61 72 61 63 74 | million charact| 000037c0 65 72 73 29 2e 0a 4d 75 6c 74 69 70 6c 65 20 70 |ers)..Multiple p| 000037d0 61 74 74 65 72 6e 73 20 6d 61 79 20 62 65 20 64 |atterns may be d| 000037e0 65 66 69 6e 65 64 20 61 74 20 74 68 65 20 74 6f |efined at the to| 000037f0 70 20 6f 66 20 61 6e 20 69 6e 70 75 74 20 66 69 |p of an input fi| 00003800 6c 65 2c 20 61 6e 64 20 75 73 65 64 20 66 6f 72 |le, and used for| 00003810 0a 61 6e 79 20 6f 62 6a 65 63 74 20 69 6e 20 74 |.any object in t| 00003820 68 65 20 66 69 6c 65 2e 0a 20 0a 20 57 68 61 74 |he file.. . What| 00003830 20 65 78 61 63 74 6c 79 20 6d 61 6b 65 73 20 75 | exactly makes u| 00003840 70 20 61 20 70 61 74 74 65 72 6e 2c 20 79 6f 75 |p a pattern, you| 00003850 20 61 73 6b 3f 20 41 20 70 61 74 74 65 72 6e 20 | ask? A pattern | 00003860 63 61 6e 20 62 65 20 76 69 65 77 65 64 20 61 73 |can be viewed as| 00003870 20 61 0a 72 65 63 74 61 6e 67 6c 65 20 74 68 61 | a.rectangle tha| 00003880 74 20 69 73 20 72 65 70 65 61 74 65 64 20 6f 76 |t is repeated ov| 00003890 65 72 20 74 68 65 20 73 75 72 66 61 63 65 20 6f |er the surface o| 000038a0 66 20 61 6e 20 6f 62 6a 65 63 74 2e 20 49 66 20 |f an object. If | 000038b0 74 68 65 20 70 61 74 74 65 72 6e 0a 73 69 7a 65 |the pattern.size| 000038c0 20 69 73 20 31 30 20 78 20 31 30 2c 20 61 6e 64 | is 10 x 10, and| 000038d0 20 79 6f 75 20 68 61 76 65 20 61 6e 20 6f 62 6a | you have an obj| 000038e0 65 63 74 20 28 73 61 79 20 61 20 70 61 72 61 6c |ect (say a paral| 000038f0 6c 65 6c 6f 67 72 61 6d 29 20 74 68 61 74 20 69 |lelogram) that i| 00003900 73 20 35 30 20 78 0a 35 30 2c 20 74 68 65 20 70 |s 50 x.50, the p| 00003910 61 74 74 65 72 6e 20 77 69 6c 6c 20 72 65 70 65 |attern will repe| 00003920 61 74 20 35 20 74 69 6d 65 73 20 69 6e 20 65 61 |at 5 times in ea| 00003930 63 68 20 64 69 72 65 63 74 69 6f 6e 2e 20 57 69 |ch direction. Wi| 00003940 74 68 69 6e 20 74 68 69 73 20 72 65 70 65 61 74 |thin this repeat| 00003950 69 6e 67 0a 72 65 63 74 61 6e 67 6c 65 2c 20 73 |ing.rectangle, s| 00003960 75 62 20 70 61 74 74 65 72 6e 73 20 63 61 6e 20 |ub patterns can | 00003970 62 65 20 64 65 66 69 6e 65 64 2e 20 41 20 73 75 |be defined. A su| 00003980 62 2d 70 61 74 74 65 72 6e 20 69 73 20 61 20 72 |b-pattern is a r| 00003990 65 63 74 61 6e 67 6c 65 20 6f 72 0a 63 69 72 63 |ectangle or.circ| 000039a0 6c 65 20 77 69 74 68 69 6e 20 74 68 65 20 70 61 |le within the pa| 000039b0 74 74 65 72 6e 20 72 65 63 74 61 6e 67 6c 65 20 |ttern rectangle | 000039c0 77 69 74 68 20 61 20 63 65 72 74 61 69 6e 20 43 |with a certain C| 000039d0 4f 4c 4f 52 49 4e 46 4f 2e 20 41 6e 79 20 6e 75 |OLORINFO. Any nu| 000039e0 6d 62 65 72 20 6f 66 0a 74 68 65 73 65 20 73 75 |mber of.these su| 000039f0 62 2d 70 61 74 74 65 72 6e 73 20 63 61 6e 20 62 |b-patterns can b| 00003a00 65 20 63 72 65 61 74 65 64 20 77 69 74 68 69 6e |e created within| 00003a10 20 6f 6e 65 20 70 61 74 74 65 72 6e 20 64 65 66 | one pattern def| 00003a20 69 6e 69 74 69 6f 6e 2e 20 54 6f 20 63 72 65 61 |inition. To crea| 00003a30 74 65 20 61 0a 62 72 69 63 6b 20 77 61 6c 6c 2c |te a.brick wall,| 00003a40 20 79 6f 75 20 6d 69 67 68 74 20 64 65 66 69 6e | you might defin| 00003a50 65 20 73 65 76 65 72 61 6c 20 73 75 62 2d 70 61 |e several sub-pa| 00003a60 74 74 65 72 6e 73 2c 20 65 61 63 68 20 77 69 74 |tterns, each wit| 00003a70 68 20 61 20 73 6c 69 67 68 74 6c 79 0a 64 69 66 |h a slightly.dif| 00003a80 66 65 72 65 6e 74 20 63 6f 6c 6f 72 20 6f 66 20 |ferent color of | 00003a90 72 65 64 20 6f 72 20 62 72 6f 77 6e 2e 20 54 68 |red or brown. Th| 00003aa0 65 20 73 75 62 20 70 61 74 74 65 72 6e 73 20 6e |e sub patterns n| 00003ab0 65 65 64 20 6e 6f 74 20 63 6f 76 65 72 20 74 68 |eed not cover th| 00003ac0 65 20 65 6e 74 69 72 65 0a 70 61 74 74 65 72 6e |e entire.pattern| 00003ad0 20 72 65 63 74 61 6e 67 6c 65 3b 20 69 66 20 74 | rectangle; if t| 00003ae0 68 65 79 20 64 6f 20 6e 6f 74 2c 20 74 68 65 20 |hey do not, the | 00003af0 43 4f 4c 4f 52 49 4e 46 4f 20 79 6f 75 20 64 65 |COLORINFO you de| 00003b00 66 69 6e 65 64 20 66 6f 72 20 74 68 65 20 6f 62 |fined for the ob| 00003b10 6a 65 63 74 0a 69 73 20 75 73 65 64 20 69 6e 73 |ject.is used ins| 00003b20 74 65 61 64 20 6f 66 20 74 68 65 20 70 61 74 74 |tead of the patt| 00003b30 65 72 6e 20 43 4f 4c 4f 52 49 4e 46 4f 2e 20 49 |ern COLORINFO. I| 00003b40 66 20 79 6f 75 20 64 65 66 69 6e 65 64 20 73 75 |f you defined su| 00003b50 62 2d 70 61 74 74 65 72 6e 73 20 66 6f 72 0a 62 |b-patterns for.b| 00003b60 72 69 63 6b 73 2c 20 74 68 65 20 61 72 65 61 20 |ricks, the area | 00003b70 6e 6f 74 20 63 6f 76 65 72 65 64 20 77 6f 75 6c |not covered woul| 00003b80 64 20 62 65 20 6d 6f 72 74 61 72 2c 20 61 6e 64 |d be mortar, and| 00003b90 20 74 68 65 20 6f 62 6a 65 63 74 73 20 43 4f 4c | the objects COL| 00003ba0 4f 52 49 4e 46 4f 0a 77 6f 75 6c 64 20 64 65 66 |ORINFO.would def| 00003bb0 69 6e 65 20 74 68 65 20 63 6f 6c 6f 72 20 6f 66 |ine the color of| 00003bc0 20 74 68 65 20 6d 6f 72 74 61 72 2e 20 41 6e 20 | the mortar. An | 00003bd0 61 63 74 75 61 6c 20 62 72 69 63 6b 20 70 61 74 |actual brick pat| 00003be0 74 65 72 6e 20 69 73 20 67 69 76 65 6e 20 69 6e |tern is given in| 00003bf0 0a 61 70 70 65 6e 64 69 78 20 43 2e 20 54 68 65 |.appendix C. The| 00003c00 20 70 72 6f 70 65 72 20 75 73 65 20 6f 66 20 70 | proper use of p| 00003c10 61 74 74 65 72 6e 73 20 63 61 6e 20 62 65 20 76 |atterns can be v| 00003c20 65 72 79 20 65 66 66 65 63 74 69 76 65 20 69 6e |ery effective in| 00003c30 20 70 72 6f 64 75 63 69 6e 67 0a 72 65 61 6c 69 | producing.reali| 00003c40 73 74 69 63 20 6c 6f 6f 6b 69 6e 67 20 73 63 65 |stic looking sce| 00003c50 6e 65 73 2e 20 48 6f 77 65 76 65 72 2c 20 63 6f |nes. However, co| 00003c60 6d 70 6c 69 63 61 74 65 64 20 70 61 74 74 65 72 |mplicated patter| 00003c70 6e 73 20 77 69 6c 6c 20 73 6c 6f 77 20 69 6d 61 |ns will slow ima| 00003c80 67 65 0a 63 72 65 61 74 69 6f 6e 2c 20 73 6f 20 |ge.creation, so | 00003c90 69 74 20 69 73 20 72 65 63 6f 6d 6d 65 6e 64 65 |it is recommende| 00003ca0 64 20 74 68 61 74 20 79 6f 75 20 66 69 72 73 74 |d that you first| 00003cb0 20 64 69 73 70 6c 61 79 20 74 65 73 74 20 73 63 | display test sc| 00003cc0 65 6e 65 73 20 77 69 74 68 20 6e 6f 0a 70 61 74 |enes with no.pat| 00003cd0 74 65 72 6e 73 2c 20 61 6e 64 20 74 68 65 6e 20 |terns, and then | 00003ce0 61 64 64 20 70 61 74 74 65 72 6e 20 69 6e 66 6f |add pattern info| 00003cf0 72 6d 61 74 69 6f 6e 20 77 68 65 6e 20 74 68 65 |rmation when the| 00003d00 20 73 63 65 6e 65 20 69 73 20 72 69 67 68 74 2e | scene is right.| 00003d10 0a 20 0a 20 50 61 74 74 65 72 6e 73 20 68 61 76 |. . Patterns hav| 00003d20 65 20 6f 6e 65 20 6f 74 68 65 72 20 75 73 65 2c |e one other use,| 00003d30 20 69 6e 20 74 68 65 20 52 45 4d 4f 56 45 20 63 | in the REMOVE c| 00003d40 6f 6d 6d 61 6e 64 2e 20 41 20 70 61 74 74 65 72 |ommand. A patter| 00003d50 6e 20 63 61 6e 20 62 65 0a 64 65 66 69 6e 65 64 |n can be.defined| 00003d60 20 61 6e 64 20 74 68 6f 75 67 68 74 20 6f 66 20 | and thought of | 00003d70 61 73 20 61 20 63 75 74 20 6f 75 74 20 66 72 6f |as a cut out fro| 00003d80 6d 20 61 20 73 75 72 66 61 63 65 2e 20 46 6f 72 |m a surface. For| 00003d90 20 65 78 61 6d 70 6c 65 2c 20 73 75 70 70 6f 73 | example, suppos| 00003da0 65 20 79 6f 75 0a 77 69 73 68 20 74 6f 20 6d 61 |e you.wish to ma| 00003db0 6b 65 20 61 20 66 6c 61 74 20 73 75 72 66 61 63 |ke a flat surfac| 00003dc0 65 20 69 6e 20 74 68 65 20 73 68 61 70 65 20 6f |e in the shape o| 00003dd0 66 20 61 20 67 72 61 6e 64 20 70 69 61 6e 6f 20 |f a grand piano | 00003de0 74 6f 70 2e 20 52 61 74 68 65 72 20 74 68 61 6e |top. Rather than| 00003df0 0a 63 72 65 61 74 69 6e 67 20 74 68 65 20 70 69 |.creating the pi| 00003e00 61 6e 6f 20 74 6f 70 20 6f 75 74 20 6f 66 20 6d |ano top out of m| 00003e10 61 6e 79 20 70 61 72 61 6c 6c 65 6c 6f 67 72 61 |any parallelogra| 00003e20 6d 73 20 61 6e 64 20 74 72 69 61 6e 67 6c 65 73 |ms and triangles| 00003e30 2c 20 64 65 66 69 6e 65 20 61 0a 70 61 74 74 65 |, define a.patte| 00003e40 72 6e 20 74 68 61 74 20 69 6e 63 6c 75 64 65 73 |rn that includes| 00003e50 20 65 76 65 72 79 74 68 69 6e 67 20 69 6e 20 61 | everything in a| 00003e60 20 70 61 72 61 6c 6c 65 6c 6f 67 72 61 6d 20 62 | parallelogram b| 00003e70 75 74 20 4e 4f 54 20 69 6e 20 74 68 65 20 70 69 |ut NOT in the pi| 00003e80 61 6e 6f 0a 74 6f 70 3b 20 74 68 61 74 20 69 73 |ano.top; that is| 00003e90 2c 20 74 68 65 20 70 61 74 74 65 72 6e 20 6d 61 |, the pattern ma| 00003ea0 70 73 20 74 68 65 20 61 72 65 61 20 74 6f 20 72 |ps the area to r| 00003eb0 65 6d 6f 76 65 2c 20 6e 6f 74 20 74 68 65 20 61 |emove, not the a| 00003ec0 72 65 61 20 74 6f 20 6b 65 65 70 2e 0a 41 74 74 |rea to keep..Att| 00003ed0 61 63 68 20 74 68 69 73 20 70 61 74 74 65 72 6e |ach this pattern| 00003ee0 20 74 6f 20 61 20 70 6c 61 6e 61 72 20 6f 62 6a | to a planar obj| 00003ef0 65 63 74 20 77 69 74 68 20 74 68 65 20 52 45 4d |ect with the REM| 00003f00 4f 56 45 20 63 6f 6d 6d 61 6e 64 2e 20 49 6e 20 |OVE command. In | 00003f10 74 68 69 73 0a 63 61 73 65 2c 20 73 69 6e 63 65 |this.case, since| 00003f20 20 74 68 65 20 61 72 65 61 20 69 73 20 72 65 6d | the area is rem| 00003f30 6f 76 65 64 2c 20 61 6e 79 20 61 73 73 6f 63 69 |oved, any associ| 00003f40 61 74 65 64 20 43 4f 4c 4f 52 49 4e 46 4f 20 69 |ated COLORINFO i| 00003f50 73 20 69 67 6e 6f 72 65 64 2e 0a 20 0a 0a 49 4e |s ignored.. ..IN| 00003f60 53 54 41 4e 43 45 53 0a 20 0a 20 4f 66 74 65 6e |STANCES. . Often| 00003f70 2c 20 73 65 76 65 72 61 6c 20 63 6f 70 69 65 73 |, several copies| 00003f80 20 6f 66 20 61 20 63 6f 6d 70 6c 65 78 20 6f 62 | of a complex ob| 00003f90 6a 65 63 74 20 6d 75 73 74 20 62 65 20 63 72 65 |ject must be cre| 00003fa0 61 74 65 64 2e 20 53 70 65 63 69 66 79 69 6e 67 |ated. Specifying| 00003fb0 20 74 68 65 69 72 0a 63 6f 6d 70 6f 6e 65 6e 74 | their.component| 00003fc0 20 70 72 69 6d 69 74 69 76 65 73 20 65 61 63 68 | primitives each| 00003fd0 20 74 69 6d 65 20 77 6f 75 6c 64 20 62 65 20 64 | time would be d| 00003fe0 69 66 66 69 63 75 6c 74 2e 20 54 68 65 72 65 20 |ifficult. There | 00003ff0 69 73 20 61 20 73 6f 6c 75 74 69 6f 6e 20 74 6f |is a solution to| 00004000 0a 62 6f 74 68 20 74 68 65 73 65 20 70 72 6f 62 |.both these prob| 00004010 6c 65 6d 73 3a 20 49 4e 53 54 41 4e 43 45 53 2e |lems: INSTANCES.| 00004020 20 41 6e 20 49 4e 53 54 41 4e 43 45 20 69 73 20 | An INSTANCE is | 00004030 61 20 6d 65 74 68 6f 64 20 62 79 20 77 68 69 63 |a method by whic| 00004040 68 20 73 65 76 65 72 61 6c 0a 70 72 69 6d 69 74 |h several.primit| 00004050 69 76 65 73 20 28 61 63 74 75 61 6c 6c 79 2c 20 |ives (actually, | 00004060 61 6e 20 61 72 62 69 74 72 61 72 79 20 6f 62 6a |an arbitrary obj| 00004070 65 63 74 20 74 72 65 65 29 20 63 61 6e 20 62 65 |ect tree) can be| 00004080 20 67 72 6f 75 70 65 64 20 61 6e 64 20 67 69 76 | grouped and giv| 00004090 65 6e 20 61 0a 6e 61 6d 65 2e 20 43 6f 70 69 65 |en a.name. Copie| 000040a0 73 20 6f 66 20 74 68 65 73 65 20 6f 62 6a 65 63 |s of these objec| 000040b0 74 73 20 6d 61 79 20 62 65 20 65 61 73 69 6c 79 |ts may be easily| 000040c0 20 63 72 65 61 74 65 64 20 77 69 74 68 20 6f 6e | created with on| 000040d0 65 20 63 6f 6d 6d 61 6e 64 2e 20 48 65 72 65 0a |e command. Here.| 000040e0 69 73 20 61 6e 20 65 78 61 6d 70 6c 65 20 6f 66 |is an example of| 000040f0 20 61 6e 20 69 6e 73 74 61 6e 63 65 20 64 65 66 | an instance def| 00004100 69 6e 69 74 69 6f 6e 2e 0a 0a 20 42 45 47 49 4e |inition... BEGIN| 00004110 5f 49 4e 53 54 41 4e 43 45 53 0a 20 0a 20 20 20 |_INSTANCES. . | 00004120 4e 41 4d 45 20 3d 20 6f 62 6a 65 63 74 31 0a 20 |NAME = object1. | 00004130 20 20 42 45 47 49 4e 5f 42 42 4f 58 0a 20 20 20 | BEGIN_BBOX. | 00004140 20 20 7b 20 2a 2a 20 61 20 62 75 6e 63 68 20 6f | { ** a bunch o| 00004150 66 20 70 72 69 6d 69 74 69 76 65 73 20 68 65 72 |f primitives her| 00004160 65 20 2a 2a 20 7d 0a 20 20 20 45 4e 44 5f 42 42 |e ** }. END_BB| 00004170 4f 58 0a 20 0a 20 20 20 4e 41 4d 45 20 3d 20 6f |OX. . NAME = o| 00004180 62 6a 65 63 74 32 0a 20 20 20 42 45 47 49 4e 5f |bject2. BEGIN_| 00004190 42 42 4f 58 0a 20 20 20 20 20 7b 20 2a 2a 20 61 |BBOX. { ** a| 000041a0 20 62 75 6e 63 68 20 6d 6f 72 65 20 70 72 69 6d | bunch more prim| 000041b0 69 74 69 76 65 73 20 68 65 72 65 20 2a 2a 20 7d |itives here ** }| 000041c0 0a 20 0a 20 20 20 20 20 4e 41 4d 45 20 3d 20 73 |. . NAME = s| 000041d0 70 68 65 72 65 73 0a 20 20 20 20 20 42 45 47 49 |pheres. BEGI| 000041e0 4e 5f 42 42 4f 58 0a 20 20 20 20 20 20 20 53 50 |N_BBOX. SP| 000041f0 48 45 52 45 20 28 20 29 20 7b 20 2a 2a 20 74 77 |HERE ( ) { ** tw| 00004200 6f 20 73 70 68 65 72 65 20 64 65 66 69 6e 69 74 |o sphere definit| 00004210 69 6f 6e 73 20 2a 2a 20 7d 0a 20 20 20 20 20 20 |ions ** }. | 00004220 20 53 50 48 45 52 45 20 28 20 29 0a 20 20 20 20 | SPHERE ( ). | 00004230 20 45 4e 44 5f 42 42 4f 58 0a 20 0a 20 20 20 45 | END_BBOX. . E| 00004240 4e 44 5f 42 42 4f 58 0a 20 0a 20 45 4e 44 5f 49 |ND_BBOX. . END_I| 00004250 4e 53 54 41 4e 43 45 53 0a 20 0a 20 54 68 65 72 |NSTANCES. . Ther| 00004260 65 20 63 61 6e 20 62 65 20 6f 6e 6c 79 20 6f 6e |e can be only on| 00004270 65 20 6f 66 20 74 68 65 73 65 20 69 6e 73 74 61 |e of these insta| 00004280 6e 63 65 20 64 65 66 69 6e 69 74 69 6f 6e 73 2c |nce definitions,| 00004290 20 61 6e 64 20 69 74 20 6d 75 73 74 20 61 70 70 | and it must app| 000042a0 65 61 72 0a 62 65 66 6f 72 65 20 61 6e 79 20 69 |ear.before any i| 000042b0 6e 73 74 61 6e 63 65 73 20 61 72 65 20 75 73 65 |nstances are use| 000042c0 64 2e 20 48 6f 77 65 76 65 72 2c 20 61 6e 79 20 |d. However, any | 000042d0 61 72 62 69 74 72 61 72 79 20 6f 62 6a 65 63 74 |arbitrary object| 000042e0 20 74 72 65 65 20 63 61 6e 20 61 70 70 65 61 72 | tree can appear| 000042f0 0a 77 69 74 68 69 6e 20 74 68 65 20 62 65 67 69 |.within the begi| 00004300 6e 2f 65 6e 64 20 69 6e 73 74 61 6e 63 65 20 73 |n/end instance s| 00004310 74 61 74 65 6d 65 6e 74 73 2e 20 53 65 76 65 72 |tatements. Sever| 00004320 61 6c 20 69 6e 73 74 61 6e 63 65 73 20 61 72 65 |al instances are| 00004330 20 6e 6f 77 0a 61 76 61 69 6c 61 62 6c 65 20 66 | now.available f| 00004340 6f 72 20 75 73 65 2e 20 46 6f 72 20 65 78 61 6d |or use. For exam| 00004350 70 6c 65 3a 0a 20 0a 20 49 4e 53 54 41 4e 43 45 |ple:. . INSTANCE| 00004360 5f 4f 46 20 28 20 6e 61 6d 65 20 3d 20 6f 62 6a |_OF ( name = obj| 00004370 65 63 74 31 2c 0a 20 20 20 20 20 20 20 20 20 20 |ect1,. | 00004380 20 20 20 20 20 6c 6f 63 20 3d 20 28 31 30 30 2c | loc = (100,| 00004390 20 31 30 2c 20 32 30 29 2c 0a 20 20 20 20 20 20 | 10, 20),. | 000043a0 20 20 20 20 20 20 20 29 0a 20 0a 20 49 4e 53 54 | ). . INST| 000043b0 41 4e 43 45 5f 4f 46 20 28 20 6e 61 6d 65 20 3d |ANCE_OF ( name =| 000043c0 20 73 70 68 65 72 65 73 2c 0a 20 20 20 20 20 20 | spheres,. | 000043d0 20 20 20 20 20 20 20 20 20 6c 6f 63 20 3d 20 28 | loc = (| 000043e0 31 32 2e 33 2c 20 32 34 2e 35 2c 20 39 39 39 29 |12.3, 24.5, 999)| 000043f0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 29 0a |. ).| 00004400 20 0a 20 54 68 69 73 20 65 78 61 6d 70 6c 65 20 | . This example | 00004410 73 68 6f 77 73 20 74 68 61 74 20 61 6e 79 20 6e |shows that any n| 00004420 61 6d 65 64 20 70 6f 72 74 69 6f 6e 20 6f 66 20 |amed portion of | 00004430 74 68 65 20 6f 62 6a 65 63 74 20 73 75 62 74 72 |the object subtr| 00004440 65 65 20 63 61 6e 0a 66 75 6e 63 74 69 6f 6e 20 |ee can.function | 00004450 61 73 20 61 6e 20 69 6e 73 74 61 6e 63 65 20 28 |as an instance (| 00004460 74 68 65 20 22 73 70 68 65 72 65 73 22 20 6f 62 |the "spheres" ob| 00004470 6a 65 63 74 20 69 73 20 61 74 20 61 20 6c 6f 77 |ject is at a low| 00004480 65 72 20 6c 65 76 65 6c 20 74 68 61 6e 20 74 68 |er level than th| 00004490 65 0a 22 6f 62 6a 65 63 74 31 27 20 6f 62 6a 65 |e."object1' obje| 000044a0 63 74 29 2e 20 54 68 65 20 22 6f 66 66 73 65 74 |ct). The "offset| 000044b0 22 20 70 61 72 61 6d 65 74 65 72 73 20 61 72 65 |" parameters are| 000044c0 20 72 65 71 75 69 72 65 64 2e 20 54 68 65 79 20 | required. They | 000044d0 73 70 65 63 69 66 79 20 61 20 6e 65 77 0a 70 6f |specify a new.po| 000044e0 73 69 74 69 6f 6e 20 66 6f 72 20 74 68 65 20 69 |sition for the i| 000044f0 6e 73 74 61 6e 63 65 20 28 6f 66 66 73 65 74 20 |nstance (offset | 00004500 66 72 6f 6d 20 74 68 65 20 6f 72 69 67 69 6e 29 |from the origin)| 00004510 2e 20 49 6e 20 74 68 65 20 69 6e 73 74 61 6e 63 |. In the instanc| 00004520 65 0a 64 65 66 69 6e 69 74 69 6f 6e 20 73 65 67 |e.definition seg| 00004530 6d 65 6e 74 2c 20 61 6c 6c 20 6f 62 6a 65 63 74 |ment, all object| 00004540 73 20 61 72 65 20 64 65 66 69 6e 65 64 20 72 65 |s are defined re| 00004550 6c 61 74 69 76 65 20 74 6f 20 30 2c 30 2c 30 2e |lative to 0,0,0.| 00004560 20 54 68 65 79 20 63 61 6e 20 74 68 65 6e 0a 62 | They can then.b| 00004570 65 20 6d 6f 76 65 64 20 69 6e 20 74 68 65 20 49 |e moved in the I| 00004580 4e 53 54 41 4e 43 45 5f 4f 46 20 73 74 61 74 65 |NSTANCE_OF state| 00004590 6d 65 6e 74 20 77 69 74 68 20 74 68 65 20 6f 66 |ment with the of| 000045a0 66 73 65 74 20 63 6f 6d 6d 61 6e 64 2e 0a 20 0a |fset command.. .| 000045b0 20 49 6e 20 61 64 64 69 74 69 6f 6e 2c 20 74 68 | In addition, th| 000045c0 65 20 69 6e 73 74 61 6e 63 65 20 63 61 6e 20 62 |e instance can b| 000045d0 65 20 67 69 76 65 6e 20 61 20 6e 65 77 20 73 69 |e given a new si| 000045e0 7a 65 3a 0a 20 0a 20 49 4e 53 54 41 4e 43 45 5f |ze:. . INSTANCE_| 000045f0 4f 46 20 28 20 6e 61 6d 65 20 3d 20 6f 62 6a 65 |OF ( name = obje| 00004600 63 74 32 2c 0a 20 0a 20 20 20 20 20 20 20 20 20 |ct2,. . | 00004610 20 20 20 20 20 20 6c 6f 63 20 3d 20 28 32 30 30 | loc = (200| 00004620 2c 20 31 30 30 2c 20 35 30 29 2c 0a 20 20 20 20 |, 100, 50),. | 00004630 20 20 20 20 20 20 20 20 20 20 20 73 63 61 6c 65 | scale| 00004640 20 3d 20 28 31 2e 35 2c 20 32 2e 30 2c 20 2e 32 | = (1.5, 2.0, .2| 00004650 35 29 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 |5). | 00004660 29 0a 20 0a 20 54 68 65 20 73 63 61 6c 65 20 66 |). . The scale f| 00004670 61 63 74 6f 72 73 20 61 72 65 20 6f 70 74 69 6f |actors are optio| 00004680 6e 61 6c 2c 20 61 6e 64 20 61 72 65 20 67 69 76 |nal, and are giv| 00004690 65 6e 20 74 68 65 20 64 65 66 61 75 6c 74 20 6f |en the default o| 000046a0 66 20 31 2e 20 54 68 65 0a 69 6e 73 74 61 6e 63 |f 1. The.instanc| 000046b0 65 20 77 69 6c 6c 20 62 65 20 72 65 73 69 7a 65 |e will be resize| 000046c0 64 20 62 79 20 74 68 65 20 69 6e 64 69 63 61 74 |d by the indicat| 000046d0 65 64 20 61 6d 6f 75 6e 74 20 69 6e 20 65 61 63 |ed amount in eac| 000046e0 68 20 6f 66 20 74 68 65 20 64 69 72 65 63 74 69 |h of the directi| 000046f0 6f 6e 73 2e 0a 4e 6f 74 65 20 74 68 61 74 20 74 |ons..Note that t| 00004700 68 65 72 65 20 61 72 65 20 73 6f 6d 65 20 72 65 |here are some re| 00004710 73 74 72 69 63 74 69 6f 6e 73 20 74 6f 20 74 68 |strictions to th| 00004720 69 73 3a 20 69 66 20 73 70 68 65 72 65 73 20 61 |is: if spheres a| 00004730 72 65 20 67 69 76 65 6e 20 61 0a 64 69 66 66 65 |re given a.diffe| 00004740 72 65 6e 74 20 73 63 61 6c 65 20 66 61 63 74 6f |rent scale facto| 00004750 72 20 69 6e 20 65 61 63 68 20 64 69 72 65 63 74 |r in each direct| 00004760 69 6f 6e 2c 20 74 68 65 79 20 77 69 6c 6c 20 72 |ion, they will r| 00004770 65 6d 61 69 6e 20 73 70 68 65 72 65 73 20 28 6e |emain spheres (n| 00004780 6f 74 0a 63 68 61 6e 67 65 20 74 6f 20 51 55 41 |ot.change to QUA| 00004790 44 52 41 54 49 43 20 74 79 70 65 73 29 2e 20 54 |DRATIC types). T| 000047a0 68 65 20 6e 65 77 20 72 61 64 69 75 73 20 77 69 |he new radius wi| 000047b0 6c 6c 20 62 65 20 74 68 65 20 6f 6c 64 20 72 61 |ll be the old ra| 000047c0 64 69 75 73 20 73 63 61 6c 65 64 20 62 79 0a 74 |dius scaled by.t| 000047d0 68 65 20 73 6d 61 6c 6c 65 73 74 20 6f 66 20 74 |he smallest of t| 000047e0 68 65 20 73 63 61 6c 65 20 66 61 63 74 6f 72 73 |he scale factors| 000047f0 2e 0a 20 0a 0a 44 45 46 41 55 4c 54 53 0a 20 0a |.. ..DEFAULTS. .| 00004800 20 45 61 63 68 20 6f 62 6a 65 63 74 20 69 6e 20 | Each object in | 00004810 51 52 54 20 69 73 20 67 69 76 65 6e 20 63 65 72 |QRT is given cer| 00004820 74 61 69 6e 20 64 65 66 61 75 6c 74 20 73 75 72 |tain default sur| 00004830 66 61 63 65 20 6c 69 67 68 74 20 63 68 61 72 61 |face light chara| 00004840 63 74 65 72 69 73 74 69 63 73 0a 28 73 65 65 20 |cteristics.(see | 00004850 74 68 65 20 73 65 63 74 69 6f 6e 20 6f 6e 20 73 |the section on s| 00004860 75 72 66 61 63 65 20 63 68 61 72 61 63 74 65 72 |urface character| 00004870 69 73 74 69 63 73 29 2e 20 49 66 20 74 68 65 73 |istics). If thes| 00004880 65 20 64 65 66 61 75 6c 74 73 20 61 72 65 20 6e |e defaults are n| 00004890 6f 74 0a 73 75 69 74 61 62 6c 65 2c 20 74 68 65 |ot.suitable, the| 000048a0 79 20 63 61 6e 20 62 65 20 63 68 61 6e 67 65 64 |y can be changed| 000048b0 20 77 69 74 68 20 74 68 65 20 44 45 46 41 55 4c | with the DEFAUL| 000048c0 54 20 63 6f 6d 6d 61 6e 64 3a 0a 20 0a 20 44 45 |T command:. . DE| 000048d0 46 41 55 4c 54 20 28 20 64 69 66 66 20 3d 20 28 |FAULT ( diff = (| 000048e0 31 2e 30 30 2c 20 2e 31 2c 20 2e 31 29 0a 20 20 |1.00, .1, .1). | 000048f0 20 20 20 20 20 20 20 20 20 6e 6f 5f 73 68 61 64 | no_shad| 00004900 6f 77 20 29 0a 20 0a 20 54 68 69 73 20 77 69 6c |ow ). . This wil| 00004910 6c 20 6d 61 6b 65 20 61 6c 6c 20 66 75 74 75 72 |l make all futur| 00004920 65 20 6f 62 6a 65 63 74 73 20 72 65 64 20 75 6e |e objects red un| 00004930 6c 65 73 73 20 73 70 65 63 69 66 69 65 64 20 6f |less specified o| 00004940 74 68 65 72 77 69 73 65 2e 20 4d 6f 72 65 20 74 |therwise. More t| 00004950 68 61 6e 0a 6f 6e 65 20 64 65 66 61 75 6c 74 20 |han.one default | 00004960 63 6f 6d 6d 61 6e 64 20 63 61 6e 20 62 65 20 75 |command can be u| 00004970 73 65 64 20 69 6e 20 61 20 66 69 6c 65 3a 20 65 |sed in a file: e| 00004980 61 63 68 20 6f 6e 65 20 61 66 66 65 63 74 73 20 |ach one affects | 00004990 61 6c 6c 20 74 68 65 20 6f 62 6a 65 63 74 73 0a |all the objects.| 000049a0 63 72 65 61 74 65 64 20 61 66 74 65 72 20 69 74 |created after it| 000049b0 2c 20 62 75 74 20 62 65 66 6f 72 65 20 74 68 65 |, but before the| 000049c0 20 6e 65 78 74 20 64 65 66 61 75 6c 74 20 63 6f | next default co| 000049d0 6d 6d 61 6e 64 2e 20 41 6e 79 20 6c 69 67 68 74 |mmand. Any light| 000049e0 0a 63 68 61 72 61 63 74 65 72 69 73 74 69 63 73 |.characteristics| 000049f0 20 63 61 6e 20 62 65 20 63 68 61 6e 67 65 64 20 | can be changed | 00004a00 28 4d 49 52 52 4f 52 2c 20 44 49 54 48 45 52 2c |(MIRROR, DITHER,| 00004a10 20 65 74 63 29 2e 0a 20 0a 20 49 6e 20 61 64 64 | etc).. . In add| 00004a20 69 74 69 6f 6e 2c 20 74 68 65 20 6b 65 79 77 6f |ition, the keywo| 00004a30 72 64 20 22 6e 6f 5f 73 68 61 64 6f 77 22 20 63 |rd "no_shadow" c| 00004a40 61 6e 20 62 65 20 69 6e 63 6c 75 64 65 64 20 28 |an be included (| 00004a50 61 73 20 61 62 6f 76 65 29 2e 0a 4f 72 64 69 6e |as above)..Ordin| 00004a60 61 72 69 6c 79 2c 20 51 52 54 20 63 6f 6d 70 75 |arily, QRT compu| 00004a70 74 65 73 20 73 68 61 64 6f 77 20 69 6e 66 6f 72 |tes shadow infor| 00004a80 6d 61 74 69 6f 6e 20 66 6f 72 20 61 6c 6c 20 6f |mation for all o| 00004a90 62 6a 65 63 74 73 2e 20 54 68 69 73 20 74 61 6b |bjects. This tak| 00004aa0 65 73 20 61 0a 6c 6f 74 20 6f 66 20 74 69 6d 65 |es a.lot of time| 00004ab0 2c 20 65 73 70 65 63 69 61 6c 6c 79 20 66 6f 72 |, especially for| 00004ac0 20 73 63 65 6e 65 73 20 63 6f 6d 70 6f 73 65 64 | scenes composed| 00004ad0 20 6f 66 20 6d 61 6e 79 20 6f 62 6a 65 63 74 73 | of many objects| 00004ae0 20 61 6e 64 20 6d 61 6e 79 20 6c 61 6d 70 73 2e | and many lamps.| 00004af0 0a 54 68 65 20 22 6e 6f 5f 73 68 61 64 6f 77 22 |.The "no_shadow"| 00004b00 20 63 6f 6d 6d 61 6e 64 20 63 61 75 73 65 73 20 | command causes | 00004b10 51 52 54 20 74 6f 20 62 79 70 61 73 73 20 74 68 |QRT to bypass th| 00004b20 65 20 73 68 61 64 6f 77 20 72 6f 75 74 69 6e 65 |e shadow routine| 00004b30 73 2e 20 54 68 69 73 20 77 69 6c 6c 0a 72 65 73 |s. This will.res| 00004b40 75 6c 74 20 69 6e 20 61 20 6d 75 63 68 20 66 61 |ult in a much fa| 00004b50 73 74 65 72 20 69 6d 61 67 65 20 67 65 6e 65 72 |ster image gener| 00004b60 61 74 69 6f 6e 20 74 69 6d 65 2c 20 62 75 74 20 |ation time, but | 00004b70 74 68 65 20 70 69 63 74 75 72 65 20 77 69 6c 6c |the picture will| 00004b80 20 6e 6f 74 20 6c 6f 6f 6b 0a 61 73 20 72 65 61 | not look.as rea| 00004b90 6c 69 73 74 69 63 2e 0a 20 0a 20 58 20 61 6e 64 |listic.. . X and| 00004ba0 20 59 20 73 63 72 65 65 6e 20 72 65 73 6f 6c 75 | Y screen resolu| 00004bb0 74 69 6f 6e 20 61 6e 64 20 61 73 70 65 63 74 20 |tion and aspect | 00004bc0 72 61 74 69 6f 20 63 61 6e 20 61 6c 73 6f 20 62 |ratio can also b| 00004bd0 65 20 63 68 61 6e 67 65 64 20 77 69 74 68 20 74 |e changed with t| 00004be0 68 69 73 0a 63 6f 6d 6d 61 6e 64 2e 20 49 66 20 |his.command. If | 00004bf0 79 6f 75 20 77 69 73 68 20 74 6f 20 67 65 6e 65 |you wish to gene| 00004c00 72 61 74 65 20 61 20 70 72 65 6c 69 6d 69 6e 61 |rate a prelimina| 00004c10 72 79 20 69 6d 61 67 65 20 69 6e 20 61 20 73 6d |ry image in a sm| 00004c20 61 6c 6c 65 72 0a 72 65 73 6f 6c 75 74 69 6f 6e |aller.resolution| 00004c30 2c 20 73 61 79 2c 20 31 32 37 20 78 20 31 32 37 |, say, 127 x 127| 00004c40 2c 20 79 6f 75 20 77 6f 75 6c 64 20 75 73 65 20 |, you would use | 00004c50 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 64 65 |the following de| 00004c60 66 61 75 6c 74 3a 0a 20 0a 20 44 45 46 41 55 4c |fault:. . DEFAUL| 00004c70 54 20 28 20 78 5f 72 65 73 20 3d 20 31 32 37 2c |T ( x_res = 127,| 00004c80 0a 20 20 20 20 20 20 20 20 20 20 20 79 5f 72 65 |. y_re| 00004c90 73 20 3d 20 31 32 37 2c 0a 20 20 20 20 20 20 20 |s = 127,. | 00004ca0 20 20 20 20 61 73 70 65 63 74 20 3d 20 2e 35 36 | aspect = .56| 00004cb0 0a 20 20 20 20 20 20 20 20 20 29 0a 20 0a 20 54 |. ). . T| 00004cc0 68 65 20 61 73 70 65 63 74 20 72 61 74 69 6f 20 |he aspect ratio | 00004cd0 6f 66 20 2e 35 36 20 69 73 20 63 6f 72 72 65 63 |of .56 is correc| 00004ce0 74 20 66 6f 72 20 74 68 65 20 41 6d 69 67 61 20 |t for the Amiga | 00004cf0 69 6e 20 34 30 39 36 20 63 6f 6c 6f 72 20 6d 6f |in 4096 color mo| 00004d00 64 65 3b 20 75 73 65 0a 31 2e 30 20 66 6f 72 20 |de; use.1.0 for | 00004d10 68 69 67 68 20 72 65 73 6f 6c 75 74 69 6f 6e 20 |high resolution | 00004d20 6d 6f 64 65 2e 0a 0a 0a 50 52 4f 42 4c 45 4d 53 |mode....PROBLEMS| 00004d30 20 57 49 54 48 20 51 52 54 0a 20 0a 20 54 68 65 | WITH QRT. . The| 00004d40 72 65 20 61 72 65 20 73 65 76 65 72 61 6c 20 6c |re are several l| 00004d50 69 6d 69 74 61 74 69 6f 6e 73 20 69 6e 20 74 68 |imitations in th| 00004d60 69 73 20 76 65 72 73 69 6f 6e 20 6f 66 20 51 52 |is version of QR| 00004d70 54 3a 0a 20 0a 20 6f 20 50 61 74 74 65 72 6e 69 |T:. . o Patterni| 00004d80 6e 67 20 64 6f 65 73 20 6e 6f 74 20 77 6f 72 6b |ng does not work| 00004d90 20 77 65 6c 6c 20 77 69 74 68 20 73 6f 6d 65 20 | well with some | 00004da0 71 75 61 64 72 61 74 69 63 20 73 75 72 66 61 63 |quadratic surfac| 00004db0 65 73 2e 20 54 68 69 73 20 69 73 20 61 0a 20 20 |es. This is a. | 00004dc0 20 70 72 6f 62 6c 65 6d 20 77 69 74 68 20 74 68 | problem with th| 00004dd0 65 20 33 64 20 74 6f 20 32 64 20 6d 61 70 70 69 |e 3d to 2d mappi| 00004de0 6e 67 20 66 75 6e 63 74 69 6f 6e 20 75 73 65 64 |ng function used| 00004df0 20 66 6f 72 20 71 75 61 64 72 61 74 69 63 73 2e | for quadratics.| 00004e00 0a 20 0a 20 6f 20 55 73 65 72 20 64 65 66 69 6e |. . o User defin| 00004e10 65 64 20 74 65 78 74 75 72 69 6e 67 20 69 73 20 |ed texturing is | 00004e20 6e 6f 74 20 69 6d 70 6c 65 6d 65 6e 74 65 64 20 |not implemented | 00004e30 2d 20 61 6c 6c 20 6f 62 6a 65 63 74 73 20 69 6e |- all objects in| 00004e40 20 51 52 54 20 61 70 70 65 61 72 0a 20 20 20 73 | QRT appear. s| 00004e50 6d 6f 6f 74 68 2e 20 49 20 68 61 76 65 20 73 6f |mooth. I have so| 00004e60 6d 65 20 69 64 65 61 73 20 6f 6e 20 68 6f 77 20 |me ideas on how | 00004e70 74 6f 20 61 64 64 20 74 65 78 74 75 72 65 73 20 |to add textures | 00004e80 74 6f 20 6f 62 6a 65 63 74 73 2c 20 62 75 74 20 |to objects, but | 00004e90 74 68 65 73 65 0a 20 20 20 68 61 76 65 20 6e 6f |these. have no| 00004ea0 74 20 62 65 65 6e 20 74 65 73 74 65 64 20 61 6e |t been tested an| 00004eb0 64 20 61 72 65 20 6e 6f 74 20 69 6e 63 6f 72 70 |d are not incorp| 00004ec0 6f 72 61 74 65 64 20 69 6e 74 6f 20 74 68 69 73 |orated into this| 00004ed0 20 76 65 72 73 69 6f 6e 20 6f 66 20 51 52 54 2e | version of QRT.| 00004ee0 0a 20 0a 0a 46 55 54 55 52 45 20 45 4e 48 41 4e |. ..FUTURE ENHAN| 00004ef0 43 45 4d 45 4e 54 53 20 54 4f 20 51 52 54 0a 20 |CEMENTS TO QRT. | 00004f00 0a 20 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 |. The following | 00004f10 61 72 65 20 73 6f 6d 65 20 74 68 69 6e 67 73 20 |are some things | 00004f20 49 27 64 20 6c 69 6b 65 20 74 6f 20 61 64 64 20 |I'd like to add | 00004f30 74 6f 20 51 52 54 3a 0a 20 0a 20 6f 20 45 6e 68 |to QRT:. . o Enh| 00004f40 61 6e 63 65 64 20 70 61 74 74 65 72 6e 69 6e 67 |anced patterning| 00004f50 20 63 61 70 61 62 69 6c 69 74 79 2e 20 54 68 65 | capability. The| 00004f60 20 61 62 69 6c 69 74 79 20 74 6f 20 75 73 65 20 | ability to use | 00004f70 65 6e 75 6d 65 72 61 74 65 64 0a 20 20 20 28 62 |enumerated. (b| 00004f80 69 74 2d 6d 61 70 70 65 64 29 20 70 61 74 74 65 |it-mapped) patte| 00004f90 72 6e 73 20 61 73 20 77 65 6c 6c 20 61 73 20 61 |rns as well as a| 00004fa0 6e 61 6c 79 74 69 63 20 70 61 74 74 65 72 6e 73 |nalytic patterns| 00004fb0 20 77 6f 75 6c 64 20 62 65 20 75 73 65 66 75 6c | would be useful| 00004fc0 2e 0a 20 0a 20 6f 20 41 6e 74 69 2d 64 69 74 68 |.. . o Anti-dith| 00004fd0 65 72 69 6e 67 20 72 6f 75 74 69 6e 65 73 2e 20 |ering routines. | 00004fe0 54 68 65 73 65 20 72 6f 75 74 69 6e 65 73 20 61 |These routines a| 00004ff0 72 65 20 76 65 72 79 20 63 6f 6d 70 75 74 61 74 |re very computat| 00005000 69 6f 6e 61 6c 6c 79 0a 20 20 20 65 78 70 65 6e |ionally. expen| 00005010 73 69 76 65 20 28 74 68 65 79 20 63 61 6e 20 69 |sive (they can i| 00005020 6e 63 72 65 61 73 65 20 69 6d 61 67 65 20 67 65 |ncrease image ge| 00005030 6e 65 72 61 74 69 6f 6e 20 74 69 6d 65 73 20 62 |neration times b| 00005040 79 20 61 20 66 61 63 74 6f 72 20 6f 66 20 33 20 |y a factor of 3 | 00005050 74 6f 0a 20 20 20 35 29 2c 20 73 6f 20 74 68 65 |to. 5), so the| 00005060 79 20 77 65 72 65 20 6e 6f 74 20 69 6e 63 6c 75 |y were not inclu| 00005070 64 65 64 20 69 6e 20 74 68 69 73 20 76 65 72 73 |ded in this vers| 00005080 69 6f 6e 2e 0a 20 0a 20 6f 20 50 65 6e 75 6d 62 |ion.. . o Penumb| 00005090 72 61 6c 20 73 68 61 64 6f 77 73 2e 20 54 68 69 |ral shadows. Thi| 000050a0 73 20 69 73 20 61 6c 73 6f 20 76 65 72 79 20 63 |s is also very c| 000050b0 6f 6d 70 75 74 61 74 69 6f 6e 61 6c 6c 79 20 65 |omputationally e| 000050c0 78 70 65 6e 73 69 76 65 20 66 6f 72 20 61 0a 20 |xpensive for a. | 000050d0 20 20 6d 69 6e 69 6d 61 6c 20 75 74 69 6c 69 74 | minimal utilit| 000050e0 79 20 6c 65 76 65 6c 2c 20 73 6f 20 49 20 64 69 |y level, so I di| 000050f0 64 6e 27 74 20 62 6f 74 68 65 72 20 74 6f 20 69 |dn't bother to i| 00005100 6e 63 6c 75 64 65 20 74 68 69 73 20 66 65 61 74 |nclude this feat| 00005110 75 72 65 2e 0a 20 0a 20 6f 20 46 72 61 63 74 61 |ure.. . o Fracta| 00005120 6c 20 67 65 6e 65 72 61 74 69 6f 6e 2e 20 46 72 |l generation. Fr| 00005130 61 63 74 61 6c 73 20 61 72 65 2c 20 61 67 61 69 |actals are, agai| 00005140 6e 2c 20 63 6f 6d 70 75 74 61 74 69 6f 6e 61 6c |n, computational| 00005150 6c 79 20 65 78 70 65 6e 73 69 76 65 2c 20 62 75 |ly expensive, bu| 00005160 74 0a 20 20 20 73 6f 6d 65 20 74 68 69 6e 67 73 |t. some things| 00005170 2c 20 73 75 63 68 20 61 73 20 6d 6f 75 6e 74 61 |, such as mounta| 00005180 69 6e 73 2c 20 63 61 6e 6e 6f 74 20 62 65 20 6d |ins, cannot be m| 00005190 6f 64 65 6c 65 64 20 77 69 74 68 20 61 20 72 61 |odeled with a ra| 000051a0 79 20 74 72 61 63 65 72 20 61 6e 79 0a 20 20 20 |y tracer any. | 000051b0 6f 74 68 65 72 20 77 61 79 2e 0a 20 0a 20 6f 20 |other way.. . o | 000051c0 57 61 76 79 20 73 75 72 66 61 63 65 73 2e 20 54 |Wavy surfaces. T| 000051d0 68 69 73 20 69 73 20 75 73 65 66 75 6c 20 66 6f |his is useful fo| 000051e0 72 20 6d 6f 64 65 6c 69 6e 67 20 77 61 74 65 72 |r modeling water| 000051f0 2c 20 72 69 70 70 6c 65 64 20 6d 69 72 72 6f 72 |, rippled mirror| 00005200 73 2c 20 65 74 63 2e 20 49 0a 20 20 20 6b 6e 6f |s, etc. I. kno| 00005210 77 20 68 6f 77 20 74 6f 20 64 6f 20 69 74 2c 20 |w how to do it, | 00005220 49 20 6a 75 73 74 20 64 69 64 6e 27 74 20 68 61 |I just didn't ha| 00005230 76 65 20 74 69 6d 65 20 74 6f 20 61 64 64 20 69 |ve time to add i| 00005240 74 20 79 65 74 2e 20 49 74 20 77 6f 75 6c 64 20 |t yet. It would | 00005250 62 65 0a 20 20 20 6e 69 63 65 20 69 66 20 74 68 |be. nice if th| 00005260 65 20 77 61 76 65 73 20 77 65 72 65 20 75 73 65 |e waves were use| 00005270 72 20 64 65 66 69 6e 61 62 6c 65 20 69 6e 20 61 |r definable in a| 00005280 6d 70 6c 69 74 75 64 65 20 61 6e 64 20 78 20 61 |mplitude and x a| 00005290 6e 64 20 79 0a 20 20 20 77 61 76 65 6c 65 6e 67 |nd y. waveleng| 000052a0 74 68 2e 20 57 61 76 79 20 73 75 72 66 61 63 65 |th. Wavy surface| 000052b0 73 20 61 72 65 20 76 65 72 79 20 73 69 6d 69 6c |s are very simil| 000052c0 61 72 20 69 6e 20 69 6d 70 6c 65 6d 65 6e 74 61 |ar in implementa| 000052d0 74 69 6f 6e 20 74 6f 20 74 65 78 74 75 72 65 73 |tion to textures| 000052e0 2e 0a 20 0a 20 6f 20 53 6e 6f 77 79 20 73 75 72 |.. . o Snowy sur| 000052f0 66 61 63 65 73 2e 20 54 68 69 73 20 69 73 20 61 |faces. This is a| 00005300 6e 20 69 64 65 61 20 66 72 6f 6d 20 44 42 57 2c |n idea from DBW,| 00005310 20 77 68 69 63 68 20 61 64 64 73 20 73 6e 6f 77 | which adds snow| 00005320 20 74 6f 20 61 20 73 75 72 66 61 63 65 0a 20 20 | to a surface. | 00005330 20 64 65 70 65 6e 64 69 6e 67 20 6f 6e 20 69 74 | depending on it| 00005340 73 20 73 6c 6f 70 65 20 61 6e 64 20 61 6c 74 69 |s slope and alti| 00005350 74 75 64 65 2e 0a 20 0a 20 6f 20 49 6e 74 65 72 |tude.. . o Inter| 00005360 70 6f 6c 61 74 65 64 20 6e 6f 72 6d 61 6c 20 73 |polated normal s| 00005370 75 72 66 61 63 65 73 2e 20 54 68 69 73 20 69 73 |urfaces. This is| 00005380 20 61 20 6d 65 63 68 61 6e 69 73 6d 20 74 6f 20 | a mechanism to | 00005390 6d 6f 64 65 6c 20 61 72 62 69 74 72 61 72 79 0a |model arbitrary.| 000053a0 20 20 20 63 75 72 76 65 64 20 73 75 72 66 61 63 | curved surfac| 000053b0 65 73 20 62 79 20 75 73 69 6e 67 20 61 20 70 6f |es by using a po| 000053c0 6c 79 67 6f 6e 61 6c 20 61 70 70 72 6f 78 69 6d |lygonal approxim| 000053d0 61 74 69 6f 6e 20 74 6f 20 74 68 65 20 73 75 72 |ation to the sur| 000053e0 66 61 63 65 2c 20 61 6e 64 0a 20 20 20 69 6e 74 |face, and. int| 000053f0 65 72 70 6f 6c 61 74 69 6e 67 20 74 68 65 20 6e |erpolating the n| 00005400 6f 72 6d 61 6c 20 76 65 63 74 6f 72 20 62 65 74 |ormal vector bet| 00005410 77 65 65 6e 20 73 75 72 66 61 63 65 73 20 74 6f |ween surfaces to| 00005420 20 61 76 6f 69 64 20 61 6e 67 75 6c 61 72 20 6c | avoid angular l| 00005430 6f 6f 6b 69 6e 67 0a 20 20 20 73 75 72 66 61 63 |ooking. surfac| 00005440 65 73 2e 0a 20 0a 20 6f 20 49 6d 61 67 65 20 70 |es.. . o Image p| 00005450 6c 61 6e 65 20 6f 62 6a 65 63 74 20 6c 69 73 74 |lane object list| 00005460 73 2e 20 54 68 69 73 20 69 73 20 61 20 74 65 63 |s. This is a tec| 00005470 68 6e 69 71 75 65 20 66 6f 72 20 69 6e 63 72 65 |hnique for incre| 00005480 61 73 69 6e 67 20 74 68 65 20 73 70 65 65 64 0a |asing the speed.| 00005490 20 20 20 66 6f 72 20 70 6f 73 69 74 69 76 65 20 | for positive | 000054a0 6c 69 6e 65 2f 6f 62 6a 65 63 74 20 69 6e 74 65 |line/object inte| 000054b0 72 73 65 63 74 69 6f 6e 20 74 65 73 74 2e 20 28 |rsection test. (| 000054c0 42 6f 75 6e 64 69 6e 67 20 62 6f 78 65 73 20 69 |Bounding boxes i| 000054d0 6e 63 72 65 61 73 65 0a 20 20 20 73 70 65 65 64 |ncrease. speed| 000054e0 20 66 6f 72 20 6e 65 67 61 74 69 76 65 20 6c 69 | for negative li| 000054f0 6e 65 2f 6f 62 6a 65 63 74 20 69 6e 74 65 72 73 |ne/object inters| 00005500 65 63 74 69 6f 6e 20 74 65 73 74 73 29 2e 20 0a |ection tests). .| 00005510 20 0a 20 6f 20 48 65 75 72 69 73 74 69 63 73 20 | . o Heuristics | 00005520 66 6f 72 20 66 61 73 74 65 72 20 63 6f 6d 70 6c |for faster compl| 00005530 65 74 69 6f 6e 20 6f 66 20 69 6d 61 67 65 73 20 |etion of images | 00005540 75 73 69 6e 67 20 61 72 65 61 20 63 6f 68 65 72 |using area coher| 00005550 65 6e 63 65 2e 0a 20 0a 20 6f 20 41 6e 20 69 6e |ence.. . o An in| 00005560 74 65 72 61 63 74 69 76 65 20 65 64 69 74 6f 72 |teractive editor| 00005570 2e 20 54 68 69 73 20 69 73 20 61 6e 6f 74 68 65 |. This is anothe| 00005580 72 20 6c 61 72 67 65 20 73 63 61 6c 65 20 70 72 |r large scale pr| 00005590 6f 6a 65 63 74 20 69 6e 20 69 74 73 65 6c 66 2c |oject in itself,| 000055a0 20 61 6e 64 0a 20 20 20 49 20 63 61 6e 27 74 20 | and. I can't | 000055b0 66 6f 72 73 65 65 20 68 61 76 69 6e 67 20 74 69 |forsee having ti| 000055c0 6d 65 20 74 6f 20 64 6f 20 69 74 20 66 6f 72 20 |me to do it for | 000055d0 61 20 6c 6f 6e 67 20 74 69 6d 65 2c 20 62 75 74 |a long time, but| 000055e0 20 69 74 20 77 6f 75 6c 64 20 62 65 0a 20 20 20 | it would be. | 000055f0 75 73 65 66 75 6c 2e 20 54 68 65 20 65 64 69 74 |useful. The edit| 00005600 6f 72 20 77 6f 75 6c 64 20 64 69 73 70 6c 61 79 |or would display| 00005610 20 61 20 70 72 65 6c 69 6d 69 6e 61 72 79 20 69 | a preliminary i| 00005620 6d 61 67 65 20 6f 66 20 74 68 65 20 73 63 65 6e |mage of the scen| 00005630 65 2c 20 61 6e 64 0a 20 20 20 77 68 65 6e 20 74 |e, and. when t| 00005640 68 65 20 75 73 65 72 20 68 61 64 20 70 6c 61 63 |he user had plac| 00005650 65 64 20 6f 62 6a 65 63 74 73 20 74 6f 20 68 69 |ed objects to hi| 00005660 73 20 73 61 74 69 73 66 61 63 74 69 6f 6e 2c 20 |s satisfaction, | 00005670 69 74 20 77 6f 75 6c 64 20 77 72 69 74 65 20 61 |it would write a| 00005680 0a 20 20 20 51 52 54 20 69 6e 70 75 74 20 66 69 |. QRT input fi| 00005690 6c 65 20 61 6e 64 20 63 61 6c 6c 20 51 52 54 20 |le and call QRT | 000056a0 61 73 20 61 20 62 61 63 6b 67 72 6f 75 6e 64 20 |as a background | 000056b0 74 61 73 6b 2e 20 54 68 65 72 65 20 61 72 65 20 |task. There are | 000056c0 63 65 72 74 61 69 6e 0a 20 20 20 70 72 6f 62 6c |certain. probl| 000056d0 65 6d 73 20 68 65 72 65 20 2d 20 66 6f 72 20 69 |ems here - for i| 000056e0 6e 73 74 61 6e 63 65 2c 20 68 6f 77 20 64 6f 20 |nstance, how do | 000056f0 79 6f 75 20 71 75 69 63 6b 6c 79 20 67 65 6e 65 |you quickly gene| 00005700 72 61 74 65 20 74 68 65 20 6f 75 74 6c 69 6e 65 |rate the outline| 00005710 20 6f 66 0a 20 20 20 61 20 75 73 65 72 20 64 65 | of. a user de| 00005720 66 69 6e 65 64 20 71 75 61 64 72 61 74 69 63 20 |fined quadratic | 00005730 74 68 61 74 20 63 61 6e 20 74 61 6b 65 20 6d 61 |that can take ma| 00005740 6e 79 20 66 6f 72 6d 73 20 28 63 6f 6e 65 2c 20 |ny forms (cone, | 00005750 73 70 68 65 72 6f 69 64 2c 20 65 74 63 29 3f 0a |spheroid, etc)?.| 00005760 20 20 20 41 6e 64 20 68 6f 77 20 63 61 6e 20 74 | And how can t| 00005770 68 65 20 75 73 65 72 20 65 61 73 69 6c 79 20 73 |he user easily s| 00005780 70 65 63 69 66 79 20 74 68 65 20 6f 62 6a 65 63 |pecify the objec| 00005790 74 20 74 72 65 65 20 73 74 72 75 63 74 75 72 65 |t tree structure| 000057a0 20 28 62 6f 75 6e 64 69 6e 67 0a 20 20 20 62 6f | (bounding. bo| 000057b0 78 65 73 29 20 77 69 74 68 20 61 6e 20 69 6e 74 |xes) with an int| 000057c0 65 72 61 63 74 69 76 65 20 65 64 69 74 6f 72 3f |eractive editor?| 000057d0 0a |.| 000057d1