This directory contains the sample code for a 3D point-set viewer
written using Tcl/Tk, from "Using Tcl and Tk from your C Programs"
in issue #10 of Linux Journal. This code is Copyright (c)1994 by
Matt Welsh, and placed under the GNU General Public License. It is
redistributed here with permission of Linux Journal.

The program is not linked against the Tcl/Tk libraries. Instead,
it forks an instance of `wish' as a child process and communicates
with it via two pipes: One to write Tcl/Tk commands to `wish', and
another to read strings printed back. The file child.c contains
the code to start the child process and set up the pipes, and splot.c
contains the 3D routines which read a data file of points, sending
`wish' the appropriate commands to display the set. splot.tcl is the
script sent to `wish' to create the scrollbars, buttons, and the like.
When a scrollbar moves, `wish' prints a string indicating the position
of each rotational axis, which `splot' reads and uses to to the 3D
transform, finally sending `wish' the commands to draw the points at
the appropriate 2D locations.

To use this program you must have `wish' installed, and it should be
on your path. You'll also need gcc, make, and related tools to build
the program. To do this, just issue
	make
in this directory. The resulting executable is `splot', and you invoke
it as
	splot <datafile>

where <datafile> is a file containing a list of 3D points, along with
a colour value from 0 to 6. For example,

	-50 -50 -50 0
	 50 -50 -50 1
	-50  50 -50 2
	-50 -50  50 3
	-50  50  50 4
	 50 -50  50 5
	 50  50 -50 1
	 50  50  50 2

defines a 3D cube. splot.c lists the colours used for each value in the
fourth column. cube.dat and points.dat include sample files; the latter
consists of points describing regions in a k-nearest-neighbour classifcation
of an image as described in the article.

Let me know if you have any problems or questions!

Cheers,
M. Welsh, mdw@sunsite.unc.edu
