You are here: Home Downloads About Coin3D Related projects Ivy
Navigation
Log in


Forgot your password?
 
Document Actions

Ivy

Ivy is an Open Inventor binding for Scheme. We at Systems in Motion keep our own local Subversion repository of the Ivy sourcecode, which includes numerous improvements over version 1.6, which was the last official release.

To learn about Ivy, go see the official Ivy project page.

How to build and install Ivy

This presents a step-by-step guide on how to download, configure, install and test the Ivy package. It is assumed that you have already installed either Coin with the SoXt library binding against Xt/Motif, or the Open Inventor ditto on your system.
  1. Fetch the Ivy sourcecode from our Subversion repository:
    $ cd [your-src-dir]
    $ svn checkout http://svn.coin3d.org/repos/Ivy/trunk Ivy
    

    After a while (depending on the speed of your network connection and possible congestion on the networks in general), the sourcecode should now be available under the Ivy/ directory.

  2. Now configure for the build:
    $ cd [your-build-dir]
    $ mkdir Ivy
    $ cd Ivy
    $ [your-src-dir]/Ivy/configure
    

    Note: if you are using SGI's Open Inventor library, not Coin, you need to add the option "--with-inventor" to the configure script invocation.

    The configure script will now run through your system configuration to see that everything is installed ok. If you have any problems here which you can't seem to get resolved easily, please get in touch with us.

  3. Now build:
    $ make
    

    This will take some time. If the build process aborts prematurely due to a compiler or link error, please let us know.

    When the build has completed, Ivy is now ready for use.

  4. Running Ivy:

    The Ivy Scheme application depends on two environment variables which you need to set up before running:

    $ export SCHEME_LIBRARY_PATH=[your-src-dir]/Ivy/SchemeInitFiles/slib/
    $ export SCHEME_INIT_PATH=[your-src-dir]/Ivy/SchemeInitFiles/scm/
    

    (If you are using some variant of the C-Shell, use 'setenv' instead of 'export', and a space instead of '='.)

    Note that Ivy is very picky about the trailing '/' on these environment variables, so be sure to include them.

    Now you may run Ivy like this:

    $ cd [your-build-dir]/Ivy/IvySCM
    $ ./ivyscm
    
  5. Testing that it works.

    On the Ivy prompt, try loading one of the example programs distributed with the sourcecode:

    > (load "[your-src-dir]/Ivy/Examples/hello-cone.scm")
    

    An SoXtExaminerViewer window with a cone should now pop up within a few seconds. If you look at the sourcecode of hello-cone.scm, you can see that the SoCone in the viewer is defined by the name "my-cone". Now you can for instance try this to see how you can dynamically alter a field value at runtime:

    > (define my-cone-height (-> my-cone 'height))
    > (-> my-cone-height 'setValue 10.0)
    > (-> my-viewer 'viewAll)
    

    Whee! Now start coding some fancy 3D-applications in Scheme!

Using Ivy from Emacs

As anyone who has worked with the kind of interactive environment you can get from an editor knows, using solely the command prompt of your Scheme or Lisp is unnecessarily frustrating.

This is how to set up and interact with Ivy from the Emacs editor:

  • Store these expressions in your $HOME/.emacs file:
    (setenv "SCHEME_LIBRARY_PATH" "[your-src-dir]/Ivy/SchemeInitFiles/slib/")
    (setenv "SCHEME_INIT_PATH" "[your-src-dir]/Ivy/SchemeInitFiles/scm/")
    (setq scheme-program-name "[your-build-dir]/Ivy/IvySCM/ivyscm")
    

    (You should also evaluate them immediately by using one of the EVAL-* ELisp functions.)

  • Call the RUN-SCHEME function (i.e. "M-x run-scheme"). A new buffer "*scheme*" should occur, where you can see Ivy starting up.
  • Make your own buffer by doing "C-x b" (SWITCH-TO-BUFFER) with argument "ivycode.scm" (or whatever name you choose for the buffer/file to put your Scheme code in).
  • Set the new buffer in SCHEME-MODE (i.e. run "M-x scheme-mode").
  • You can now write Scheme expressions in freeform, evaluating them by for instance using "C-c C-e" (i.e. SCHEME-SEND-DEFINITION) on single expressions or "C-c C-r" (SCHEME-SEND-REGION) on marked regions. Note that error messages and other output will still go to the *scheme* buffer, so it is wise to keep a split view in Emacs between your code buffer and the Ivy *scheme* buffer.

This is a really nice way to do rapid prototyping of your Inventor- or Coin-based 3D applications.

Related projects
Resources