A Scheme Binding for Open Inventor
(build-recursive-fern fern-root surfsep 25 0.8 2.0 2.5 0.2 -0.2)
View the full source
Version 1.6 is now available; check the list of
changes. The source code is available for download.
Come visit the Schemelet page to see how to
make Ivy work with the World Wide Web!
Description of the Ivy Package
Ivy is a Scheme binding for Open Inventor. From the Scheme
home page at
Scheme is a statically scoped and properly tail-recursive dialect
of the Lisp programming language invented by Guy Lewis Steele Jr. and
Gerald Jay Sussman. It was designed to have an exceptionally clear and
simple semantics and few different ways to form expressions. A wide variety
of programming paradigms, including imperative, functional, and message
passing styles, find convenient expression in Scheme.
Open Inventor is a
3D graphics toolkit developed by Silicon
Graphics. Open Inventor provides a large set of C++ classes which makes
developing sophisticated, interactive programs using 3D computer graphics
much easier than ever before.
The Ivy package provides a Scheme interface to nearly all of the
Open Inventor classes. This means several things:
- You can interactively edit Inventor programs and scene graphs,
because Scheme is an interpreted language.
- You can include Scheme code in Inventor scene graphs. This allows
the possibility of including real computational code inside of an Open
- You can create callbacks which execute Scheme code rather than
call a C function. These callbacks can then be interactively modified at
- You will never, ever have to write an interactive text-based
interface for an Open Inventor program again.
Operation of Ivy
Ivy works by providing a consistent interface to the member
functions and class variables of the Open Inventor classes. The underlying
C++ functions are called from the Scheme backend. From the user's point of
view, hopefully, all that will need to be learned is a simple syntactical
Ivy is implemented as an extension to Aubrey Jaffer's SCM Scheme
interpreter. A modified version of scm4e1 is included within the Ivy
distribution. However, all the differences from the original SCM
distribution are enumerated within, so you can obtain the original distribution
and modify it to work with Ivy if you wish. Note that Aubrey has continued
development of SCM since Ivy was first developed, and that I have not yet
had time to bring Ivy up to date; see the suggested
projects section of this page.
What the Ivy Package Provides
The Ivy sources can be compiled into SCM to create a program which is a
Scheme interpreter with knowledge of most Open Inventor classes. You can
write programs in Scheme and interact with them visually via the Open
Inventor toolkit. These programs can be modified at runtime to provide a
rapid prototyping environment for Open Inventor. Ivy also provides a simple
C++ wrapper to SCM to allow a Scheme interpreter to be quickly embedded
into an existing C++-based Inventor program.
Ivy contains most of the Inventor Mentor examples converted to Scheme, as
well as most of the macros (
SO_KEY_PRESS_EVENT, etc.) and
enumerations defined by the Inventor headers. It also contains several
games written in Scheme which demonstrate its usage.
- Improved user interface. Pressing return brings the prompt back.
- Removed UsrLocalLib.tar.gz and replaced with SchemeInitFiles
directory, which can be installed anywhere and pointed to with
SCHEME_INIT_PATH and SCHEME_LIBRARY_PATH environment variables.
- Incorporated into emacs via cmuscheme.
- Brought up to date with latest compilers. Fixed some bugs
that old C++ compilers allowed to slip through. Still compiled -o32 by
default because of incompatibility problems with 6.3 and 6.4, though
-n32 is known to work on 6.2 and 6.5.
- New helper routines in CGWInit.scm (loaded by default) for setting up
sensor callbacks. Thanks to Tom Minka.
- More examples: combat and joust.
View the source code for the included Space Combat game
How Ivy was Created
Ivy was generated using Header2Scheme,
an automatic C++ to Scheme interface generator. Nearly all of the code
comprising Ivy was auto-generated. (Weighing in at nearly 150,000
lines, it would have been extremely impractical to code by hand.)
Recreating the source for Ivy now takes approximately ten minutes.
ivy-1.6.tar.gz (3729K) contains the source
code for Ivy, all examples, and a precompiled ivyscm executable compiled on
Irix 5.3 (o32) with Inventor 2.1. This executable has been tested on 5.3,
6.2, 6.3, 6.4, and 6.5.
An ivyscm executable is now included in the distribution. If you need to
compile Ivy in order to embed it in your own applications you will need
SGI's C++ and C compilers (7.2 or newer recommended, though older versions
back to those shipped with 5.3's IDO should work) and the Inventor 2.1
Using the standard (debugging) compile options, compilation of the Ivy
package requires approximately 100 MB of free disk space. The object files
generated by the Ivy source code take up approximately 30 MB of space;
these may shrink greatly if you use different compile options than the ones
that come with the package and strip the resulting executables of
symbols. The Ivy library takes up another 30 MB, but once it is built the
object files can be removed. (However, ar requires as much work space as
the final library will consume.) Finally, the resulting SCM executable
(linked against the Ivy library) takes another 30 MB of disk space.
Known bugs (It's not a bug, it's a feature!)
- SoDB::read(SoInput *in, SoNode *&rootNode) is broken; other functions
which take references to pointers may also fail to propagate results back
to Scheme. I did not fix this in this release for fear of breaking
currently working parts of the system.
Suggested projects for people interested in developing (rather than using)
- Bring up-to-date with Aubrey Jaffer's latest version of SCM:
- Port over BIGSMOB and ALLOCATEZERO modifications
- Implement required repl_once functions (may already be in rope.c)
- Implement Scheme.c++ in terms of new SCM (SCHEME_SET_GC_BASE et al.)
Please notify me via email if
you find problems with the distribution or documentation, or if you have
any comments or questions.
Kenneth B. Russell - email@example.com
$Id: index.html,v 1.18 2001/06/02 05:20:53 kbrussel Exp $