The examples ------------ Several example programs are included with the package (with source). Some of them use Mesa and its device driver directly (Demo1, Demo2 and Demo3), some use HighLevel-Libraries but are still p.OS-specific (DemoTK1) and some use the HighLevel-extensions and are developed system independent (Samples, teapot). For all examples there is one important thing to think of: Mesa needs a lot of stack. None of the examples will work with less then 32000 Byte of stack. All libraries and examples have been compiled with SAS/C. Future versions of Mesa for p.OS will also support StormC. The link libraries pOSMesa.lib, pOSGLU.lib, pOSTK.lib and pOSAUX.lib need Mesa-C1.lib, Mesa-C2.lib and one of Mesa-Math.lib and Mesa-Math882.lib to be linked to your application. These are special replacements for the sc.lib and scm.lib of SAS/C for p.OS + Mesa + SAS/C. If you compile the source, some programs may produce linker warnings with Warning 617: MERGED data > 64K. In this case you should switch off the SmallData linker option for this program. A program with merged code warning can be linked without SmallCode. One case were this can happen are programs which use the TK-fonts feature. Example "Demo1" --------------- This is the first public demo which uses Mesa and its devide driver directly. One object will be created and animated. You can use the following shell parameters: WIDTH : Inner window width (10..500, default 150). HEIGHT : Inner window height (10..500, default 100). DMODE : Polygonmode: point, line or filled polygons (0..2, def. 2). SIDE : Polygonmode: Front-, back or both sides (0..2, def. 2). OBJECT : The object you want to see (0..3, def. 1). RGB : RGB or ColorIndex-Mode. DB : Double- or SingleBuffering. PRIMITIVE : Primitiv-Name: GL_POINT, ..., GL_POLYGON (0..9, def. 0). Keys: Cursor, F1,F2 : Rotate around X-, Y-, Z-axis. F3 - F8 : Translate in positive/negative X-, Y- or Z-direction. 'q' : Quit program. 'c' : Select camera mode. 'i' : Reinit position. 'm' : Change to next polygon mode (points, lines, filled polygon). 's' : Change to next polygon mode (front, back or both sides). 'o' : Change to next object to draw (currently there are 4 different objects). 'v' : Change to next primitiv name (GL_POINT, ..., GL_POLYGON). '0'-'9' : Select primitiv name directly. HELP : Type help. The window can be resized and the graphical output will adapt to the new size. Only slow computers the (re-)calculation of the graphical output can take some seconds. As mentioned above, 2 camera modes are implemented for animation in this demo: The first and default mode works just like a 3D-engine. You can turn your head right or left, up or down with the cursor keys, you can tip your head right or left with F1, F2 and you can move forward, backward, left, right, up and down with F3-F8. The second camera mode can be compared to the remote control of a model aircraft. Now your position is fix and the 3D scene and you can control the object with the keys mentioned above. You can change between the 2 camera modes at any time. The objects currently implemented in the Demo1 are a simple triangle, an octagon, a multicolored octagon and finally a cube (multicolored only in RGB-mode). Example "Demo2" --------------- Internally and externally this demo looks much like Demo1. The most important new thing is the use of light and material definitions. Shell parameters: WIDTH : Inner window width (10..500, def. 150). HEIGHT : Inner window height (10..500, def. 100). DMODE : Polygonmode: Points, lines or filled polygons (0..2, def. 2). SIDE : Polygonmode: Front, back or both faces (0..2, def. 2). LIGHT : Select one of three different light sources (0..2, def. 2). FOG : activate/deactivate fog. Keys: Cursor, F1,F2 : Rotate around X-, Y-, Z-axis. F3 - F8 : Translate in positive/negative X-, Y- or Z-direction. 'q' : Quit program. 'i' : Reinit position. 'm' : Change to next polygon mode (points, lines, filled polygon). 's' : Change to next polygon mode (front, back or both sides). 'o' : Change to next object to draw (currently there are 4 different objects). 'l' : Show next of three different light sources. 'f' : Activate/deactivate fog. HELP : Type help. Animation is the same as the second animation mode in Demo1. The only object shown by this demo is an octagon with brass as front side material and slate as back side material. You can select between a green, fix, ambient light source without direction, a fix, red, diffus, parallel light source from +Z and a white, diffus spot light placed in the eye point (on the camera) with very low cut off angle. Example "DemoTK1" ----------------- Externally this example looks like Demo1, but internally it works with one of the HighLevel extension libraries, TK. Objects, control, keys and shell parameters are nearly the same as in Demo1, only some the keys which are not supported by TK had to change. In TK, the F-keys are not available, therefor the number keys have received their functonality. The direct selection of the primitiv name is not possible anymore and finally the help-key has been replaced by 'h'. The source of the program is not system independent, DemoTK1 is more an example of the cooperation of Mesa and p.OS system calls. Example "Demo3" --------------- Currently this is the most complex p.OS + Mesa example. It demonstrates some of the hundreds of configuration options of Mesa. Currently this program doesn't support shell parameters or special hotkeys. With the 4 buttons in the main window you can open individual popups for configuration of the type of the light source, the position and direction of the light source, the material of the surface of the object and the position, size and rotation of the object. In every window you can use the menu to reset its values or to select one builtin configuration. The menu of the Mesa output window can be used to select another object. NOTE: The light source is fix relative to the object. So if you rotate the object, the light source will leave its position and rotate around the object. Example "AUX_teapot" -------------------- This is a very simple demo of the AUX teapot. On a fast Amiga (68060, FPU-version of the demo and the library) the initialization plus display of the teapot will take about 15 seconds, the display itself (for example after a resize) will take about 8 seconds. On slow Amigas (e.g. 68030, no FPU) you probably have to wait about 5 minutes until the program is initialized and the teapot is visible. This demo doesn't support any keys or shell parameters.