Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.


source files: [xc]tfm.[ch]


(SEND <tfm> :TURTLE-FORWARD <fix-or-flo:distance>)
(SEND <tfm> :TURTLE-RIGHT   <fix-or-flo:distance>)
(SEND <tfm> :TURTLE-UP      <fix-or-flo:distance>)


The TURTLE calls are named because they are the 3-D equivalent of 2-D 'turtle graphics' in which a (usually imaginary) turtle dragging a pen is given commands to turn or move. The main difference between turtle graphics and regular graphics commands is that regular graphics commands usually work in a fixed global coordinate system, but the turtle carries its own coordinate system with it, and executes all commands with respect its current position and orientation.

Class MATRIX44 implements turtle graphics by means of the :LOCATION, :TARGET and :UP points internal to each <tfm>. At any given time, the 'local' coordinate system of the transform is defined by these three points. The transform is 'at' :LOCATION, looking toward :TARGET (that is, the Z axis runs from :LOCATION out through :TARGET), with :UP as near the zenith as practical (the local Y axis is perpendicular to the local Z axis, and in the plane defined by the three points).

Each of the :TURTLE messages updates :LOCATION, :TARGET and :UP as appropriate.

Since the :TURTLE calls are frequently used to implement flythroughs, they use standard aeronautical terminology: rotating around the local Z axis is called ROLL, rotating around the local Y axis is called YAW, and rotating around the local X axis is called PITCH.

In all cases, sense of rotation is given by the right-hand-rule within the local left-handed coordinate system: if you point your right thumb along any positive axis, the direction of positive rotation is given by the natural curl of your fingers.

There are no :TURTLE-LEFT/DOWN/BACKWARD messages, just use a negative argument with :TURTLE-RIGHT/UP/FORWARD.

Go to the first, previous, next, last section, table of contents.