Previous Next Table of Contents

3. Support Classes

3.1 3D Turtle Graphics - ``Dragon Graphics''

To support OpenGL drawing and make it much easier than plain OpenGL, there is a 3D turtle graphics, also called ``dragon graphics''. The basic principle of turtle graphics is the ``turtle'', a directed point in the coordinate space that can move around and leaves a trail on its way.

For 2D turtle graphics, there are not much settings to choose. You can set the color and the width of the line you stroke, or choose to fill your path, but that's it. 3D objects have much more aspects than simple lines or flat surfaces. Therefore, a 3D turtle graphics demands other features to define the trail it leaves.

First, the turtle flies through space, and is therefore called ``dragon''. This increases the degree of freedom - a 2D turtle can only turn left or right, a 3D dragon can turn left, right, up, and down. Additionally, it can roll to the left or right.

Then you have to define the vertex points of your trail yourself. You can define points around the current position of the dragon, which are connected to points around the previous stop of the dragon. These rounds around the dragon are knit together, forming the ``trail'' of the dragon. You can add or drop vertex points, but if you drop point, make sure that they are at least on a straight line (or better all on the same location).

There are several groups of operation, let's start with the navigation of the dragon. The angles used are radians by default.

There are some functions to save and restore the turtle's state, and to use the turtle matrix stack for matrix multiplications, so that you can create arbitrary synthetic transformations with one step.

Then there are the operations to create pathes. A path is partitioned in ``rounds'', where each point in one round is connected to the corresponding point in the previous round. Rounds can add points or drop points from the previous round (dropped points are not connected, and therefore should be at least in a line with those points that are connected). The first round in a path has to be defined immediately after open-path, the other rounds must be enclosed in open-round and close-round.

The turtle graphics supports several drawing modes: points, wire-frame, solid, and textured.

3.2 SQL Interface

The SQL interface allows to interface with a database using the structured query language SQL. It now has only an interface to PostgreSQL, because noone wrote one to other databases.

The database interface has a simple foundation. You can send an SQL query string and get the result back as a table.

There are also some output functions to display the result of a query or to create a table containing the entries

A set of methods facilitates the creations of new tables

There are also ways to construct a query string

Previous Next Table of Contents

Bernd Paysan, 09feb1999, 04apr1999