README

Welcome to the first release of the Fandango scripted computer aided
drawing system. On this initial version the program can:

- Interpret python scripts
- Receive instructions from a integrated commandline
- Draw lines, triangles, line strips and triangle strips
- Set colors as layer attribute
- Enable alpha blending and basic texture mapping (a checkerboard)
- Display lighting for the triangle entities
- Set the light position from a mouse click
- Draw lines and triangles from mouse clicking
- Zoom and pan
- Rotate around an specified axis

Requirements:
Python2, GL or mesa, xlibs


To compile:
Run configure; make; make install as usual. Note that the configure
option "--with-python" can be used to define against which version of
python will the binary be linked.


Quick start:
Once installed run 'fandango' from a commandline. 'fandango -l' will
avoid to run the ${HOME}/.fandango file, and 'fandango -f' will enable
framerate counting.

Once started you should see a mostly black empty window, with some
text on it and a red and white crosshair. Try the following sequence,
writing directly over the window and pressing  after each
line. The text after a '#' is a comment.

_______  (commandline)

mix(func) # Will map a sine field over a plane
clearcolor(0, 0, 0.75) # Sets the background to blue
color(0.8, 0.7, 0, 254) # sets the console text color to pale yellow
                        # (color#254 is the console)
color(1, 0, 0, 255, 0.5) # sets the crosshair color to transparent
                         # red. (color#255 is the crosshair, the
                         # fourth optional component is the gamma
                         # value)
linew(5) # sets the default line width

## Click and hold the first mouse button while dragging up-down to
## rotate the model.

clear() # clears the screen
mix(func, func, 1, 7) # Creates a nice biologic shape
color(0, 1, 0, 1, 0.7) # Sets color#1 (default) to transparent green
blend(1) # enables transparence
blend(0) # disables transparence
texture(1) # enables texturemapping

clear()
mix(none, l=2) # creates a simple plane. It was created on color#2,
               # that has not been defined, and then is black
color(1, 0, 0, 2) # let's define color#2 as opaque red
mix(func, func) # render the sine field over the plane
blend(1) # enable transparence. color#1 was defined transparent,
         # remember? 
disk(fnc=sphere) # draw a nice spheric cone. Since the default color
                 # is transparent it is too.

# Hold the Control key while slowly dragging the mouse to the right
# until the third nmber between parentheses on the left down corner
# reaches between 10 and 40. Left click anywhere near the model.

clp() # this will set the light at the last click coordinates.
      # To set the z position hold Control and drag left-right.
      # The coordinates are displayed over the commandline, first
      # the GL coordinates and then the pixel position of the
      # cursor on the window.

_______


Dotfile.
If a file named .fandango exists at the user's home directory, its
contents will be executed as python functions before starting the
program. It's perfect for setting default colors.

Example dotfile for emacs colors (cut and paste between the lines):

_______  ~/.fandango
clearcolor(0.1843, 0.3098, 0.3098) # background
color(0.9607, 0.8705, 0.7019, 1, 0.5) # transparent gold
color(1, 0.4983, 0.1411, 2)           # orange
color(0.5294, 0.8078, 0.9803, 3)      # blue
color(0, 1, 1, 4)                     # greenish blue 
color(0.8549, 0.4392, 0.8392, 255, 0.5) # purple: crosshair
color(0.9607, 0.8705, 0.7019, 254) # golden: console
_______


Loading modules.
Create a directory on your local home, let's say ~/lib/fandango.
Add to the end of your dotfile the following line:

sys.path.append("/home/user/lib/fandango")

Substitute /home/user for the actual path of ${HOME}.

Store your .py module files there. To import them at load time, add
the appropiate 'import foo' to the dotfile. Some examples that draw
fractals can be found at the homepage.



Downloading.
Visit http://www.soffernet.com/jaime/fandango/ for new versions.
Fandango, V0.1 README