Difference between revisions of "Glome tutorial"

From HaskellWiki
Jump to: navigation, search
 
Line 9: Line 9:
 
runhaskell Setup.lhs install
 
runhaskell Setup.lhs install
   
Glome doesn't really need to be installed in order to run it. If you'd prefer, you can invoke it from the build directory as "./dist/build/glome/glome".
+
Glome doesn't really need to be installed in order to run it. If you'd prefer, you can invoke it directly from the build directory as "./dist/build/glome/glome".
  +
  +
If everything works, a window should open and you should see a test scene with a variety of geometric shapes. If it doesn't work, then let [http://syn.cs.pdx.edu/~jsnow me] know.
  +
  +
==Command line options==
  +
  +
These are pretty sparse at the moment. You can specify an input scene file in NFF format with the "-n [filename]" option, and there is one such scene included with Glome, a standard [http://tog.acm.org/resources/SPD/ SPD] level-3 sphereflake.
  +
  +
NFF isn't very expressive (and it was never intended to be), so I won't say much about it here. Glome supports most of the basic features of NFF except for refraction. My approach to polygon tesselation is also questionable: the SPD "gears" scene, for instance, doesn't render correctly.
  +
  +
You may have to adjust the lighting to get satisfactory results (i.e. by adjusting the value of "intensity" in "shade" function in the Trace.hs file and recompiling). NFF doesn't define a specific intensity, and I'm not sure what sort of falloff (if any) Eric Haines used when he rendered the reference images.
  +
  +
==Describing Scenes in Haskell==
  +
  +
===Camera===
  +
  +
===Spheres, Triangles, Etc..===
  +
  +
===Groups===
  +
  +
===CSG===
  +
  +
===Transformations===
  +
  +
===Bounding Objects===
  +
  +
===The Bounding Interval Hierarchy===
  +
  +
==Navigation==
  +
* [[Glome]]

Revision as of 01:11, 26 April 2008

Installing Glome

First, you need to install the software. I will assume that you already have ghc and the Haskell OpenGL libraries installed, and are comfortable with "tar" and the like. See How to install a Cabal package.

The source code is available from hackage. You must untar the file ("tar xvfz [filename]", "cd glome-hs[version]") , and then build the binary with:

runhaskell Setup.lhs configure --prefix=$HOME --user
runhaskell Setup.lhs build
runhaskell Setup.lhs install

Glome doesn't really need to be installed in order to run it. If you'd prefer, you can invoke it directly from the build directory as "./dist/build/glome/glome".

If everything works, a window should open and you should see a test scene with a variety of geometric shapes. If it doesn't work, then let me know.

Command line options

These are pretty sparse at the moment. You can specify an input scene file in NFF format with the "-n [filename]" option, and there is one such scene included with Glome, a standard SPD level-3 sphereflake.

NFF isn't very expressive (and it was never intended to be), so I won't say much about it here. Glome supports most of the basic features of NFF except for refraction. My approach to polygon tesselation is also questionable: the SPD "gears" scene, for instance, doesn't render correctly.

You may have to adjust the lighting to get satisfactory results (i.e. by adjusting the value of "intensity" in "shade" function in the Trace.hs file and recompiling). NFF doesn't define a specific intensity, and I'm not sure what sort of falloff (if any) Eric Haines used when he rendered the reference images.

Describing Scenes in Haskell

Camera

Spheres, Triangles, Etc..

Groups

CSG

Transformations

Bounding Objects

The Bounding Interval Hierarchy

Navigation