Home » Archimedes archive » Acorn User » AU 1993-06.adf » !Render_Render » Manual
Manual
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 » Acorn User » AU 1993-06.adf » !Render_Render |
Filename: | Manual |
Read OK: | ✔ |
File size: | 2C97 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
Using Render and Compile ======================== Scenes to be rendered by Render are described by text files, containing programs written in the Script Language. These files should be stored in the 's' directory and Compiled and Rendered as described in the help file for the Render application (accessed by the Acorn User disc menu application). The Script Language =================== The Script language was designed to be as flexible as possible without being unnecessarily complicated. Their are no line numbers, variables or control structures and few commands; despite this, complicated images can be generated by comparatively simple programs or scripts. The best way to demonstrate the language is by example; the program listed in the magazine (which is on this disc in the Examples.s directory under the name 'blocks') shows the still life entitled Blocks. It won't win any awards for beauty but it does demonstrate all the commands available in the language. A glance at the script file for Blocks shows the style of the language. Commands are in lower case and can be separated by either a newline, a comma or a space, and parameters are encloses in curled brackets {}. Commands can be placed in virtually any order provided all names have been previously defined. Some commands are nested within each other and extend over many lines. The image space is described in terms of cartesian coordinates, the scale of which can be chosen arbitrarily; rotations are described in degrees about the x,y and z axes, and these are sometimes called the pitch, yaw and roll angles. Algebraic statements from Basic such as SIN() and COS() can be used as well as numeric values. The scene is described in terms of Objects. An Object is a user defined command that describes a shape; both 'sphere {}' and 'box {}' are Objects. When rendered an object is made out of a material or is covered by a texture map. A texture map can be a sprite of any mode and of any size but it must have a palette; all the sprites used must be saved as a single file. The command 'sprite {}' takes this filename as its parameter; in the example sprites are taken from the file 'txtsprt'. The command 'material {}' contains the definitions of the various materials used in the scene. A material is defined by a name, which can be of any length and can be upper or lower case, and by seven parameters. Blocks uses four materials called 'plastic', 'red', 'green' and 'gold'. The first six parameters describe the reflection of red, green and blue light, expressed on a scale of 0 to 1. The first three refer to the diffuse reflected light, and the next three to the specular reflected light. The final parameter is a power factor and controls the distribution of the specular reflections; high numbers produce a more shiny material. The description for 'plastic' specifies a diffuse reflection of 0.2 for blue light and white specular reflection of 0.8 distributed with a power factor of 10; this gives a material that looks like a shiny, dark blue plastic. The command 'define {}' not suprisingly defines an object. An object is defined in terms of points and polygons. The first parameter that follows the command is the name of the object. The command 'point {}' defines the points within an object. Any number of points can be grouped within the brackets and the command can be used any number of times in an object; points are numbered from 0 inclusively from the start of the Object. Polygons are defined by the command 'link {}'. They are formed by linking up individual points in the object, for example 'link { flat 1 2 3 4}', forms a four sided polygon from points 1 to 4. The first parameter defines whether the polygon is flat or curved, i.e. whether normal or Phong shading is applied. In looking at the definition of 'cube {}' you may notice the order of some of the polygons is a little strange. This is because a polygon should always be defined in a clockwise order from the outward face. In the case of the example, all polygons will be defined facing out from the centre of the cube so the points defining each face should follow a clockwise direction when each side is viewed from the outside. The cube consists of eight points linked together to form six polygons. Two other commands can be used in an object, namely 'shape {}' and 'surface {}'. These commands are used in 'sphere {}'. Using 'shape {}' produces a set of points formed by a rotating a vector in a plane. The first parameters set the number of points to generate and the centre of the rotation, and the rest form two cartesian vectors that define the plane. To define an approximate circle of radius 1 centred at point (0,1,0), in the z plane, you would use the command: ���shape { 12 0,1,0 1,0,0 0,0,1} as a shape of 12 sides is a fairly close approximation to a circle. The command is quite powerful as any orientation of shape is possible; in 'sphere {}' the command is used to define the 10 rings that form the majority of the sphere. The command 'surface {}' defines a set of polygons that cover a group of points. The parameters define the following: whether the surface is curved or flat, the start point for the surface, the width of the surface in points, the height in points, and two boolean parameters that control whether the surface should be joined across the width and height. The points are taken to be arranged in rows across the width of the surface; 'sphere {}' uses a surface of width 12, and height 10, joined across the width to form the sphere. An object can use any combination of these commands. The majority of 'sphere {}' is formed using 'shape {}' and 'surface {}' with the top and bottom capped using two 'point {}' commands and 24 polygons formed using 'link {}'. It is important two remember an Object must have no unused points within it and no polygons occupying the same space. Once defined an object can be placed in the scene. A defined object is treated like a command; the first three parameters define the position of the object in the scene. It is also possible to apply a number of transformations to the object; 'scale {}' requires x, y and z scale factors, and 'rotate {}' requires the pitch, yaw and roll angles. A third command, 'transform {}', takes parameters corresponding to a 3 by 3 matrix and allows more complicated distortions. Any number of transformations can be applied, allowing totally new shapes to be formed from the same object. The material an object is made from must also be specified within the command; alternatively a texture map can be applied by using 'texture {}'. The first parameter is the name of the sprite. The next three parameters define the diffuse and specular reflection, and specular distribution of the texture; a texture is considered to be of diffuse reflection with a white specular component. The sprite must be mapped onto all points in the object and points are mapped to in consecutive order from point 0. The command 'map {}' takes two parameters that describe where in the sprite a point should be mapped; the sprite is taken to have a width of 1 and height 1. The command 'fit {}' stretches the entire sprite over a range of points, and the two parameters describe the width in points and height in points over which the sprite should be fitted. The main sphere is covered by the sprite 'screendump' mapped over the sphere by the two commands. The sprite is mapped over the majority of the sphere by 'fit {}'; the sphere consists of 10 rings and each ring has 12 points, so 'fit {12 10}' is used. The two points that form the top and bottom of the sphere are mapped with 'map {0.5 0}' and 'map {0.5 1}', corresponding to the bottom and top centre of the sprite. Before a scene can be plotted the positions of the observer and the lights must be specified. The command 'light {}' describes the lighting, and the command 'view {}' describes the postion and orientation of the observer or camera. Lights are described by their rotation and elevation in the scene; an elevation of 90 defines a light overhead, and a rotation of 0 defines a light in front of the observer. The first three parameters within 'view {}' described the position of the observer and the last three correspond to the pitch, yaw and roll angles, with values of 0 meaning directly ahead. The brightness of the scene is controlled by 'ambient {}'. This specifies the contribution of randomly reflected light, in terms of the primary colours. The ambient illumination is usually very small; too much ambient light and the scene will lose contrast and will appear washed out. The final output from the renderer is defined by 'display {}'. The first parameter is the filename for the output sprite, the next defines the resolution, and the others control the x and y scaling factors of the scene and the size of the output sprite. The resolution can be low, medium or high and corresponds to mode 13, 15 or 21; the size of the sprite is defined in OS units, so a size of 1280 by 1024 is a full screen. The scaling factors control the final size of the scene, and their size is determined by the size of the objects in the scene. Script files are best written in a text editor such as Edit. It is a good idea to build up a library of commonly used objects such as 'sphere {}' or 'cube {}' which can be strung together when required. Hopefully the language is flexible enough to do all that you require from it and won't restrict the budding artist. Compiling and Rendering ======================= Once a script file is written it must be compiled before rendering can take place. The applications provided allow scripts to be compiled and rendered easily, but for the more advanced user, the programs can be used from the command line; the actual executable programs are stored inside the application directories !Compile and !Rend. Four directories are required for compiling: 's' contains the script file, 'v' contains the viewpoint data, 'd' contains the scene data, and 't' contains the texture data. The compiler can be called up by the command: ���*compile <filename> [ - s <size> ] [ -o <%> ] [ -t <%> ] [ -w] The options following the command control the memory assignments for the compiler: '-s' defines how much memory the compiler has free for data, in kilobytes. Options '-o' and '-t' express, as a percentage, how much of the memory is used to store objects and texture. The default values are: ���*compile <filename> -s 320 -o 50 -t 0.1 In use the compiler will scan through the script, and if an error is found it will report it and stop compiling. Once compilation has taken place the data is saved and a wire-frame preview of the image is drawn; this can be disabled with the '-w' option. The compiler will only save view data and object data if they are present in the script file; this allows you to alter the view point without having to re-compile the whole scene, but no preview is drawn if the compiled file contains only view or scene data. The compiler is reasonably good at trapping errors in a script file but some mistakes such as missing brackets or separators can crash the compiler and renderer. Finally the compiled script file is rendered by the renderer by: ���*render <filename> Both the compiler and the renderer require the Floating Point Emulator to be installed. They also require the file 'code' to be present in the CSD.
00000000 55 73 69 6e 67 20 52 65 6e 64 65 72 20 61 6e 64 |Using Render and| 00000010 20 43 6f 6d 70 69 6c 65 0a 3d 3d 3d 3d 3d 3d 3d | Compile.=======| 00000020 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d |================| 00000030 3d 0a 0a 53 63 65 6e 65 73 20 74 6f 20 62 65 20 |=..Scenes to be | 00000040 72 65 6e 64 65 72 65 64 20 62 79 20 52 65 6e 64 |rendered by Rend| 00000050 65 72 20 61 72 65 20 64 65 73 63 72 69 62 65 64 |er are described| 00000060 20 62 79 20 74 65 78 74 20 66 69 6c 65 73 2c 0a | by text files,.| 00000070 63 6f 6e 74 61 69 6e 69 6e 67 20 70 72 6f 67 72 |containing progr| 00000080 61 6d 73 20 77 72 69 74 74 65 6e 20 69 6e 20 74 |ams written in t| 00000090 68 65 20 53 63 72 69 70 74 20 4c 61 6e 67 75 61 |he Script Langua| 000000a0 67 65 2e 20 54 68 65 73 65 20 66 69 6c 65 73 20 |ge. These files | 000000b0 73 68 6f 75 6c 64 0a 62 65 20 73 74 6f 72 65 64 |should.be stored| 000000c0 20 69 6e 20 74 68 65 20 27 73 27 20 64 69 72 65 | in the 's' dire| 000000d0 63 74 6f 72 79 20 61 6e 64 20 43 6f 6d 70 69 6c |ctory and Compil| 000000e0 65 64 20 61 6e 64 20 52 65 6e 64 65 72 65 64 20 |ed and Rendered | 000000f0 61 73 20 64 65 73 63 72 69 62 65 64 0a 69 6e 20 |as described.in | 00000100 74 68 65 20 68 65 6c 70 20 66 69 6c 65 20 66 6f |the help file fo| 00000110 72 20 74 68 65 20 52 65 6e 64 65 72 20 61 70 70 |r the Render app| 00000120 6c 69 63 61 74 69 6f 6e 20 28 61 63 63 65 73 73 |lication (access| 00000130 65 64 20 62 79 20 74 68 65 20 41 63 6f 72 6e 0a |ed by the Acorn.| 00000140 55 73 65 72 20 64 69 73 63 20 6d 65 6e 75 20 61 |User disc menu a| 00000150 70 70 6c 69 63 61 74 69 6f 6e 29 2e 0a 0a 54 68 |pplication)...Th| 00000160 65 20 53 63 72 69 70 74 20 4c 61 6e 67 75 61 67 |e Script Languag| 00000170 65 0a 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d |e.==============| 00000180 3d 3d 3d 3d 3d 0a 0a 54 68 65 20 53 63 72 69 70 |=====..The Scrip| 00000190 74 20 6c 61 6e 67 75 61 67 65 20 77 61 73 20 64 |t language was d| 000001a0 65 73 69 67 6e 65 64 20 74 6f 20 62 65 20 61 73 |esigned to be as| 000001b0 20 66 6c 65 78 69 62 6c 65 20 61 73 20 70 6f 73 | flexible as pos| 000001c0 73 69 62 6c 65 20 77 69 74 68 6f 75 74 0a 62 65 |sible without.be| 000001d0 69 6e 67 20 75 6e 6e 65 63 65 73 73 61 72 69 6c |ing unnecessaril| 000001e0 79 20 63 6f 6d 70 6c 69 63 61 74 65 64 2e 20 54 |y complicated. T| 000001f0 68 65 69 72 20 61 72 65 20 6e 6f 20 6c 69 6e 65 |heir are no line| 00000200 20 6e 75 6d 62 65 72 73 2c 20 76 61 72 69 61 62 | numbers, variab| 00000210 6c 65 73 0a 6f 72 20 63 6f 6e 74 72 6f 6c 20 73 |les.or control s| 00000220 74 72 75 63 74 75 72 65 73 20 61 6e 64 20 66 65 |tructures and fe| 00000230 77 20 63 6f 6d 6d 61 6e 64 73 3b 20 64 65 73 70 |w commands; desp| 00000240 69 74 65 20 74 68 69 73 2c 20 63 6f 6d 70 6c 69 |ite this, compli| 00000250 63 61 74 65 64 0a 69 6d 61 67 65 73 20 63 61 6e |cated.images can| 00000260 20 62 65 20 67 65 6e 65 72 61 74 65 64 20 62 79 | be generated by| 00000270 20 63 6f 6d 70 61 72 61 74 69 76 65 6c 79 20 73 | comparatively s| 00000280 69 6d 70 6c 65 20 70 72 6f 67 72 61 6d 73 20 6f |imple programs o| 00000290 72 20 73 63 72 69 70 74 73 2e 0a 54 68 65 20 62 |r scripts..The b| 000002a0 65 73 74 20 77 61 79 20 74 6f 20 64 65 6d 6f 6e |est way to demon| 000002b0 73 74 72 61 74 65 20 74 68 65 20 6c 61 6e 67 75 |strate the langu| 000002c0 61 67 65 20 69 73 20 62 79 20 65 78 61 6d 70 6c |age is by exampl| 000002d0 65 3b 20 74 68 65 20 70 72 6f 67 72 61 6d 0a 6c |e; the program.l| 000002e0 69 73 74 65 64 20 69 6e 20 74 68 65 20 6d 61 67 |isted in the mag| 000002f0 61 7a 69 6e 65 20 28 77 68 69 63 68 20 69 73 20 |azine (which is | 00000300 6f 6e 20 74 68 69 73 20 64 69 73 63 20 69 6e 20 |on this disc in | 00000310 74 68 65 20 45 78 61 6d 70 6c 65 73 2e 73 0a 64 |the Examples.s.d| 00000320 69 72 65 63 74 6f 72 79 20 75 6e 64 65 72 20 74 |irectory under t| 00000330 68 65 20 6e 61 6d 65 20 27 62 6c 6f 63 6b 73 27 |he name 'blocks'| 00000340 29 20 73 68 6f 77 73 20 74 68 65 20 73 74 69 6c |) shows the stil| 00000350 6c 20 6c 69 66 65 20 65 6e 74 69 74 6c 65 64 0a |l life entitled.| 00000360 42 6c 6f 63 6b 73 2e 20 49 74 20 77 6f 6e 27 74 |Blocks. It won't| 00000370 20 77 69 6e 20 61 6e 79 20 61 77 61 72 64 73 20 | win any awards | 00000380 66 6f 72 20 62 65 61 75 74 79 20 62 75 74 20 69 |for beauty but i| 00000390 74 20 64 6f 65 73 20 64 65 6d 6f 6e 73 74 72 61 |t does demonstra| 000003a0 74 65 20 61 6c 6c 0a 74 68 65 20 63 6f 6d 6d 61 |te all.the comma| 000003b0 6e 64 73 20 61 76 61 69 6c 61 62 6c 65 20 69 6e |nds available in| 000003c0 20 74 68 65 20 6c 61 6e 67 75 61 67 65 2e 0a 0a | the language...| 000003d0 41 20 67 6c 61 6e 63 65 20 61 74 20 74 68 65 20 |A glance at the | 000003e0 73 63 72 69 70 74 20 66 69 6c 65 20 66 6f 72 20 |script file for | 000003f0 42 6c 6f 63 6b 73 20 73 68 6f 77 73 20 74 68 65 |Blocks shows the| 00000400 20 73 74 79 6c 65 20 6f 66 20 74 68 65 0a 6c 61 | style of the.la| 00000410 6e 67 75 61 67 65 2e 20 43 6f 6d 6d 61 6e 64 73 |nguage. Commands| 00000420 20 61 72 65 20 69 6e 20 6c 6f 77 65 72 20 63 61 | are in lower ca| 00000430 73 65 20 61 6e 64 20 63 61 6e 20 62 65 20 73 65 |se and can be se| 00000440 70 61 72 61 74 65 64 20 62 79 20 65 69 74 68 65 |parated by eithe| 00000450 72 20 61 0a 6e 65 77 6c 69 6e 65 2c 20 61 20 63 |r a.newline, a c| 00000460 6f 6d 6d 61 20 6f 72 20 61 20 73 70 61 63 65 2c |omma or a space,| 00000470 20 61 6e 64 20 70 61 72 61 6d 65 74 65 72 73 20 | and parameters | 00000480 61 72 65 20 65 6e 63 6c 6f 73 65 73 20 69 6e 20 |are encloses in | 00000490 63 75 72 6c 65 64 0a 62 72 61 63 6b 65 74 73 20 |curled.brackets | 000004a0 7b 7d 2e 20 43 6f 6d 6d 61 6e 64 73 20 63 61 6e |{}. Commands can| 000004b0 20 62 65 20 70 6c 61 63 65 64 20 69 6e 20 76 69 | be placed in vi| 000004c0 72 74 75 61 6c 6c 79 20 61 6e 79 20 6f 72 64 65 |rtually any orde| 000004d0 72 20 70 72 6f 76 69 64 65 64 0a 61 6c 6c 20 6e |r provided.all n| 000004e0 61 6d 65 73 20 68 61 76 65 20 62 65 65 6e 20 70 |ames have been p| 000004f0 72 65 76 69 6f 75 73 6c 79 20 64 65 66 69 6e 65 |reviously define| 00000500 64 2e 20 53 6f 6d 65 20 63 6f 6d 6d 61 6e 64 73 |d. Some commands| 00000510 20 61 72 65 20 6e 65 73 74 65 64 0a 77 69 74 68 | are nested.with| 00000520 69 6e 20 65 61 63 68 20 6f 74 68 65 72 20 61 6e |in each other an| 00000530 64 20 65 78 74 65 6e 64 20 6f 76 65 72 20 6d 61 |d extend over ma| 00000540 6e 79 20 6c 69 6e 65 73 2e 20 54 68 65 20 69 6d |ny lines. The im| 00000550 61 67 65 20 73 70 61 63 65 20 69 73 0a 64 65 73 |age space is.des| 00000560 63 72 69 62 65 64 20 69 6e 20 74 65 72 6d 73 20 |cribed in terms | 00000570 6f 66 20 63 61 72 74 65 73 69 61 6e 20 63 6f 6f |of cartesian coo| 00000580 72 64 69 6e 61 74 65 73 2c 20 74 68 65 20 73 63 |rdinates, the sc| 00000590 61 6c 65 20 6f 66 20 77 68 69 63 68 20 63 61 6e |ale of which can| 000005a0 20 62 65 0a 63 68 6f 73 65 6e 20 61 72 62 69 74 | be.chosen arbit| 000005b0 72 61 72 69 6c 79 3b 20 72 6f 74 61 74 69 6f 6e |rarily; rotation| 000005c0 73 20 61 72 65 20 64 65 73 63 72 69 62 65 64 20 |s are described | 000005d0 69 6e 20 64 65 67 72 65 65 73 20 61 62 6f 75 74 |in degrees about| 000005e0 20 74 68 65 20 78 2c 79 0a 61 6e 64 20 7a 20 61 | the x,y.and z a| 000005f0 78 65 73 2c 20 61 6e 64 20 74 68 65 73 65 20 61 |xes, and these a| 00000600 72 65 20 73 6f 6d 65 74 69 6d 65 73 20 63 61 6c |re sometimes cal| 00000610 6c 65 64 20 74 68 65 20 70 69 74 63 68 2c 20 79 |led the pitch, y| 00000620 61 77 20 61 6e 64 20 72 6f 6c 6c 0a 61 6e 67 6c |aw and roll.angl| 00000630 65 73 2e 20 41 6c 67 65 62 72 61 69 63 20 73 74 |es. Algebraic st| 00000640 61 74 65 6d 65 6e 74 73 20 66 72 6f 6d 20 42 61 |atements from Ba| 00000650 73 69 63 20 73 75 63 68 20 61 73 20 53 49 4e 28 |sic such as SIN(| 00000660 29 20 61 6e 64 20 43 4f 53 28 29 20 63 61 6e 20 |) and COS() can | 00000670 62 65 0a 75 73 65 64 20 61 73 20 77 65 6c 6c 20 |be.used as well | 00000680 61 73 20 6e 75 6d 65 72 69 63 20 76 61 6c 75 65 |as numeric value| 00000690 73 2e 0a 0a 54 68 65 20 73 63 65 6e 65 20 69 73 |s...The scene is| 000006a0 20 64 65 73 63 72 69 62 65 64 20 69 6e 20 74 65 | described in te| 000006b0 72 6d 73 20 6f 66 20 4f 62 6a 65 63 74 73 2e 20 |rms of Objects. | 000006c0 41 6e 20 4f 62 6a 65 63 74 20 69 73 20 61 20 75 |An Object is a u| 000006d0 73 65 72 0a 64 65 66 69 6e 65 64 20 63 6f 6d 6d |ser.defined comm| 000006e0 61 6e 64 20 74 68 61 74 20 64 65 73 63 72 69 62 |and that describ| 000006f0 65 73 20 61 20 73 68 61 70 65 3b 20 62 6f 74 68 |es a shape; both| 00000700 20 27 73 70 68 65 72 65 20 7b 7d 27 20 61 6e 64 | 'sphere {}' and| 00000710 20 27 62 6f 78 20 7b 7d 27 0a 61 72 65 20 4f 62 | 'box {}'.are Ob| 00000720 6a 65 63 74 73 2e 20 57 68 65 6e 20 72 65 6e 64 |jects. When rend| 00000730 65 72 65 64 20 61 6e 20 6f 62 6a 65 63 74 20 69 |ered an object i| 00000740 73 20 6d 61 64 65 20 6f 75 74 20 6f 66 20 61 20 |s made out of a | 00000750 6d 61 74 65 72 69 61 6c 20 6f 72 20 69 73 0a 63 |material or is.c| 00000760 6f 76 65 72 65 64 20 62 79 20 61 20 74 65 78 74 |overed by a text| 00000770 75 72 65 20 6d 61 70 2e 0a 0a 41 20 74 65 78 74 |ure map...A text| 00000780 75 72 65 20 6d 61 70 20 63 61 6e 20 62 65 20 61 |ure map can be a| 00000790 20 73 70 72 69 74 65 20 6f 66 20 61 6e 79 20 6d | sprite of any m| 000007a0 6f 64 65 20 61 6e 64 20 6f 66 20 61 6e 79 20 73 |ode and of any s| 000007b0 69 7a 65 20 62 75 74 20 69 74 20 6d 75 73 74 0a |ize but it must.| 000007c0 68 61 76 65 20 61 20 70 61 6c 65 74 74 65 3b 20 |have a palette; | 000007d0 61 6c 6c 20 74 68 65 20 73 70 72 69 74 65 73 20 |all the sprites | 000007e0 75 73 65 64 20 6d 75 73 74 20 62 65 20 73 61 76 |used must be sav| 000007f0 65 64 20 61 73 20 61 20 73 69 6e 67 6c 65 20 66 |ed as a single f| 00000800 69 6c 65 2e 0a 54 68 65 20 63 6f 6d 6d 61 6e 64 |ile..The command| 00000810 20 27 73 70 72 69 74 65 20 7b 7d 27 20 74 61 6b | 'sprite {}' tak| 00000820 65 73 20 74 68 69 73 20 66 69 6c 65 6e 61 6d 65 |es this filename| 00000830 20 61 73 20 69 74 73 20 70 61 72 61 6d 65 74 65 | as its paramete| 00000840 72 3b 20 69 6e 20 74 68 65 0a 65 78 61 6d 70 6c |r; in the.exampl| 00000850 65 20 73 70 72 69 74 65 73 20 61 72 65 20 74 61 |e sprites are ta| 00000860 6b 65 6e 20 66 72 6f 6d 20 74 68 65 20 66 69 6c |ken from the fil| 00000870 65 20 27 74 78 74 73 70 72 74 27 2e 0a 0a 54 68 |e 'txtsprt'...Th| 00000880 65 20 63 6f 6d 6d 61 6e 64 20 27 6d 61 74 65 72 |e command 'mater| 00000890 69 61 6c 20 7b 7d 27 20 63 6f 6e 74 61 69 6e 73 |ial {}' contains| 000008a0 20 74 68 65 20 64 65 66 69 6e 69 74 69 6f 6e 73 | the definitions| 000008b0 20 6f 66 20 74 68 65 20 76 61 72 69 6f 75 73 0a | of the various.| 000008c0 6d 61 74 65 72 69 61 6c 73 20 75 73 65 64 20 69 |materials used i| 000008d0 6e 20 74 68 65 20 73 63 65 6e 65 2e 20 41 20 6d |n the scene. A m| 000008e0 61 74 65 72 69 61 6c 20 69 73 20 64 65 66 69 6e |aterial is defin| 000008f0 65 64 20 62 79 20 61 20 6e 61 6d 65 2c 20 77 68 |ed by a name, wh| 00000900 69 63 68 0a 63 61 6e 20 62 65 20 6f 66 20 61 6e |ich.can be of an| 00000910 79 20 6c 65 6e 67 74 68 20 61 6e 64 20 63 61 6e |y length and can| 00000920 20 62 65 20 75 70 70 65 72 20 6f 72 20 6c 6f 77 | be upper or low| 00000930 65 72 20 63 61 73 65 2c 20 61 6e 64 20 62 79 20 |er case, and by | 00000940 73 65 76 65 6e 0a 70 61 72 61 6d 65 74 65 72 73 |seven.parameters| 00000950 2e 20 42 6c 6f 63 6b 73 20 75 73 65 73 20 66 6f |. Blocks uses fo| 00000960 75 72 20 6d 61 74 65 72 69 61 6c 73 20 63 61 6c |ur materials cal| 00000970 6c 65 64 20 27 70 6c 61 73 74 69 63 27 2c 20 27 |led 'plastic', '| 00000980 72 65 64 27 2c 0a 27 67 72 65 65 6e 27 20 61 6e |red',.'green' an| 00000990 64 20 27 67 6f 6c 64 27 2e 20 54 68 65 20 66 69 |d 'gold'. The fi| 000009a0 72 73 74 20 73 69 78 20 70 61 72 61 6d 65 74 65 |rst six paramete| 000009b0 72 73 20 64 65 73 63 72 69 62 65 20 74 68 65 20 |rs describe the | 000009c0 72 65 66 6c 65 63 74 69 6f 6e 0a 6f 66 20 72 65 |reflection.of re| 000009d0 64 2c 20 67 72 65 65 6e 20 61 6e 64 20 62 6c 75 |d, green and blu| 000009e0 65 20 6c 69 67 68 74 2c 20 65 78 70 72 65 73 73 |e light, express| 000009f0 65 64 20 6f 6e 20 61 20 73 63 61 6c 65 20 6f 66 |ed on a scale of| 00000a00 20 30 20 74 6f 20 31 2e 20 54 68 65 0a 66 69 72 | 0 to 1. The.fir| 00000a10 73 74 20 74 68 72 65 65 20 72 65 66 65 72 20 74 |st three refer t| 00000a20 6f 20 74 68 65 20 64 69 66 66 75 73 65 20 72 65 |o the diffuse re| 00000a30 66 6c 65 63 74 65 64 20 6c 69 67 68 74 2c 20 61 |flected light, a| 00000a40 6e 64 20 74 68 65 20 6e 65 78 74 20 74 68 72 65 |nd the next thre| 00000a50 65 0a 74 6f 20 74 68 65 20 73 70 65 63 75 6c 61 |e.to the specula| 00000a60 72 20 72 65 66 6c 65 63 74 65 64 20 6c 69 67 68 |r reflected ligh| 00000a70 74 2e 20 54 68 65 20 66 69 6e 61 6c 20 70 61 72 |t. The final par| 00000a80 61 6d 65 74 65 72 20 69 73 20 61 20 70 6f 77 65 |ameter is a powe| 00000a90 72 20 66 61 63 74 6f 72 0a 61 6e 64 20 63 6f 6e |r factor.and con| 00000aa0 74 72 6f 6c 73 20 74 68 65 20 64 69 73 74 72 69 |trols the distri| 00000ab0 62 75 74 69 6f 6e 20 6f 66 20 74 68 65 20 73 70 |bution of the sp| 00000ac0 65 63 75 6c 61 72 20 72 65 66 6c 65 63 74 69 6f |ecular reflectio| 00000ad0 6e 73 3b 20 68 69 67 68 0a 6e 75 6d 62 65 72 73 |ns; high.numbers| 00000ae0 20 70 72 6f 64 75 63 65 20 61 20 6d 6f 72 65 20 | produce a more | 00000af0 73 68 69 6e 79 20 6d 61 74 65 72 69 61 6c 2e 20 |shiny material. | 00000b00 54 68 65 20 64 65 73 63 72 69 70 74 69 6f 6e 20 |The description | 00000b10 66 6f 72 20 27 70 6c 61 73 74 69 63 27 0a 73 70 |for 'plastic'.sp| 00000b20 65 63 69 66 69 65 73 20 61 20 64 69 66 66 75 73 |ecifies a diffus| 00000b30 65 20 72 65 66 6c 65 63 74 69 6f 6e 20 6f 66 20 |e reflection of | 00000b40 30 2e 32 20 66 6f 72 20 62 6c 75 65 20 6c 69 67 |0.2 for blue lig| 00000b50 68 74 20 61 6e 64 20 77 68 69 74 65 0a 73 70 65 |ht and white.spe| 00000b60 63 75 6c 61 72 20 72 65 66 6c 65 63 74 69 6f 6e |cular reflection| 00000b70 20 6f 66 20 30 2e 38 20 64 69 73 74 72 69 62 75 | of 0.8 distribu| 00000b80 74 65 64 20 77 69 74 68 20 61 20 70 6f 77 65 72 |ted with a power| 00000b90 20 66 61 63 74 6f 72 20 6f 66 20 31 30 3b 20 74 | factor of 10; t| 00000ba0 68 69 73 0a 67 69 76 65 73 20 61 20 6d 61 74 65 |his.gives a mate| 00000bb0 72 69 61 6c 20 74 68 61 74 20 6c 6f 6f 6b 73 20 |rial that looks | 00000bc0 6c 69 6b 65 20 61 20 73 68 69 6e 79 2c 20 64 61 |like a shiny, da| 00000bd0 72 6b 20 62 6c 75 65 20 70 6c 61 73 74 69 63 2e |rk blue plastic.| 00000be0 0a 0a 54 68 65 20 63 6f 6d 6d 61 6e 64 20 27 64 |..The command 'd| 00000bf0 65 66 69 6e 65 20 7b 7d 27 20 6e 6f 74 20 73 75 |efine {}' not su| 00000c00 70 72 69 73 69 6e 67 6c 79 20 64 65 66 69 6e 65 |prisingly define| 00000c10 73 20 61 6e 20 6f 62 6a 65 63 74 2e 20 41 6e 20 |s an object. An | 00000c20 6f 62 6a 65 63 74 0a 69 73 20 64 65 66 69 6e 65 |object.is define| 00000c30 64 20 69 6e 20 74 65 72 6d 73 20 6f 66 20 70 6f |d in terms of po| 00000c40 69 6e 74 73 20 61 6e 64 20 70 6f 6c 79 67 6f 6e |ints and polygon| 00000c50 73 2e 20 54 68 65 20 66 69 72 73 74 20 70 61 72 |s. The first par| 00000c60 61 6d 65 74 65 72 20 74 68 61 74 0a 66 6f 6c 6c |ameter that.foll| 00000c70 6f 77 73 20 74 68 65 20 63 6f 6d 6d 61 6e 64 20 |ows the command | 00000c80 69 73 20 74 68 65 20 6e 61 6d 65 20 6f 66 20 74 |is the name of t| 00000c90 68 65 20 6f 62 6a 65 63 74 2e 0a 0a 54 68 65 20 |he object...The | 00000ca0 63 6f 6d 6d 61 6e 64 20 27 70 6f 69 6e 74 20 7b |command 'point {| 00000cb0 7d 27 20 64 65 66 69 6e 65 73 20 74 68 65 20 70 |}' defines the p| 00000cc0 6f 69 6e 74 73 20 77 69 74 68 69 6e 20 61 6e 20 |oints within an | 00000cd0 6f 62 6a 65 63 74 2e 20 41 6e 79 20 6e 75 6d 62 |object. Any numb| 00000ce0 65 72 0a 6f 66 20 70 6f 69 6e 74 73 20 63 61 6e |er.of points can| 00000cf0 20 62 65 20 67 72 6f 75 70 65 64 20 77 69 74 68 | be grouped with| 00000d00 69 6e 20 74 68 65 20 62 72 61 63 6b 65 74 73 20 |in the brackets | 00000d10 61 6e 64 20 74 68 65 20 63 6f 6d 6d 61 6e 64 20 |and the command | 00000d20 63 61 6e 20 62 65 0a 75 73 65 64 20 61 6e 79 20 |can be.used any | 00000d30 6e 75 6d 62 65 72 20 6f 66 20 74 69 6d 65 73 20 |number of times | 00000d40 69 6e 20 61 6e 20 6f 62 6a 65 63 74 3b 20 70 6f |in an object; po| 00000d50 69 6e 74 73 20 61 72 65 20 6e 75 6d 62 65 72 65 |ints are numbere| 00000d60 64 20 66 72 6f 6d 20 30 0a 69 6e 63 6c 75 73 69 |d from 0.inclusi| 00000d70 76 65 6c 79 20 66 72 6f 6d 20 74 68 65 20 73 74 |vely from the st| 00000d80 61 72 74 20 6f 66 20 74 68 65 20 4f 62 6a 65 63 |art of the Objec| 00000d90 74 2e 0a 0a 50 6f 6c 79 67 6f 6e 73 20 61 72 65 |t...Polygons are| 00000da0 20 64 65 66 69 6e 65 64 20 62 79 20 74 68 65 20 | defined by the | 00000db0 63 6f 6d 6d 61 6e 64 20 27 6c 69 6e 6b 20 7b 7d |command 'link {}| 00000dc0 27 2e 20 54 68 65 79 20 61 72 65 20 66 6f 72 6d |'. They are form| 00000dd0 65 64 20 62 79 0a 6c 69 6e 6b 69 6e 67 20 75 70 |ed by.linking up| 00000de0 20 69 6e 64 69 76 69 64 75 61 6c 20 70 6f 69 6e | individual poin| 00000df0 74 73 20 69 6e 20 74 68 65 20 6f 62 6a 65 63 74 |ts in the object| 00000e00 2c 20 66 6f 72 20 65 78 61 6d 70 6c 65 20 27 6c |, for example 'l| 00000e10 69 6e 6b 20 7b 20 66 6c 61 74 20 31 0a 32 20 33 |ink { flat 1.2 3| 00000e20 20 34 7d 27 2c 20 66 6f 72 6d 73 20 61 20 66 6f | 4}', forms a fo| 00000e30 75 72 20 73 69 64 65 64 20 70 6f 6c 79 67 6f 6e |ur sided polygon| 00000e40 20 66 72 6f 6d 20 70 6f 69 6e 74 73 20 31 20 74 | from points 1 t| 00000e50 6f 20 34 2e 20 54 68 65 20 66 69 72 73 74 0a 70 |o 4. The first.p| 00000e60 61 72 61 6d 65 74 65 72 20 64 65 66 69 6e 65 73 |arameter defines| 00000e70 20 77 68 65 74 68 65 72 20 74 68 65 20 70 6f 6c | whether the pol| 00000e80 79 67 6f 6e 20 69 73 20 66 6c 61 74 20 6f 72 20 |ygon is flat or | 00000e90 63 75 72 76 65 64 2c 20 69 2e 65 2e 20 77 68 65 |curved, i.e. whe| 00000ea0 74 68 65 72 0a 6e 6f 72 6d 61 6c 20 6f 72 20 50 |ther.normal or P| 00000eb0 68 6f 6e 67 20 73 68 61 64 69 6e 67 20 69 73 20 |hong shading is | 00000ec0 61 70 70 6c 69 65 64 2e 0a 0a 49 6e 20 6c 6f 6f |applied...In loo| 00000ed0 6b 69 6e 67 20 61 74 20 74 68 65 20 64 65 66 69 |king at the defi| 00000ee0 6e 69 74 69 6f 6e 20 6f 66 20 27 63 75 62 65 20 |nition of 'cube | 00000ef0 7b 7d 27 20 79 6f 75 20 6d 61 79 20 6e 6f 74 69 |{}' you may noti| 00000f00 63 65 20 74 68 65 20 6f 72 64 65 72 20 6f 66 0a |ce the order of.| 00000f10 73 6f 6d 65 20 6f 66 20 74 68 65 20 70 6f 6c 79 |some of the poly| 00000f20 67 6f 6e 73 20 69 73 20 61 20 6c 69 74 74 6c 65 |gons is a little| 00000f30 20 73 74 72 61 6e 67 65 2e 20 54 68 69 73 20 69 | strange. This i| 00000f40 73 20 62 65 63 61 75 73 65 20 61 20 70 6f 6c 79 |s because a poly| 00000f50 67 6f 6e 0a 73 68 6f 75 6c 64 20 61 6c 77 61 79 |gon.should alway| 00000f60 73 20 62 65 20 64 65 66 69 6e 65 64 20 69 6e 20 |s be defined in | 00000f70 61 20 63 6c 6f 63 6b 77 69 73 65 20 6f 72 64 65 |a clockwise orde| 00000f80 72 20 66 72 6f 6d 20 74 68 65 20 6f 75 74 77 61 |r from the outwa| 00000f90 72 64 20 66 61 63 65 2e 0a 49 6e 20 74 68 65 20 |rd face..In the | 00000fa0 63 61 73 65 20 6f 66 20 74 68 65 20 65 78 61 6d |case of the exam| 00000fb0 70 6c 65 2c 20 61 6c 6c 20 70 6f 6c 79 67 6f 6e |ple, all polygon| 00000fc0 73 20 77 69 6c 6c 20 62 65 20 64 65 66 69 6e 65 |s will be define| 00000fd0 64 20 66 61 63 69 6e 67 20 6f 75 74 0a 66 72 6f |d facing out.fro| 00000fe0 6d 20 74 68 65 20 63 65 6e 74 72 65 20 6f 66 20 |m the centre of | 00000ff0 74 68 65 20 63 75 62 65 20 73 6f 20 74 68 65 20 |the cube so the | 00001000 70 6f 69 6e 74 73 20 64 65 66 69 6e 69 6e 67 20 |points defining | 00001010 65 61 63 68 20 66 61 63 65 20 73 68 6f 75 6c 64 |each face should| 00001020 0a 66 6f 6c 6c 6f 77 20 61 20 63 6c 6f 63 6b 77 |.follow a clockw| 00001030 69 73 65 20 64 69 72 65 63 74 69 6f 6e 20 77 68 |ise direction wh| 00001040 65 6e 20 65 61 63 68 20 73 69 64 65 20 69 73 20 |en each side is | 00001050 76 69 65 77 65 64 20 66 72 6f 6d 20 74 68 65 0a |viewed from the.| 00001060 6f 75 74 73 69 64 65 2e 20 54 68 65 20 63 75 62 |outside. The cub| 00001070 65 20 63 6f 6e 73 69 73 74 73 20 6f 66 20 65 69 |e consists of ei| 00001080 67 68 74 20 70 6f 69 6e 74 73 20 6c 69 6e 6b 65 |ght points linke| 00001090 64 20 74 6f 67 65 74 68 65 72 20 74 6f 20 66 6f |d together to fo| 000010a0 72 6d 20 73 69 78 0a 70 6f 6c 79 67 6f 6e 73 2e |rm six.polygons.| 000010b0 0a 0a 54 77 6f 20 6f 74 68 65 72 20 63 6f 6d 6d |..Two other comm| 000010c0 61 6e 64 73 20 63 61 6e 20 62 65 20 75 73 65 64 |ands can be used| 000010d0 20 69 6e 20 61 6e 20 6f 62 6a 65 63 74 2c 20 6e | in an object, n| 000010e0 61 6d 65 6c 79 20 27 73 68 61 70 65 20 7b 7d 27 |amely 'shape {}'| 000010f0 20 61 6e 64 0a 27 73 75 72 66 61 63 65 20 7b 7d | and.'surface {}| 00001100 27 2e 20 54 68 65 73 65 20 63 6f 6d 6d 61 6e 64 |'. These command| 00001110 73 20 61 72 65 20 75 73 65 64 20 69 6e 20 27 73 |s are used in 's| 00001120 70 68 65 72 65 20 7b 7d 27 2e 20 55 73 69 6e 67 |phere {}'. Using| 00001130 20 27 73 68 61 70 65 20 7b 7d 27 0a 70 72 6f 64 | 'shape {}'.prod| 00001140 75 63 65 73 20 61 20 73 65 74 20 6f 66 20 70 6f |uces a set of po| 00001150 69 6e 74 73 20 66 6f 72 6d 65 64 20 62 79 20 61 |ints formed by a| 00001160 20 72 6f 74 61 74 69 6e 67 20 61 20 76 65 63 74 | rotating a vect| 00001170 6f 72 20 69 6e 20 61 20 70 6c 61 6e 65 2e 20 54 |or in a plane. T| 00001180 68 65 0a 66 69 72 73 74 20 70 61 72 61 6d 65 74 |he.first paramet| 00001190 65 72 73 20 73 65 74 20 74 68 65 20 6e 75 6d 62 |ers set the numb| 000011a0 65 72 20 6f 66 20 70 6f 69 6e 74 73 20 74 6f 20 |er of points to | 000011b0 67 65 6e 65 72 61 74 65 20 61 6e 64 20 74 68 65 |generate and the| 000011c0 20 63 65 6e 74 72 65 0a 6f 66 20 74 68 65 20 72 | centre.of the r| 000011d0 6f 74 61 74 69 6f 6e 2c 20 61 6e 64 20 74 68 65 |otation, and the| 000011e0 20 72 65 73 74 20 66 6f 72 6d 20 74 77 6f 20 63 | rest form two c| 000011f0 61 72 74 65 73 69 61 6e 20 76 65 63 74 6f 72 73 |artesian vectors| 00001200 20 74 68 61 74 20 64 65 66 69 6e 65 0a 74 68 65 | that define.the| 00001210 20 70 6c 61 6e 65 2e 20 54 6f 20 64 65 66 69 6e | plane. To defin| 00001220 65 20 61 6e 20 61 70 70 72 6f 78 69 6d 61 74 65 |e an approximate| 00001230 20 63 69 72 63 6c 65 20 6f 66 20 72 61 64 69 75 | circle of radiu| 00001240 73 20 31 20 63 65 6e 74 72 65 64 20 61 74 0a 70 |s 1 centred at.p| 00001250 6f 69 6e 74 20 28 30 2c 31 2c 30 29 2c 20 69 6e |oint (0,1,0), in| 00001260 20 74 68 65 20 7a 20 70 6c 61 6e 65 2c 20 79 6f | the z plane, yo| 00001270 75 20 77 6f 75 6c 64 20 75 73 65 20 74 68 65 20 |u would use the | 00001280 63 6f 6d 6d 61 6e 64 3a 0a a0 a0 a0 73 68 61 70 |command:....shap| 00001290 65 20 7b 20 31 32 20 30 2c 31 2c 30 20 31 2c 30 |e { 12 0,1,0 1,0| 000012a0 2c 30 20 30 2c 30 2c 31 7d 0a 61 73 20 61 20 73 |,0 0,0,1}.as a s| 000012b0 68 61 70 65 20 6f 66 20 31 32 20 73 69 64 65 73 |hape of 12 sides| 000012c0 20 69 73 20 61 20 66 61 69 72 6c 79 20 63 6c 6f | is a fairly clo| 000012d0 73 65 20 61 70 70 72 6f 78 69 6d 61 74 69 6f 6e |se approximation| 000012e0 20 74 6f 20 61 20 63 69 72 63 6c 65 2e 0a 54 68 | to a circle..Th| 000012f0 65 20 63 6f 6d 6d 61 6e 64 20 69 73 20 71 75 69 |e command is qui| 00001300 74 65 20 70 6f 77 65 72 66 75 6c 20 61 73 20 61 |te powerful as a| 00001310 6e 79 20 6f 72 69 65 6e 74 61 74 69 6f 6e 20 6f |ny orientation o| 00001320 66 20 73 68 61 70 65 20 69 73 20 70 6f 73 73 69 |f shape is possi| 00001330 62 6c 65 3b 0a 69 6e 20 27 73 70 68 65 72 65 20 |ble;.in 'sphere | 00001340 7b 7d 27 20 74 68 65 20 63 6f 6d 6d 61 6e 64 20 |{}' the command | 00001350 69 73 20 75 73 65 64 20 74 6f 20 64 65 66 69 6e |is used to defin| 00001360 65 20 74 68 65 20 31 30 20 72 69 6e 67 73 20 74 |e the 10 rings t| 00001370 68 61 74 20 66 6f 72 6d 0a 74 68 65 20 6d 61 6a |hat form.the maj| 00001380 6f 72 69 74 79 20 6f 66 20 74 68 65 20 73 70 68 |ority of the sph| 00001390 65 72 65 2e 0a 0a 54 68 65 20 63 6f 6d 6d 61 6e |ere...The comman| 000013a0 64 20 27 73 75 72 66 61 63 65 20 7b 7d 27 20 64 |d 'surface {}' d| 000013b0 65 66 69 6e 65 73 20 61 20 73 65 74 20 6f 66 20 |efines a set of | 000013c0 70 6f 6c 79 67 6f 6e 73 20 74 68 61 74 20 63 6f |polygons that co| 000013d0 76 65 72 20 61 20 67 72 6f 75 70 0a 6f 66 20 70 |ver a group.of p| 000013e0 6f 69 6e 74 73 2e 20 54 68 65 20 70 61 72 61 6d |oints. The param| 000013f0 65 74 65 72 73 20 64 65 66 69 6e 65 20 74 68 65 |eters define the| 00001400 20 66 6f 6c 6c 6f 77 69 6e 67 3a 20 77 68 65 74 | following: whet| 00001410 68 65 72 20 74 68 65 20 73 75 72 66 61 63 65 20 |her the surface | 00001420 69 73 0a 63 75 72 76 65 64 20 6f 72 20 66 6c 61 |is.curved or fla| 00001430 74 2c 20 74 68 65 20 73 74 61 72 74 20 70 6f 69 |t, the start poi| 00001440 6e 74 20 66 6f 72 20 74 68 65 20 73 75 72 66 61 |nt for the surfa| 00001450 63 65 2c 20 74 68 65 20 77 69 64 74 68 20 6f 66 |ce, the width of| 00001460 20 74 68 65 0a 73 75 72 66 61 63 65 20 69 6e 20 | the.surface in | 00001470 70 6f 69 6e 74 73 2c 20 74 68 65 20 68 65 69 67 |points, the heig| 00001480 68 74 20 69 6e 20 70 6f 69 6e 74 73 2c 20 61 6e |ht in points, an| 00001490 64 20 74 77 6f 20 62 6f 6f 6c 65 61 6e 20 70 61 |d two boolean pa| 000014a0 72 61 6d 65 74 65 72 73 0a 74 68 61 74 20 63 6f |rameters.that co| 000014b0 6e 74 72 6f 6c 20 77 68 65 74 68 65 72 20 74 68 |ntrol whether th| 000014c0 65 20 73 75 72 66 61 63 65 20 73 68 6f 75 6c 64 |e surface should| 000014d0 20 62 65 20 6a 6f 69 6e 65 64 20 61 63 72 6f 73 | be joined acros| 000014e0 73 20 74 68 65 20 77 69 64 74 68 20 61 6e 64 0a |s the width and.| 000014f0 68 65 69 67 68 74 2e 20 54 68 65 20 70 6f 69 6e |height. The poin| 00001500 74 73 20 61 72 65 20 74 61 6b 65 6e 20 74 6f 20 |ts are taken to | 00001510 62 65 20 61 72 72 61 6e 67 65 64 20 69 6e 20 72 |be arranged in r| 00001520 6f 77 73 20 61 63 72 6f 73 73 20 74 68 65 20 77 |ows across the w| 00001530 69 64 74 68 0a 6f 66 20 74 68 65 20 73 75 72 66 |idth.of the surf| 00001540 61 63 65 3b 20 27 73 70 68 65 72 65 20 7b 7d 27 |ace; 'sphere {}'| 00001550 20 75 73 65 73 20 61 20 73 75 72 66 61 63 65 20 | uses a surface | 00001560 6f 66 20 77 69 64 74 68 20 31 32 2c 20 61 6e 64 |of width 12, and| 00001570 20 68 65 69 67 68 74 20 31 30 2c 0a 6a 6f 69 6e | height 10,.join| 00001580 65 64 20 61 63 72 6f 73 73 20 74 68 65 20 77 69 |ed across the wi| 00001590 64 74 68 20 74 6f 20 66 6f 72 6d 20 74 68 65 20 |dth to form the | 000015a0 73 70 68 65 72 65 2e 0a 0a 41 6e 20 6f 62 6a 65 |sphere...An obje| 000015b0 63 74 20 63 61 6e 20 75 73 65 20 61 6e 79 20 63 |ct can use any c| 000015c0 6f 6d 62 69 6e 61 74 69 6f 6e 20 6f 66 20 74 68 |ombination of th| 000015d0 65 73 65 20 63 6f 6d 6d 61 6e 64 73 2e 20 54 68 |ese commands. Th| 000015e0 65 20 6d 61 6a 6f 72 69 74 79 20 6f 66 0a 27 73 |e majority of.'s| 000015f0 70 68 65 72 65 20 7b 7d 27 20 69 73 20 66 6f 72 |phere {}' is for| 00001600 6d 65 64 20 75 73 69 6e 67 20 27 73 68 61 70 65 |med using 'shape| 00001610 20 7b 7d 27 20 61 6e 64 20 27 73 75 72 66 61 63 | {}' and 'surfac| 00001620 65 20 7b 7d 27 20 77 69 74 68 20 74 68 65 20 74 |e {}' with the t| 00001630 6f 70 0a 61 6e 64 20 62 6f 74 74 6f 6d 20 63 61 |op.and bottom ca| 00001640 70 70 65 64 20 75 73 69 6e 67 20 74 77 6f 20 27 |pped using two '| 00001650 70 6f 69 6e 74 20 7b 7d 27 20 63 6f 6d 6d 61 6e |point {}' comman| 00001660 64 73 20 61 6e 64 20 32 34 20 70 6f 6c 79 67 6f |ds and 24 polygo| 00001670 6e 73 20 66 6f 72 6d 65 64 0a 75 73 69 6e 67 20 |ns formed.using | 00001680 27 6c 69 6e 6b 20 7b 7d 27 2e 20 49 74 20 69 73 |'link {}'. It is| 00001690 20 69 6d 70 6f 72 74 61 6e 74 20 74 77 6f 20 72 | important two r| 000016a0 65 6d 65 6d 62 65 72 20 61 6e 20 4f 62 6a 65 63 |emember an Objec| 000016b0 74 20 6d 75 73 74 20 68 61 76 65 20 6e 6f 0a 75 |t must have no.u| 000016c0 6e 75 73 65 64 20 70 6f 69 6e 74 73 20 77 69 74 |nused points wit| 000016d0 68 69 6e 20 69 74 20 61 6e 64 20 6e 6f 20 70 6f |hin it and no po| 000016e0 6c 79 67 6f 6e 73 20 6f 63 63 75 70 79 69 6e 67 |lygons occupying| 000016f0 20 74 68 65 20 73 61 6d 65 20 73 70 61 63 65 2e | the same space.| 00001700 0a 0a 4f 6e 63 65 20 64 65 66 69 6e 65 64 20 61 |..Once defined a| 00001710 6e 20 6f 62 6a 65 63 74 20 63 61 6e 20 62 65 20 |n object can be | 00001720 70 6c 61 63 65 64 20 69 6e 20 74 68 65 20 73 63 |placed in the sc| 00001730 65 6e 65 2e 20 41 20 64 65 66 69 6e 65 64 20 6f |ene. A defined o| 00001740 62 6a 65 63 74 20 69 73 0a 74 72 65 61 74 65 64 |bject is.treated| 00001750 20 6c 69 6b 65 20 61 20 63 6f 6d 6d 61 6e 64 3b | like a command;| 00001760 20 74 68 65 20 66 69 72 73 74 20 74 68 72 65 65 | the first three| 00001770 20 70 61 72 61 6d 65 74 65 72 73 20 64 65 66 69 | parameters defi| 00001780 6e 65 20 74 68 65 20 70 6f 73 69 74 69 6f 6e 0a |ne the position.| 00001790 6f 66 20 74 68 65 20 6f 62 6a 65 63 74 20 69 6e |of the object in| 000017a0 20 74 68 65 20 73 63 65 6e 65 2e 20 49 74 20 69 | the scene. It i| 000017b0 73 20 61 6c 73 6f 20 70 6f 73 73 69 62 6c 65 20 |s also possible | 000017c0 74 6f 20 61 70 70 6c 79 20 61 20 6e 75 6d 62 65 |to apply a numbe| 000017d0 72 20 6f 66 0a 74 72 61 6e 73 66 6f 72 6d 61 74 |r of.transformat| 000017e0 69 6f 6e 73 20 74 6f 20 74 68 65 20 6f 62 6a 65 |ions to the obje| 000017f0 63 74 3b 20 27 73 63 61 6c 65 20 7b 7d 27 20 72 |ct; 'scale {}' r| 00001800 65 71 75 69 72 65 73 20 78 2c 20 79 20 61 6e 64 |equires x, y and| 00001810 20 7a 20 73 63 61 6c 65 0a 66 61 63 74 6f 72 73 | z scale.factors| 00001820 2c 20 61 6e 64 20 27 72 6f 74 61 74 65 20 7b 7d |, and 'rotate {}| 00001830 27 20 72 65 71 75 69 72 65 73 20 74 68 65 20 70 |' requires the p| 00001840 69 74 63 68 2c 20 79 61 77 20 61 6e 64 20 72 6f |itch, yaw and ro| 00001850 6c 6c 20 61 6e 67 6c 65 73 2e 20 41 0a 74 68 69 |ll angles. A.thi| 00001860 72 64 20 63 6f 6d 6d 61 6e 64 2c 20 27 74 72 61 |rd command, 'tra| 00001870 6e 73 66 6f 72 6d 20 7b 7d 27 2c 20 74 61 6b 65 |nsform {}', take| 00001880 73 20 70 61 72 61 6d 65 74 65 72 73 20 63 6f 72 |s parameters cor| 00001890 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 61 20 |responding to a | 000018a0 33 0a 62 79 20 33 20 6d 61 74 72 69 78 20 61 6e |3.by 3 matrix an| 000018b0 64 20 61 6c 6c 6f 77 73 20 6d 6f 72 65 20 63 6f |d allows more co| 000018c0 6d 70 6c 69 63 61 74 65 64 20 64 69 73 74 6f 72 |mplicated distor| 000018d0 74 69 6f 6e 73 2e 20 41 6e 79 20 6e 75 6d 62 65 |tions. Any numbe| 000018e0 72 20 6f 66 0a 74 72 61 6e 73 66 6f 72 6d 61 74 |r of.transformat| 000018f0 69 6f 6e 73 20 63 61 6e 20 62 65 20 61 70 70 6c |ions can be appl| 00001900 69 65 64 2c 20 61 6c 6c 6f 77 69 6e 67 20 74 6f |ied, allowing to| 00001910 74 61 6c 6c 79 20 6e 65 77 20 73 68 61 70 65 73 |tally new shapes| 00001920 20 74 6f 20 62 65 0a 66 6f 72 6d 65 64 20 66 72 | to be.formed fr| 00001930 6f 6d 20 74 68 65 20 73 61 6d 65 20 6f 62 6a 65 |om the same obje| 00001940 63 74 2e 0a 0a 54 68 65 20 6d 61 74 65 72 69 61 |ct...The materia| 00001950 6c 20 61 6e 20 6f 62 6a 65 63 74 20 69 73 20 6d |l an object is m| 00001960 61 64 65 20 66 72 6f 6d 20 6d 75 73 74 20 61 6c |ade from must al| 00001970 73 6f 20 62 65 20 73 70 65 63 69 66 69 65 64 20 |so be specified | 00001980 77 69 74 68 69 6e 20 74 68 65 0a 63 6f 6d 6d 61 |within the.comma| 00001990 6e 64 3b 20 61 6c 74 65 72 6e 61 74 69 76 65 6c |nd; alternativel| 000019a0 79 20 61 20 74 65 78 74 75 72 65 20 6d 61 70 20 |y a texture map | 000019b0 63 61 6e 20 62 65 20 61 70 70 6c 69 65 64 20 62 |can be applied b| 000019c0 79 20 75 73 69 6e 67 20 27 74 65 78 74 75 72 65 |y using 'texture| 000019d0 0a 7b 7d 27 2e 20 54 68 65 20 66 69 72 73 74 20 |.{}'. The first | 000019e0 70 61 72 61 6d 65 74 65 72 20 69 73 20 74 68 65 |parameter is the| 000019f0 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 73 70 72 | name of the spr| 00001a00 69 74 65 2e 20 54 68 65 20 6e 65 78 74 20 74 68 |ite. The next th| 00001a10 72 65 65 0a 70 61 72 61 6d 65 74 65 72 73 20 64 |ree.parameters d| 00001a20 65 66 69 6e 65 20 74 68 65 20 64 69 66 66 75 73 |efine the diffus| 00001a30 65 20 61 6e 64 20 73 70 65 63 75 6c 61 72 20 72 |e and specular r| 00001a40 65 66 6c 65 63 74 69 6f 6e 2c 20 61 6e 64 20 73 |eflection, and s| 00001a50 70 65 63 75 6c 61 72 0a 64 69 73 74 72 69 62 75 |pecular.distribu| 00001a60 74 69 6f 6e 20 6f 66 20 74 68 65 20 74 65 78 74 |tion of the text| 00001a70 75 72 65 3b 20 61 20 74 65 78 74 75 72 65 20 69 |ure; a texture i| 00001a80 73 20 63 6f 6e 73 69 64 65 72 65 64 20 74 6f 20 |s considered to | 00001a90 62 65 20 6f 66 20 64 69 66 66 75 73 65 0a 72 65 |be of diffuse.re| 00001aa0 66 6c 65 63 74 69 6f 6e 20 77 69 74 68 20 61 20 |flection with a | 00001ab0 77 68 69 74 65 20 73 70 65 63 75 6c 61 72 20 63 |white specular c| 00001ac0 6f 6d 70 6f 6e 65 6e 74 2e 20 54 68 65 20 73 70 |omponent. The sp| 00001ad0 72 69 74 65 20 6d 75 73 74 20 62 65 20 6d 61 70 |rite must be map| 00001ae0 70 65 64 0a 6f 6e 74 6f 20 61 6c 6c 20 70 6f 69 |ped.onto all poi| 00001af0 6e 74 73 20 69 6e 20 74 68 65 20 6f 62 6a 65 63 |nts in the objec| 00001b00 74 20 61 6e 64 20 70 6f 69 6e 74 73 20 61 72 65 |t and points are| 00001b10 20 6d 61 70 70 65 64 20 74 6f 20 69 6e 20 63 6f | mapped to in co| 00001b20 6e 73 65 63 75 74 69 76 65 0a 6f 72 64 65 72 20 |nsecutive.order | 00001b30 66 72 6f 6d 20 70 6f 69 6e 74 20 30 2e 0a 0a 54 |from point 0...T| 00001b40 68 65 20 63 6f 6d 6d 61 6e 64 20 27 6d 61 70 20 |he command 'map | 00001b50 7b 7d 27 20 74 61 6b 65 73 20 74 77 6f 20 70 61 |{}' takes two pa| 00001b60 72 61 6d 65 74 65 72 73 20 74 68 61 74 20 64 65 |rameters that de| 00001b70 73 63 72 69 62 65 20 77 68 65 72 65 20 69 6e 20 |scribe where in | 00001b80 74 68 65 0a 73 70 72 69 74 65 20 61 20 70 6f 69 |the.sprite a poi| 00001b90 6e 74 20 73 68 6f 75 6c 64 20 62 65 20 6d 61 70 |nt should be map| 00001ba0 70 65 64 3b 20 74 68 65 20 73 70 72 69 74 65 20 |ped; the sprite | 00001bb0 69 73 20 74 61 6b 65 6e 20 74 6f 20 68 61 76 65 |is taken to have| 00001bc0 20 61 20 77 69 64 74 68 0a 6f 66 20 31 20 61 6e | a width.of 1 an| 00001bd0 64 20 68 65 69 67 68 74 20 31 2e 20 54 68 65 20 |d height 1. The | 00001be0 63 6f 6d 6d 61 6e 64 20 27 66 69 74 20 7b 7d 27 |command 'fit {}'| 00001bf0 20 73 74 72 65 74 63 68 65 73 20 74 68 65 20 65 | stretches the e| 00001c00 6e 74 69 72 65 20 73 70 72 69 74 65 0a 6f 76 65 |ntire sprite.ove| 00001c10 72 20 61 20 72 61 6e 67 65 20 6f 66 20 70 6f 69 |r a range of poi| 00001c20 6e 74 73 2c 20 61 6e 64 20 74 68 65 20 74 77 6f |nts, and the two| 00001c30 20 70 61 72 61 6d 65 74 65 72 73 20 64 65 73 63 | parameters desc| 00001c40 72 69 62 65 20 74 68 65 20 77 69 64 74 68 20 69 |ribe the width i| 00001c50 6e 0a 70 6f 69 6e 74 73 20 61 6e 64 20 68 65 69 |n.points and hei| 00001c60 67 68 74 20 69 6e 20 70 6f 69 6e 74 73 20 6f 76 |ght in points ov| 00001c70 65 72 20 77 68 69 63 68 20 74 68 65 20 73 70 72 |er which the spr| 00001c80 69 74 65 20 73 68 6f 75 6c 64 20 62 65 20 66 69 |ite should be fi| 00001c90 74 74 65 64 2e 0a 0a 54 68 65 20 6d 61 69 6e 20 |tted...The main | 00001ca0 73 70 68 65 72 65 20 69 73 20 63 6f 76 65 72 65 |sphere is covere| 00001cb0 64 20 62 79 20 74 68 65 20 73 70 72 69 74 65 20 |d by the sprite | 00001cc0 27 73 63 72 65 65 6e 64 75 6d 70 27 20 6d 61 70 |'screendump' map| 00001cd0 70 65 64 20 6f 76 65 72 20 74 68 65 0a 73 70 68 |ped over the.sph| 00001ce0 65 72 65 20 62 79 20 74 68 65 20 74 77 6f 20 63 |ere by the two c| 00001cf0 6f 6d 6d 61 6e 64 73 2e 20 54 68 65 20 73 70 72 |ommands. The spr| 00001d00 69 74 65 20 69 73 20 6d 61 70 70 65 64 20 6f 76 |ite is mapped ov| 00001d10 65 72 20 74 68 65 20 6d 61 6a 6f 72 69 74 79 20 |er the majority | 00001d20 6f 66 0a 74 68 65 20 73 70 68 65 72 65 20 62 79 |of.the sphere by| 00001d30 20 27 66 69 74 20 7b 7d 27 3b 20 74 68 65 20 73 | 'fit {}'; the s| 00001d40 70 68 65 72 65 20 63 6f 6e 73 69 73 74 73 20 6f |phere consists o| 00001d50 66 20 31 30 20 72 69 6e 67 73 20 61 6e 64 20 65 |f 10 rings and e| 00001d60 61 63 68 20 72 69 6e 67 0a 68 61 73 20 31 32 20 |ach ring.has 12 | 00001d70 70 6f 69 6e 74 73 2c 20 73 6f 20 27 66 69 74 20 |points, so 'fit | 00001d80 7b 31 32 20 31 30 7d 27 20 69 73 20 75 73 65 64 |{12 10}' is used| 00001d90 2e 20 54 68 65 20 74 77 6f 20 70 6f 69 6e 74 73 |. The two points| 00001da0 20 74 68 61 74 20 66 6f 72 6d 20 74 68 65 0a 74 | that form the.t| 00001db0 6f 70 20 61 6e 64 20 62 6f 74 74 6f 6d 20 6f 66 |op and bottom of| 00001dc0 20 74 68 65 20 73 70 68 65 72 65 20 61 72 65 20 | the sphere are | 00001dd0 6d 61 70 70 65 64 20 77 69 74 68 20 27 6d 61 70 |mapped with 'map| 00001de0 20 7b 30 2e 35 20 30 7d 27 20 61 6e 64 20 27 6d | {0.5 0}' and 'm| 00001df0 61 70 0a 7b 30 2e 35 20 31 7d 27 2c 20 63 6f 72 |ap.{0.5 1}', cor| 00001e00 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 74 68 |responding to th| 00001e10 65 20 62 6f 74 74 6f 6d 20 61 6e 64 20 74 6f 70 |e bottom and top| 00001e20 20 63 65 6e 74 72 65 20 6f 66 20 74 68 65 20 73 | centre of the s| 00001e30 70 72 69 74 65 2e 0a 0a 42 65 66 6f 72 65 20 61 |prite...Before a| 00001e40 20 73 63 65 6e 65 20 63 61 6e 20 62 65 20 70 6c | scene can be pl| 00001e50 6f 74 74 65 64 20 74 68 65 20 70 6f 73 69 74 69 |otted the positi| 00001e60 6f 6e 73 20 6f 66 20 74 68 65 20 6f 62 73 65 72 |ons of the obser| 00001e70 76 65 72 20 61 6e 64 20 74 68 65 0a 6c 69 67 68 |ver and the.ligh| 00001e80 74 73 20 6d 75 73 74 20 62 65 20 73 70 65 63 69 |ts must be speci| 00001e90 66 69 65 64 2e 20 54 68 65 20 63 6f 6d 6d 61 6e |fied. The comman| 00001ea0 64 20 27 6c 69 67 68 74 20 7b 7d 27 20 64 65 73 |d 'light {}' des| 00001eb0 63 72 69 62 65 73 20 74 68 65 0a 6c 69 67 68 74 |cribes the.light| 00001ec0 69 6e 67 2c 20 61 6e 64 20 74 68 65 20 63 6f 6d |ing, and the com| 00001ed0 6d 61 6e 64 20 27 76 69 65 77 20 7b 7d 27 20 64 |mand 'view {}' d| 00001ee0 65 73 63 72 69 62 65 73 20 74 68 65 20 70 6f 73 |escribes the pos| 00001ef0 74 69 6f 6e 20 61 6e 64 0a 6f 72 69 65 6e 74 61 |tion and.orienta| 00001f00 74 69 6f 6e 20 6f 66 20 74 68 65 20 6f 62 73 65 |tion of the obse| 00001f10 72 76 65 72 20 6f 72 20 63 61 6d 65 72 61 2e 20 |rver or camera. | 00001f20 4c 69 67 68 74 73 20 61 72 65 20 64 65 73 63 72 |Lights are descr| 00001f30 69 62 65 64 20 62 79 20 74 68 65 69 72 0a 72 6f |ibed by their.ro| 00001f40 74 61 74 69 6f 6e 20 61 6e 64 20 65 6c 65 76 61 |tation and eleva| 00001f50 74 69 6f 6e 20 69 6e 20 74 68 65 20 73 63 65 6e |tion in the scen| 00001f60 65 3b 20 61 6e 20 65 6c 65 76 61 74 69 6f 6e 20 |e; an elevation | 00001f70 6f 66 20 39 30 20 64 65 66 69 6e 65 73 20 61 0a |of 90 defines a.| 00001f80 6c 69 67 68 74 20 6f 76 65 72 68 65 61 64 2c 20 |light overhead, | 00001f90 61 6e 64 20 61 20 72 6f 74 61 74 69 6f 6e 20 6f |and a rotation o| 00001fa0 66 20 30 20 64 65 66 69 6e 65 73 20 61 20 6c 69 |f 0 defines a li| 00001fb0 67 68 74 20 69 6e 20 66 72 6f 6e 74 20 6f 66 20 |ght in front of | 00001fc0 74 68 65 0a 6f 62 73 65 72 76 65 72 2e 20 54 68 |the.observer. Th| 00001fd0 65 20 66 69 72 73 74 20 74 68 72 65 65 20 70 61 |e first three pa| 00001fe0 72 61 6d 65 74 65 72 73 20 77 69 74 68 69 6e 20 |rameters within | 00001ff0 27 76 69 65 77 20 7b 7d 27 20 64 65 73 63 72 69 |'view {}' descri| 00002000 62 65 64 20 74 68 65 0a 70 6f 73 69 74 69 6f 6e |bed the.position| 00002010 20 6f 66 20 74 68 65 20 6f 62 73 65 72 76 65 72 | of the observer| 00002020 20 61 6e 64 20 74 68 65 20 6c 61 73 74 20 74 68 | and the last th| 00002030 72 65 65 20 63 6f 72 72 65 73 70 6f 6e 64 20 74 |ree correspond t| 00002040 6f 20 74 68 65 20 70 69 74 63 68 2c 0a 79 61 77 |o the pitch,.yaw| 00002050 20 61 6e 64 20 72 6f 6c 6c 20 61 6e 67 6c 65 73 | and roll angles| 00002060 2c 20 77 69 74 68 20 76 61 6c 75 65 73 20 6f 66 |, with values of| 00002070 20 30 20 6d 65 61 6e 69 6e 67 20 64 69 72 65 63 | 0 meaning direc| 00002080 74 6c 79 20 61 68 65 61 64 2e 0a 0a 54 68 65 20 |tly ahead...The | 00002090 62 72 69 67 68 74 6e 65 73 73 20 6f 66 20 74 68 |brightness of th| 000020a0 65 20 73 63 65 6e 65 20 69 73 20 63 6f 6e 74 72 |e scene is contr| 000020b0 6f 6c 6c 65 64 20 62 79 20 27 61 6d 62 69 65 6e |olled by 'ambien| 000020c0 74 20 7b 7d 27 2e 20 54 68 69 73 0a 73 70 65 63 |t {}'. This.spec| 000020d0 69 66 69 65 73 20 74 68 65 20 63 6f 6e 74 72 69 |ifies the contri| 000020e0 62 75 74 69 6f 6e 20 6f 66 20 72 61 6e 64 6f 6d |bution of random| 000020f0 6c 79 20 72 65 66 6c 65 63 74 65 64 20 6c 69 67 |ly reflected lig| 00002100 68 74 2c 20 69 6e 20 74 65 72 6d 73 20 6f 66 0a |ht, in terms of.| 00002110 74 68 65 20 70 72 69 6d 61 72 79 20 63 6f 6c 6f |the primary colo| 00002120 75 72 73 2e 20 54 68 65 20 61 6d 62 69 65 6e 74 |urs. The ambient| 00002130 20 69 6c 6c 75 6d 69 6e 61 74 69 6f 6e 20 69 73 | illumination is| 00002140 20 75 73 75 61 6c 6c 79 20 76 65 72 79 20 73 6d | usually very sm| 00002150 61 6c 6c 3b 0a 74 6f 6f 20 6d 75 63 68 20 61 6d |all;.too much am| 00002160 62 69 65 6e 74 20 6c 69 67 68 74 20 61 6e 64 20 |bient light and | 00002170 74 68 65 20 73 63 65 6e 65 20 77 69 6c 6c 20 6c |the scene will l| 00002180 6f 73 65 20 63 6f 6e 74 72 61 73 74 20 61 6e 64 |ose contrast and| 00002190 20 77 69 6c 6c 0a 61 70 70 65 61 72 20 77 61 73 | will.appear was| 000021a0 68 65 64 20 6f 75 74 2e 0a 0a 54 68 65 20 66 69 |hed out...The fi| 000021b0 6e 61 6c 20 6f 75 74 70 75 74 20 66 72 6f 6d 20 |nal output from | 000021c0 74 68 65 20 72 65 6e 64 65 72 65 72 20 69 73 20 |the renderer is | 000021d0 64 65 66 69 6e 65 64 20 62 79 20 27 64 69 73 70 |defined by 'disp| 000021e0 6c 61 79 20 7b 7d 27 2e 20 54 68 65 0a 66 69 72 |lay {}'. The.fir| 000021f0 73 74 20 70 61 72 61 6d 65 74 65 72 20 69 73 20 |st parameter is | 00002200 74 68 65 20 66 69 6c 65 6e 61 6d 65 20 66 6f 72 |the filename for| 00002210 20 74 68 65 20 6f 75 74 70 75 74 20 73 70 72 69 | the output spri| 00002220 74 65 2c 20 74 68 65 20 6e 65 78 74 0a 64 65 66 |te, the next.def| 00002230 69 6e 65 73 20 74 68 65 20 72 65 73 6f 6c 75 74 |ines the resolut| 00002240 69 6f 6e 2c 20 61 6e 64 20 74 68 65 20 6f 74 68 |ion, and the oth| 00002250 65 72 73 20 63 6f 6e 74 72 6f 6c 20 74 68 65 20 |ers control the | 00002260 78 20 61 6e 64 20 79 20 73 63 61 6c 69 6e 67 0a |x and y scaling.| 00002270 66 61 63 74 6f 72 73 20 6f 66 20 74 68 65 20 73 |factors of the s| 00002280 63 65 6e 65 20 61 6e 64 20 74 68 65 20 73 69 7a |cene and the siz| 00002290 65 20 6f 66 20 74 68 65 20 6f 75 74 70 75 74 20 |e of the output | 000022a0 73 70 72 69 74 65 2e 20 54 68 65 20 72 65 73 6f |sprite. The reso| 000022b0 6c 75 74 69 6f 6e 0a 63 61 6e 20 62 65 20 6c 6f |lution.can be lo| 000022c0 77 2c 20 6d 65 64 69 75 6d 20 6f 72 20 68 69 67 |w, medium or hig| 000022d0 68 20 61 6e 64 20 63 6f 72 72 65 73 70 6f 6e 64 |h and correspond| 000022e0 73 20 74 6f 20 6d 6f 64 65 20 31 33 2c 20 31 35 |s to mode 13, 15| 000022f0 20 6f 72 20 32 31 3b 20 74 68 65 0a 73 69 7a 65 | or 21; the.size| 00002300 20 6f 66 20 74 68 65 20 73 70 72 69 74 65 20 69 | of the sprite i| 00002310 73 20 64 65 66 69 6e 65 64 20 69 6e 20 4f 53 20 |s defined in OS | 00002320 75 6e 69 74 73 2c 20 73 6f 20 61 20 73 69 7a 65 |units, so a size| 00002330 20 6f 66 20 31 32 38 30 20 62 79 20 31 30 32 34 | of 1280 by 1024| 00002340 0a 69 73 20 61 20 66 75 6c 6c 20 73 63 72 65 65 |.is a full scree| 00002350 6e 2e 20 54 68 65 20 73 63 61 6c 69 6e 67 20 66 |n. The scaling f| 00002360 61 63 74 6f 72 73 20 63 6f 6e 74 72 6f 6c 20 74 |actors control t| 00002370 68 65 20 66 69 6e 61 6c 20 73 69 7a 65 20 6f 66 |he final size of| 00002380 20 74 68 65 0a 73 63 65 6e 65 2c 20 61 6e 64 20 | the.scene, and | 00002390 74 68 65 69 72 20 73 69 7a 65 20 69 73 20 64 65 |their size is de| 000023a0 74 65 72 6d 69 6e 65 64 20 62 79 20 74 68 65 20 |termined by the | 000023b0 73 69 7a 65 20 6f 66 20 74 68 65 20 6f 62 6a 65 |size of the obje| 000023c0 63 74 73 20 69 6e 20 74 68 65 0a 73 63 65 6e 65 |cts in the.scene| 000023d0 2e 0a 0a 53 63 72 69 70 74 20 66 69 6c 65 73 20 |...Script files | 000023e0 61 72 65 20 62 65 73 74 20 77 72 69 74 74 65 6e |are best written| 000023f0 20 69 6e 20 61 20 74 65 78 74 20 65 64 69 74 6f | in a text edito| 00002400 72 20 73 75 63 68 20 61 73 20 45 64 69 74 2e 20 |r such as Edit. | 00002410 49 74 20 69 73 20 61 0a 67 6f 6f 64 20 69 64 65 |It is a.good ide| 00002420 61 20 74 6f 20 62 75 69 6c 64 20 75 70 20 61 20 |a to build up a | 00002430 6c 69 62 72 61 72 79 20 6f 66 20 63 6f 6d 6d 6f |library of commo| 00002440 6e 6c 79 20 75 73 65 64 20 6f 62 6a 65 63 74 73 |nly used objects| 00002450 20 73 75 63 68 20 61 73 0a 27 73 70 68 65 72 65 | such as.'sphere| 00002460 20 7b 7d 27 20 6f 72 20 27 63 75 62 65 20 7b 7d | {}' or 'cube {}| 00002470 27 20 77 68 69 63 68 20 63 61 6e 20 62 65 20 73 |' which can be s| 00002480 74 72 75 6e 67 20 74 6f 67 65 74 68 65 72 20 77 |trung together w| 00002490 68 65 6e 20 72 65 71 75 69 72 65 64 2e 0a 48 6f |hen required..Ho| 000024a0 70 65 66 75 6c 6c 79 20 74 68 65 20 6c 61 6e 67 |pefully the lang| 000024b0 75 61 67 65 20 69 73 20 66 6c 65 78 69 62 6c 65 |uage is flexible| 000024c0 20 65 6e 6f 75 67 68 20 74 6f 20 64 6f 20 61 6c | enough to do al| 000024d0 6c 20 74 68 61 74 20 79 6f 75 20 72 65 71 75 69 |l that you requi| 000024e0 72 65 0a 66 72 6f 6d 20 69 74 20 61 6e 64 20 77 |re.from it and w| 000024f0 6f 6e 27 74 20 72 65 73 74 72 69 63 74 20 74 68 |on't restrict th| 00002500 65 20 62 75 64 64 69 6e 67 20 61 72 74 69 73 74 |e budding artist| 00002510 2e 20 0a 0a 43 6f 6d 70 69 6c 69 6e 67 20 61 6e |. ..Compiling an| 00002520 64 20 52 65 6e 64 65 72 69 6e 67 0a 3d 3d 3d 3d |d Rendering.====| 00002530 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d |================| 00002540 3d 3d 3d 0a 0a 4f 6e 63 65 20 61 20 73 63 72 69 |===..Once a scri| 00002550 70 74 20 66 69 6c 65 20 69 73 20 77 72 69 74 74 |pt file is writt| 00002560 65 6e 20 69 74 20 6d 75 73 74 20 62 65 20 63 6f |en it must be co| 00002570 6d 70 69 6c 65 64 20 62 65 66 6f 72 65 20 72 65 |mpiled before re| 00002580 6e 64 65 72 69 6e 67 20 63 61 6e 0a 74 61 6b 65 |ndering can.take| 00002590 20 70 6c 61 63 65 2e 20 54 68 65 20 61 70 70 6c | place. The appl| 000025a0 69 63 61 74 69 6f 6e 73 20 70 72 6f 76 69 64 65 |ications provide| 000025b0 64 20 61 6c 6c 6f 77 20 73 63 72 69 70 74 73 20 |d allow scripts | 000025c0 74 6f 20 62 65 20 63 6f 6d 70 69 6c 65 64 20 61 |to be compiled a| 000025d0 6e 64 0a 72 65 6e 64 65 72 65 64 20 65 61 73 69 |nd.rendered easi| 000025e0 6c 79 2c 20 62 75 74 20 66 6f 72 20 74 68 65 20 |ly, but for the | 000025f0 6d 6f 72 65 20 61 64 76 61 6e 63 65 64 20 75 73 |more advanced us| 00002600 65 72 2c 20 74 68 65 20 70 72 6f 67 72 61 6d 73 |er, the programs| 00002610 20 63 61 6e 20 62 65 0a 75 73 65 64 20 66 72 6f | can be.used fro| 00002620 6d 20 74 68 65 20 63 6f 6d 6d 61 6e 64 20 6c 69 |m the command li| 00002630 6e 65 3b 20 74 68 65 20 61 63 74 75 61 6c 20 65 |ne; the actual e| 00002640 78 65 63 75 74 61 62 6c 65 20 70 72 6f 67 72 61 |xecutable progra| 00002650 6d 73 20 61 72 65 20 73 74 6f 72 65 64 0a 69 6e |ms are stored.in| 00002660 73 69 64 65 20 74 68 65 20 61 70 70 6c 69 63 61 |side the applica| 00002670 74 69 6f 6e 20 64 69 72 65 63 74 6f 72 69 65 73 |tion directories| 00002680 20 21 43 6f 6d 70 69 6c 65 20 61 6e 64 20 21 52 | !Compile and !R| 00002690 65 6e 64 2e 0a 0a 46 6f 75 72 20 64 69 72 65 63 |end...Four direc| 000026a0 74 6f 72 69 65 73 20 61 72 65 20 72 65 71 75 69 |tories are requi| 000026b0 72 65 64 20 66 6f 72 20 63 6f 6d 70 69 6c 69 6e |red for compilin| 000026c0 67 3a 20 27 73 27 20 63 6f 6e 74 61 69 6e 73 20 |g: 's' contains | 000026d0 74 68 65 20 73 63 72 69 70 74 0a 66 69 6c 65 2c |the script.file,| 000026e0 20 27 76 27 20 63 6f 6e 74 61 69 6e 73 20 74 68 | 'v' contains th| 000026f0 65 20 76 69 65 77 70 6f 69 6e 74 20 64 61 74 61 |e viewpoint data| 00002700 2c 20 27 64 27 20 63 6f 6e 74 61 69 6e 73 20 74 |, 'd' contains t| 00002710 68 65 20 73 63 65 6e 65 20 64 61 74 61 2c 0a 61 |he scene data,.a| 00002720 6e 64 20 27 74 27 20 63 6f 6e 74 61 69 6e 73 20 |nd 't' contains | 00002730 74 68 65 20 74 65 78 74 75 72 65 20 64 61 74 61 |the texture data| 00002740 2e 0a 0a 54 68 65 20 63 6f 6d 70 69 6c 65 72 20 |...The compiler | 00002750 63 61 6e 20 62 65 20 63 61 6c 6c 65 64 20 75 70 |can be called up| 00002760 20 62 79 20 74 68 65 20 63 6f 6d 6d 61 6e 64 3a | by the command:| 00002770 0a a0 a0 a0 2a 63 6f 6d 70 69 6c 65 20 3c 66 69 |....*compile <fi| 00002780 6c 65 6e 61 6d 65 3e 20 5b 20 2d 20 73 20 3c 73 |lename> [ - s <s| 00002790 69 7a 65 3e 20 5d 20 5b 20 2d 6f 20 3c 25 3e 20 |ize> ] [ -o <%> | 000027a0 5d 20 5b 20 2d 74 20 3c 25 3e 20 5d 20 5b 20 2d |] [ -t <%> ] [ -| 000027b0 77 5d 0a 0a 54 68 65 20 6f 70 74 69 6f 6e 73 20 |w]..The options | 000027c0 66 6f 6c 6c 6f 77 69 6e 67 20 74 68 65 20 63 6f |following the co| 000027d0 6d 6d 61 6e 64 20 63 6f 6e 74 72 6f 6c 20 74 68 |mmand control th| 000027e0 65 20 6d 65 6d 6f 72 79 20 61 73 73 69 67 6e 6d |e memory assignm| 000027f0 65 6e 74 73 20 66 6f 72 0a 74 68 65 20 63 6f 6d |ents for.the com| 00002800 70 69 6c 65 72 3a 20 27 2d 73 27 20 64 65 66 69 |piler: '-s' defi| 00002810 6e 65 73 20 68 6f 77 20 6d 75 63 68 20 6d 65 6d |nes how much mem| 00002820 6f 72 79 20 74 68 65 20 63 6f 6d 70 69 6c 65 72 |ory the compiler| 00002830 20 68 61 73 20 66 72 65 65 20 66 6f 72 0a 64 61 | has free for.da| 00002840 74 61 2c 20 69 6e 20 6b 69 6c 6f 62 79 74 65 73 |ta, in kilobytes| 00002850 2e 20 4f 70 74 69 6f 6e 73 20 27 2d 6f 27 20 61 |. Options '-o' a| 00002860 6e 64 20 27 2d 74 27 20 65 78 70 72 65 73 73 2c |nd '-t' express,| 00002870 20 61 73 20 61 20 70 65 72 63 65 6e 74 61 67 65 | as a percentage| 00002880 2c 0a 68 6f 77 20 6d 75 63 68 20 6f 66 20 74 68 |,.how much of th| 00002890 65 20 6d 65 6d 6f 72 79 20 69 73 20 75 73 65 64 |e memory is used| 000028a0 20 74 6f 20 73 74 6f 72 65 20 6f 62 6a 65 63 74 | to store object| 000028b0 73 20 61 6e 64 20 74 65 78 74 75 72 65 2e 20 54 |s and texture. T| 000028c0 68 65 0a 64 65 66 61 75 6c 74 20 76 61 6c 75 65 |he.default value| 000028d0 73 20 61 72 65 3a 0a a0 a0 a0 2a 63 6f 6d 70 69 |s are:....*compi| 000028e0 6c 65 20 3c 66 69 6c 65 6e 61 6d 65 3e 20 2d 73 |le <filename> -s| 000028f0 20 33 32 30 20 2d 6f 20 35 30 20 2d 74 20 30 2e | 320 -o 50 -t 0.| 00002900 31 20 0a 0a 49 6e 20 75 73 65 20 74 68 65 20 63 |1 ..In use the c| 00002910 6f 6d 70 69 6c 65 72 20 77 69 6c 6c 20 73 63 61 |ompiler will sca| 00002920 6e 20 74 68 72 6f 75 67 68 20 74 68 65 20 73 63 |n through the sc| 00002930 72 69 70 74 2c 20 61 6e 64 20 69 66 20 61 6e 20 |ript, and if an | 00002940 65 72 72 6f 72 20 69 73 0a 66 6f 75 6e 64 20 69 |error is.found i| 00002950 74 20 77 69 6c 6c 20 72 65 70 6f 72 74 20 69 74 |t will report it| 00002960 20 61 6e 64 20 73 74 6f 70 20 63 6f 6d 70 69 6c | and stop compil| 00002970 69 6e 67 2e 20 4f 6e 63 65 20 63 6f 6d 70 69 6c |ing. Once compil| 00002980 61 74 69 6f 6e 20 68 61 73 20 74 61 6b 65 6e 0a |ation has taken.| 00002990 70 6c 61 63 65 20 74 68 65 20 64 61 74 61 20 69 |place the data i| 000029a0 73 20 73 61 76 65 64 20 61 6e 64 20 61 20 77 69 |s saved and a wi| 000029b0 72 65 2d 66 72 61 6d 65 20 70 72 65 76 69 65 77 |re-frame preview| 000029c0 20 6f 66 20 74 68 65 20 69 6d 61 67 65 20 69 73 | of the image is| 000029d0 0a 64 72 61 77 6e 3b 20 74 68 69 73 20 63 61 6e |.drawn; this can| 000029e0 20 62 65 20 64 69 73 61 62 6c 65 64 20 77 69 74 | be disabled wit| 000029f0 68 20 74 68 65 20 27 2d 77 27 20 6f 70 74 69 6f |h the '-w' optio| 00002a00 6e 2e 0a 0a 54 68 65 20 63 6f 6d 70 69 6c 65 72 |n...The compiler| 00002a10 20 77 69 6c 6c 20 6f 6e 6c 79 20 73 61 76 65 20 | will only save | 00002a20 76 69 65 77 20 64 61 74 61 20 61 6e 64 20 6f 62 |view data and ob| 00002a30 6a 65 63 74 20 64 61 74 61 20 69 66 20 74 68 65 |ject data if the| 00002a40 79 20 61 72 65 0a 70 72 65 73 65 6e 74 20 69 6e |y are.present in| 00002a50 20 74 68 65 20 73 63 72 69 70 74 20 66 69 6c 65 | the script file| 00002a60 3b 20 74 68 69 73 20 61 6c 6c 6f 77 73 20 79 6f |; this allows yo| 00002a70 75 20 74 6f 20 61 6c 74 65 72 20 74 68 65 20 76 |u to alter the v| 00002a80 69 65 77 20 70 6f 69 6e 74 0a 77 69 74 68 6f 75 |iew point.withou| 00002a90 74 20 68 61 76 69 6e 67 20 74 6f 20 72 65 2d 63 |t having to re-c| 00002aa0 6f 6d 70 69 6c 65 20 74 68 65 20 77 68 6f 6c 65 |ompile the whole| 00002ab0 20 73 63 65 6e 65 2c 20 62 75 74 20 6e 6f 20 70 | scene, but no p| 00002ac0 72 65 76 69 65 77 20 69 73 20 64 72 61 77 6e 0a |review is drawn.| 00002ad0 69 66 20 74 68 65 20 63 6f 6d 70 69 6c 65 64 20 |if the compiled | 00002ae0 66 69 6c 65 20 63 6f 6e 74 61 69 6e 73 20 6f 6e |file contains on| 00002af0 6c 79 20 76 69 65 77 20 6f 72 20 73 63 65 6e 65 |ly view or scene| 00002b00 20 64 61 74 61 2e 0a 0a 54 68 65 20 63 6f 6d 70 | data...The comp| 00002b10 69 6c 65 72 20 69 73 20 72 65 61 73 6f 6e 61 62 |iler is reasonab| 00002b20 6c 79 20 67 6f 6f 64 20 61 74 20 74 72 61 70 70 |ly good at trapp| 00002b30 69 6e 67 20 65 72 72 6f 72 73 20 69 6e 20 61 20 |ing errors in a | 00002b40 73 63 72 69 70 74 20 66 69 6c 65 0a 62 75 74 20 |script file.but | 00002b50 73 6f 6d 65 20 6d 69 73 74 61 6b 65 73 20 73 75 |some mistakes su| 00002b60 63 68 20 61 73 20 6d 69 73 73 69 6e 67 20 62 72 |ch as missing br| 00002b70 61 63 6b 65 74 73 20 6f 72 20 73 65 70 61 72 61 |ackets or separa| 00002b80 74 6f 72 73 20 63 61 6e 20 63 72 61 73 68 20 74 |tors can crash t| 00002b90 68 65 0a 63 6f 6d 70 69 6c 65 72 20 61 6e 64 20 |he.compiler and | 00002ba0 72 65 6e 64 65 72 65 72 2e 0a 0a 46 69 6e 61 6c |renderer...Final| 00002bb0 6c 79 20 74 68 65 20 63 6f 6d 70 69 6c 65 64 20 |ly the compiled | 00002bc0 73 63 72 69 70 74 20 66 69 6c 65 20 69 73 20 72 |script file is r| 00002bd0 65 6e 64 65 72 65 64 20 62 79 20 74 68 65 20 72 |endered by the r| 00002be0 65 6e 64 65 72 65 72 20 62 79 3a 0a a0 a0 a0 2a |enderer by:....*| 00002bf0 72 65 6e 64 65 72 20 3c 66 69 6c 65 6e 61 6d 65 |render <filename| 00002c00 3e 0a 0a 42 6f 74 68 20 74 68 65 20 63 6f 6d 70 |>..Both the comp| 00002c10 69 6c 65 72 20 61 6e 64 20 74 68 65 20 72 65 6e |iler and the ren| 00002c20 64 65 72 65 72 20 72 65 71 75 69 72 65 20 74 68 |derer require th| 00002c30 65 20 46 6c 6f 61 74 69 6e 67 20 50 6f 69 6e 74 |e Floating Point| 00002c40 20 45 6d 75 6c 61 74 6f 72 0a 74 6f 20 62 65 20 | Emulator.to be | 00002c50 69 6e 73 74 61 6c 6c 65 64 2e 20 54 68 65 79 20 |installed. They | 00002c60 61 6c 73 6f 20 72 65 71 75 69 72 65 20 74 68 65 |also require the| 00002c70 20 66 69 6c 65 20 27 63 6f 64 65 27 20 74 6f 20 | file 'code' to | 00002c80 62 65 20 70 72 65 73 65 6e 74 20 69 6e 0a 74 68 |be present in.th| 00002c90 65 20 43 53 44 2e 0a |e CSD..| 00002c97