This document is a very brief introduction to some of the simpler modeling ideas in the Jabka 3D computer graphics system, and gives brief instructions on getting started with Jabka in a Macintosh environment. If you are working in a Unix/X-Windows environment click here to get the appropriate documentation.
Jabka will run on most Macs that have a floating-point processor. For best results, the machine should have 24-bit color, but Jabka will run on a 8-bit machine or even monochorme machines. There is a version which runs on M68030 and later machines, and a version for PowerMac machines.
To start up Jabka, simply double-click on the document Jabka-Launch, or on any document that you have saved from a previous run of Jabka. You can recognize these documents by the frog paper-holder icon
that represents Jabka. Once Jabka is running, there will be three windows showing. The one at the bottom of the screen is the Message Window, and is used by Jabka for reporting its status and the progress of long-running operations. The next window up is the Output Window. Results obtained when running Jabka programs are displayed in this window. The Output Window can also be used for entering and executing typed commands to Jabka. The main window is known as the Program Window. The user uses this window to write a list of commands, in Jabka's dialect of the Scheme programming language, that describe a geometric model and provide other information on how images should be rendered. The user enters commands into the program window just as would be done when using a simple Macintosh word-processing program. Look at the following example Jabka program, which makes a cone-shaped tree on a circular base.
;----------------- Jabka Scheme Program to Create a -----------------
;---------------- Cone Shaped Tree on Circular Base -----------------
;------------------------ Donald H. House ---------------------------
(object branches part
(addchild cone)
(setmaterial green-plaster))
(object trunk part
(addchild cylinder (scale 0.1 0.3 0.1))
(setmaterial yellow-plaster))
(object tree part
(addchild branches)
(addchild trunk (translate 0 -110 0)))
(object base part
(addchild cylinder (scale 3 0.05 3))
(setmaterial red-plaster))
(object scene part
(addchild tree)
(addchild base (translate 0 -135 0)))
You should try entering this program to make sure that you know how to use Jabka's program editing facility. Aspects of this example are elaborated in the discussion below. Entering this program does not cause any image to be displayed. See the section Viewing the Model to preview the model or create a rendered image.
The menus on the top of the screen work like standard Macintosh menus. For example, selecting save from the File menu will save the currently active window. Try saving the program you just typed in. Later, when you quit Jabka you can get back to this point simply by double-clicking on the program document that you just saved.
Jabka knows about a small collection of geometric objects. These are predefined as either polygonal surfaces, or quadrics. All of these objects are sized so that they fit exactly within a 200 x 200 x 200 cubic volume centered at the origin. In other words, their maximum extents along each of the three coordinate axes are +100 and -100.
All geometric objects have surface properties, like color, that are determined by the material from which the object is made. Later, you will learn how to make virtually any color and/or material you want, but for now we will stick with materials of a few predefined colors and whose surface properties are like plaster (i.e. a matte finish). The predefined colors are red, yellow, green, cyan, blue, magenta, and the greys black, dkgrey, grey, ltgrey, and white. For each of these colors, there is a corresponding plaster-like material named, respectively, red-plaster, yellow-plaster, green-plaster, cyan-plaster, blue-plaster, magenta-plaster, black-plaster, dkgrey-plaster, grey-plaster, ltgrey-plaster, and white-plaster.
A geometric model is made from part and primitive objects, attached to each other in a hierarchy by piece objects. The primitive objects actually describe surfaces. The only kind of primitive we will deal with for a while are polysurface and quadric. The piece objects define which sub-parts and primitives make up a part. A part object is created by the command:
(object name part messages)
where name is a unique name you supply for the part, and messages is a group of methods (or commands) you use to further specify the part. For example, one method is setmaterial, as used in the message (setmaterial mat), where mat is a material. Another important method for a part is addchild, as used in (addchild child transform), where child is the name of a part or primitive object that is to be added to the part via a piece, and transform (which is optional) is a geometric transform that determines the spatial orientation and scaling of the child within the part. addchild automatically creates a piece object connecting the child to the part. For example:
(object trunk part
(addchild cylinder (scale 0.1 0.3 0.1))
(setmaterial yellow-plaster))
creates a part named trunk that consists of a cylinder. The method setmaterial in the example is used to define the material from which the object is made. In the example, the material for trunk is the predefined material yellow-plaster.
The standard geometric transformations of translate, rotate, and scale, as well as the identity transform, are available. These transforms are created by the functions:
Jabka's predefined (or default) camera expects to find a part named scene at which it is directed. In order to create an object named scene and add objects to it to be viewed, simply create the part, and use the addchild method as in the example:
(object scene part
(addchild tree)
(addchild base (translate 0 -135 0)))
The program you write to define a model is only a description. You must now tell Jabka to evaluate your program, so that it will actually build the model that you have described. You do this by simply choosing Select & Eval All from the Edit menu. This tells Jabka to select your entire program and evalute it. If the evaluation proceeds without errors, your model will have been been created. To display a wireframe version of the model, simply select the default-camera item from the Camera menu, and then select Preview from the Render menu. This will display the wire-frame as well as a control panel for the camera. You may then use the camera controls to adjust the camera's point of view, and when you are satisfied with the camera position you can produce a color shaded image by selecting Render from the Render menu.