To build, check that the X11_HOME and OPENGL_HOME variables at the top of Makefile are correct for your system, and then type "gmake". It's been tested on Linux and FreeBSD.
To start the Python version, type this at the shell prompt:
% python -i turtle.py
A window should pop up now, with a pointy triangle (the "turtle") in the middle of that window.
And then a sample session might look like this:
>>> fd(50) >>> rt(90) >>> fd(45) >>> up(120) >>> rl(45) >>> fd(60)
The names of the commands are inspired by Logo's -- fd=forward, bk=backward, rt=right, lt=left, pu=pen-up, pd=pen-down. In addition, you can pitch the turtle up (up) or down (dn), and roll it (rl -- there's no "left roll", just roll by a negative number of degrees).
Use your mouse to rotate (left button + drag), pan (middle button) and zoom (right button) the image.
There is no "sphere mode"; you can type sfd and then fd anywhere and anytime you want. However, sfd always assumes the turtle is currently on the surface of a sphere. So, in a sequence of commands such as
>>> sfd(90) >>> fd(100) >>> sfd(90)the first and second sfd's will each trace one quarter of a great circle, but they will not lie on the same sphere.
If you want to see a shaded blue sphere like the one at right, give the following commands:
>>> sphere(1) >>> lighting(1)
The executable you have built -- draw -- reads Logo-style turtle commands from standard input. Thus the following could be considered the minimal interface:
% cat | ./draw fd 50 lt 120 pu
And less minimal but still quite spare:
% sh | ./draw for i in 1 2 3 4 5 do echo fd 50 echo rt 75 done
logo turtle3d.lgThis should bring up the OpenGL window -- not Logo's graphics window but the window that's produced by the "draw" executable. You're now off and running. You have the standard Logo turtle commands fd, bk, rt, lt, pu, pd, ht, st as well as the 3-D ones up, dn, rl and the spheroidal sfd and sbk. To bring up the blue sphere type lighting 1 sphere 1.
% pythonand then, at the Python interpreter prompt, type
>>> from turtle import * >>> turtleInit() >>> import examplesthen execute one of the functions from examples.py as follows:
>>> examples.randwalk3d()And we can go even more automated than that. Have a look at the file callexamples.py, and then, at the shell prompt, type
% python callexamples.py
Author: Ted Sternberg