So it’s fair to say we might have gone a little crazy tricking out the turtle in microM8‘s OpenGL Apple Logo implementation…
New Graphical Primitives:
Wireframe:
Reminder: SETPC color – sets the ‘pen’ colour
SETPOPA x – sets the pen opacity (0-255)
BOX size
RECT sizex sizey
POLY size sides
ARC size degrees
CIRCLE size
TRIANGLE side1 side2
CUBE size
CUBOID sizex sizey sizez
Solid:
Reminder: SETFC color – sets the ‘fill’ colour
SETFOPA x – sets the fill opacity (0-255)
ISO size (new name for FILLEDTRIANGLE / FT)
SQUARE size
QUAD sizex sizey
SPOT size
POLYSPOT size sides
PIE size percent
WEDGE height width
PYRAMID size
SPHERE size color (turtle at centre)
VOXEL size
VOXELOID sizex sizey sizez
Text
The following commands affect text printed in the text layer:
OVERLAYSCREEN (full text layer over graphics)
SETTEXTCOLOR color
SETTEXTSIZE size
SETTEXTFONT num
SETPROMPTCOLOR color
SETPROMPTSTRING “string
These commands generate 3D text in the vector layer:
TYPE “string
SETTYPEFACE font
SETTYPESIZE size
SETTYPEDEPTH depth
SETTYPEFILLED boolean – if false, then renders text as wireframe
SETTYPESTRETCH aspect
Sound
MUSICPLAY “filename – play microTracker .sng file
MUSICSTOP
SETINSTRUMENT “filename.sng – loads .snd instrument saved from microTracker
PLAYNOTES “L1A2C3 etc. see microTracker documentation (notes must be in UPPERCASE)
NOISE hz duration(in 60ths of a second)
Multi-Turtles
One turtle isn’t enough? Well, you can have more! Just switch to a different turtle using
SETTURTLE x
where x is the number of the turtle you want. The turtle you select will then respond to any further commands. You can have up to 128 turtles!
Loops
REPCOUNT – is a function that contains the current loop iteration in a REPEAT
WHILE comparison [DO THIS STUFF]
eg WHILE A = 5 [PR “frog]
FOR “var target [DO THIS STUFF]
where var is a variable containing the starting number of the for loop, and target is the target number. If the number is less, the FOR loop operates in descending order
eg MAKE “count 1 FOR “count 10 [pr :count]
STEP value
sets the stepping value of the following FOR loops (and the current one, if inside of one)
eg MAKE “count 1 STEP 5 FOR “count 50 [pr :count]
note the ” before the variable in the FOR statement, similar to MAKE
Multi-Threading!
And what would be the point of having multiple turtles if they couldn’t do their tricks all at the same time? If you want a Logo routine to execute in the background, just type:
LOGO [routine]
and off it will go. You can also put commands in there, such as
LOGO [REPEAT 100[FD 10 RT 160]]
You can see what Logo routines are running by typing ROUTINES
You can ‘kill’ a Logo routine by typing KILL and the number of the routine (listed in ROUTINES)
You can also KILLALL Logo routines!
If you want to launch a (or several) Logo routine(s) but then wait for it/them to finish before continuing, you can use DAWDLE.
Backtrack
Turn back time with BACKTRACK /BT ! BT undoes the last thing you did. You can BT back repeatedly too…
Camera
CAMCONTROL boolean – eg CAMCONTROL on
Lets you control the camera with the mouse / joystick.
No button(s): Orbit around the camera’s ‘lookat point’
Left button (button 0) + direction: shift the lookat point up / down / left / right
Right button (button 1) + direction: up/down (zoom in and out, also scrollwheel) left/right (rotate camera left or right)
CAMFOLLOW – keeps lookat point at turtle position
CAMTURTLE – moves lookat point to turtle
Miscellaneous
COLORS – list the available colours
RAISE (RA) x – same as UP 90 FD x DN 90
LOWER (LO) x – same as DN 90 FD x UP 90
SHUFL (SL) x – slide turtle left x
SHUFR (SR) x – slide turtle right x
SETRENDER boolean – enable or disable rendering
SLOW – operates at ‘normal’ speed
FAST – goes as fast as possible
WAIT x – waits for x 60ths of a second
SWAP :var1 :var2 – swaps the contents of the two variables
SETPOS3D x y z – sets the 3D position of the turtle
SETHEADING
SETPITCH
SETROLL…
There’s still more but this is enough for now. Have fun!
Be the first to comment