15-463 Course Software
Libraries
The subroutine libraries we will be using most are the same ones
you probably used in 15-462:
-
OpenGL
is a programming interface for interactive 3D graphics.
We have the man pages on line. OpenGL implementations
exist for various platforms. SGI has their own, of course.
To learn more OpenGL we recommend the book
OpenGL Programming Guide, 2nd Edition: The
Official Guide to Learning OpenGL, Version 1.1
by Mason Woo, Jackie Neider, and Tom Davis,
Addison Wesley, 1997.
(The first edition of this book is fine, too).
You can read the OpenGL Programming Guide
online using the Insight electronic documentation package on the SGI's. Type
"insight &" into an SGI, wait a minute for the program to start,
then find "OpenGL_PG" in the top subwindow and double-click on it.
- Mesa is a free
OpenGL clone which runs on almost anything, albeit more slowly.
The Mesa README
file is also useful, especially for tips on how to manage
X-Windows color maps.
Mesa can emulate a 24 bit display on an 8 bit one, and that's the way
we recommend using Mesa on the Suns.
Setting up the colormap so this works right is a bit tricky.
If you want the full story, see
the user guide,
and do a find for "glXChooseVisual".
The code we're providing for the assignments
should set things up so that you don't
need to worry about this, however.
We are using Mesa on the Suns.
-
Xforms
is a GUI
programming package that we find much easier to use than TK.
(As of 2001, the previous link to the university of Wisconsin at Milwaukee
is dead, but try this
mirror instead
).
There's
an online manual. Xforms comes with an
interactive interface design and layout program called fdesign. If
you already know and love TK, or something else, feel free...
-
SVL,
the Simple Vector Library, written by Andrew Willmott here at CMU,
is a C++ library for vector and matrix arithmetic.
It is very useful for operations with xyz vectors, colors, and transformations.
-
libpicio.
This is a little library provided for your convenience. It
supports a very simple interface to and write TIFF or PPM picture files.
Some of our programs,
such as xplay, use this library. The routines you might be
interested in are pic_read and pic_write. To use
this library, you need to put #include <pic.h> in your
source code and -lpicio on your link line. Currently, the
only documentation for the library is the header file,
pic.h,
and the simple program
tifflmap.c.
The latter shows how to use the library to write a simple program to
read, modify, and write a TIFF picture file.
The source code for libpicio is in
classdir/pub/src/libpicio.
Libpicio is a layer on top of Sam Leffler's excellent
libtiff library for
TIFF picture file I/O.
We'll be supporting three platforms: the cluster Sparcs, SGI's,
and Linux machines.
You may use other platforms, but in that case you're more on your own.
To avoid porting and installing a lot of software by yourself,
we recommend that you use one of the supported platforms.
Other Software
-
tips on digitizing video
-
.mailcap file
-- see this if your web browser (netscape, explorer)
doesn't display postscript or pdf or quicktime or mpeg files properly.
-
xplay is a program written by me and past TA's for previewing animation.
It can read a sequence of PPM or TIFF picture files, page them into the
X windows server's memory, and display them in rapid succession.
If the sequence is short, or your machine has sufficient memory available
to its X windows server, sequences can be displayed in real time.
(If you're not getting real-time playback rates, then try a shorter
sequence of frames).
Run
xplay -
to get a usage message.
Setup
Put the class bin directory in your path so that you'll have easy access
to all the programs we'll need in this class.
setenv cs463pub /afs/andrew.cmu.edu/scs/cs/15-463/pub
set path = ($path $cs463pub/bin)
Linking
You must link in different libraries when using OpenGL on Suns and SGI's.
Typical link sequences are:
on SGI: -lforms -lGLU -lGL -lX11 -lm
on Sun: -lforms -lMesaGLU -lMesaGL -lX11 -lXext -lsocket -lm
and if you're linking with the pic_ and tiff_ routines,
then you'll need -lpicio -ltiff as well.
You'll need to type the commands
setenv LD_LIBRARY_PATH /usr/lib:/usr/local/lib:/afs/andrew/scs/cs/15-463/pub/lib
setenv LD_LIBRARYN32_PATH /usr/local/lib32
for shared object files such as libforms.so and libGL.so to be resolved
correctly.
It's probably a good idea to put these commands in your .login .
For hackers:
You can get a list of shared object files that a given executable looks
for, by running elfdump -Dl <PROGRAM> on an SGI
or ldd <PROGRAM> on a Sun.
If you're really curious about which versions of shared object files are
getting linked in, you can set the following environment variables and
this will affect the runtime linker, rld (on SGI's):
setenv _RLD_ARGS "-quickstart_info -v"
setenv _RLD_PATH /usr/lib/rld.debug
so that every time you run a program it will print gobs of info.
To turn off the linker debugging info, do
unsetenv _RLD_ARGS
unsetenv _RLD_PATH
Documentation
To get documentation via the "man" program, run this:
setenv MANPATH /usr/share/catman:/usr/share/man:/usr/catman:/usr/man:/usr/local/man:/afs/andrew/scs/cs/15-463/pub/man
or better yet, put it in your .login or equivalent shell initialization
file.
15-463, Computer Graphics 2
Paul Heckbert, Feb. 1999