Multiple Turtles

SETTURTLE
TURTLE
HASOWNPENP
TURTLES
BITMAPTURTLE
NOBITMAPTURTLE
SETTURTLEMODE
TURTLEMODE
ASK

FMSLogo supports multiple turtles. Each turtle maintains its own heading (orientation in 3D), position, and pen control. Turtles can be individually represented as a picture using BITMAPTURTLE. By default, all turtles share the same pen mode, pen color, and pen size, but you can make individual turtles have their own pen by supplying an optional input to SETTURTLE.

Turtles start at index 0, which is the default turtle. All turtles between 0 and the highest turtle ever selected are "activated", so don't choose turtle 100 and 200 if you only need 2 turtles. Having thousands of active turtles may slow FMSLogo down considerably as it pauses to redraw every turtle after every instruction. Pressing the "Reset" button or running CLEARSCREEN selects turtle 0 and deactivates all other turtles.

In addition to the turtles which you can create, there are also three special turtles which are used in PERSPECTIVE mode.

IndexTurtle
-1His position represents where your eye is when viewing a 3D scene (defaults to [400 400 600]). His orientation does not matter. Changing this turtle's position does not have any effect on the screen until something new is drawn.
-2Her position represents where your eye is looking when viewing a 3D scene (defaults to [0 0 0]). Her orientation represents which direction is "up" on the screen (defaults to [0 0 0], the positive Y axis is up). Changing this turtle's position does not have any effect on the screen until something new is drawn.
-3Its position represents where the light source is positioned (defaults to [0 0 1000]). Its orientation does not matter. This turtle only matters when you're using POLYSTART and POLYEND.

Note that you cannot look in the same direction as "up". For example, if turtle -2 is in her default position and orientation and you set turtle -1 to somewhere along the position Y axis, say [0 1000 0], you won't be able to see anything.

These special turtles are never shown or bitmapped. Each time you enter PERSPECTIVE mode all special turtles are reset to their default position and orientation.


SourceForge.net Logo