3D Example Programs
|Top Previous Next|
To help you learn how to use the 3D graphics features of EXPL, the installer puts nine programs in the installation directory, usually under the C:/EXPL/Demo/3DDemo path. The programs use most of the 3D graphic features and can be used as templates for your programs. Here is a description of each one:
1. Tetra3D.xpl. This is the simplest possible 3D graphics program. It creates a 3D tetrahedron where each face is a different color. The tetrahedron can be panned, zoomed and rotated with the mouse. It demonstrates setting up a 3D window, drawing to a mesh, sizing objects and manipulating objects with a mouse.
2. Cube3D.xpl. A slightly more complicated program displays a cube derived from data points held in a constant array. The cube also rotates continuously in a quasi-random pattern, illustrating how you rotate a 3D object in EXPL.
3. Nesting3d.xpl. This program draws a cube and two strings. It demonstrates displaying 3D strings and the ability of EXPL to generate nested hierarchies of 3D objects. It also uses recursion to display a hierarchical tree of the nested objects.
4. Torus3D.xpl. This program is based on a program by Loren Blaney. It shows many of the fancier features of the 3D graphics. It demonstrates drawing a torus with a variable number of sections and sectors. It also demonstrates texturing with bitmap images, background images, rending modes, ambient lighting, and transparency.
5. Amaze3D.xpl. This is another Loren Blaney program adapted to EXPL using accelerated graphics. It shows a 3D image of an N by M rectangular maze. The maze can be rotated, panned and zoomed using the mouse. It demonstrates two-sided lighting, turning off back surface culling and line drawing. The program can solve the maze by walling off side branches that don't lead to an exit.
6. Amaze3D2.xpl. This program generates a 3D spherical maze, where the maze passages are superimposed on a sphere. The passage density can be varied and the program can solve the maze by walling off side branches that don't lead to an exit. It is based on a similar program by Loren Blaney.
7. Ellipse.xpl. This is another Loren Blaney program adapted to EXPL using accelerated graphics. It is a program that demonstrates the Trammel of Archimedes as a 3D apparatus where blocks slide in groves and the handle traces an ellipse.
8. Skull3D.xpl. This program loads a skull model from a file. It demonstrates loading 3D models from files, transparency and changing an object's color.
9. SolarSystem3D.xpl. This program shows a representation of the Earth, Sun and Moon orbiting each other. The Sun gives off light that illuminates the Moon and the Earth. The programs realistically model the fact that one side of the Moon always faces the Earth. It unrealistically shows the Sun orbiting the Earth. The program demonstrates complex motion and rotation of objects, texturing, background images and lighting features of EXPL.
10. CubeMap.xpl. This program uses "Cube Mapping" to present 3D scene where the user is immersed and 3D world. The technique uses six bitmap images a 3D panorama that surrounds the user. The user can rotate his/her vision up, down, right or left. He/she can also move forward or back.