Using Open Geometry GL with LINUX
Abstract
OpenGeometry is a graphic library for programming geometry. It
is based on C++ and OpenGl/Mesa3D. The reader is enabled to
realize geometrical thinking without having to care much about
implementation. (cit. from the preface of the first book)
The source-code of the library is published with these books:
- Version 1: Open Geometry: OpenGL + Advanced Geometry by Georg Glaeser, Hellmuth Stachel,
1999 Springer,
ISBN 0-387-98599-9
- Version 2: Handbook of geometric programming using Open Geometry GL by Georg Glaeser, Hans-Peter Schröcker,
2002 Springer,
ISBN 0-378-95272-1
In order to compile the library with gcc under LINUX you have to patch the source-code.
Get Open Geometry running with LINUX
Please note: the library source-code is only provided with the books.
Open Geometry Version 1
Follow these generic steps to get the program compiled with
LINUX. The details to setup the C++-development environment
for OpenGL development are beyond the scope of these hints.
- Basicly you need LINUX with a GNU-C development environment - gcc
- As this is all about OpenGL you also need the free implementation of it, a Mesa3D development environment:
- The OpenGL API - libgl1-mesa-dev
- The OpenGL utility library - libglu1-mesa-dev
- The OpenGL utility toolkit - freeglut2-dev
The names of the software-packages to install vary depending
on the used LINUX-distribution. These names are from
Debian.
-
Now the rest should be straight forward. Enter the following statements in a terminal window:
(1) mkdir og10
(2) cd og10
(3) unzip -x opengeom.zip (That are the sources from the book-CD)
(4) patch -p1 < og1.0_linux0.1.patch (That's the patch)
(5) make
(6) ./x
(7) bash ./show_examples.sh
Explanation:
- Create a directory to hold all our data (optional)
- Change to this directory (optional)
- Unpack the zip-archive with the library-source
- Apply the patch
- make compiles the library and creates a first executable
example, called x.
- Start up the example. It shows a simulation of earth and moon. You can animate the
view by pressing keys f and t in turn
and change some options like viewpoint, lightning, zoom, ... Key
k shows a list with the options.
-
The last step starts up a dialog-programm in the
terminal-window where all the examples that are provided
with the library source can be compiled and run in
turn. Use the cursor-keys to select an example and RETURN
to start it. Please note: Most of them are working, but
some don't.
Show_examples.sh uses the program dialog to
show the list. The reqired Debian package is called -
dialog.
Open Geometry Version 2
Use this small recipe to get the library running under LINUX.
This is for Open Geometry GL version 2 and Knoppix 5.3.
Please note: the library source-code is only provided with the books.
- Get LINUX running on your PC. If you don't have it already,
use a LINUX-Live-CD or -DVD. This boots LINUX from a CD or DVD
without changing any data on your PC. This description is based
on the Knoppix 5.3
DVD that is bundled with the German computer magacine
c't 6/2008.
- Get the library source-code and the linux-patch
and copy both files to a media that can be accesed from LINUX.
A common way would be to copy both files to a USB-stick. The
source-code of the library is located on the bundled CD in the
file:
linux/og20.tar.gz
- Boot with the Knoppix-5.3 DVD and insert the USB-stick. The
desktop should show an icon for the USB-stick that contains the
source and the patch. Double-click this icon. The address-line
of the file-browser shows the mount-point of the media. Remeber
its name. (Skip the prepending "system:")
- The following commands are to be entered in a terminal window. The prompt shows you are user knoppix.
(1) mkdir og20
(2) cd og20
(3) tar -xvzf [mountpoint-of-the-stick]/og20.tar.gz
(4) cd OpenGeometry2.0
(5) patch -p1 < [mountpoint-of-the-stick]/og2.0_linux0.1.patch
(6) sudo ln -s /usr/lib/libglut.so.3 /usr/lib/libglut.so
(7) make
(8) ./x
(9) bash ./show_examples.sh
Explanation:
- Create a directory to hold all our data (optional)
- Change to this directory (optional)
- Unpack the tar-archive with the library-source
- Change to the newly created directory
- Apply the patch
- This is wired. Knoppix doesn't provide the needed
GLUT-Library under its usual name. So we create this alias for
the lib.
- make compiles the library and creates a first executable
example, called x. Don't mind the many warnings.
- Start up the example. It shows a geometrically constructed
shell in front of a photograph of a shell. You can animate the
shell by pressing keys f and t in turn
and change some options like viewpoint, lightning, zoom, ... Key
k shows a pop-up with all the options.
-
This last step starts up a dialog-programm in the
terminal-window where all the examples that are provided
with the library source can be compiled and run in
turn. Use the cursor-keys to select an example and RETURN
to start it. Please note: Most of them are working, but
some don't.
Known problems
Non accelerated graphic: if the X-Server doesn't provide an accelerated driver for your graphic card, the animations will be slow.
Some examples are not functional: Due to different reasons some examples don't work. If you can fix a problem, please send a patch.
Links
Franz Zahaurek
Last modified: Fri Dec 2 16:49:28 CET 2011