3DSoftware.com > Programming > OpenGeom
Open Geometry 2.0
 
Open Geometry GL is a C++ programming library for modelling advanced geometric shapes.
 
Open Geometry GL (or simply “Open Geometry”) requires programming, and is therefore not as easy to use as other programs, but it allows you to model anything (it is “open” in that way). This is useful for advanced mathematics.
 
To use Open Geometry, you need the Open Geometry 2.0 book with its accompanying CD (shown at right). This is available in bookstores and universities (check with the math department). With its CD (and a C++ compiler) this book is all you need to run our Open Geometry programs. [ 1 ]
 
We will show how to get started with Microsoft C/C++ 6.0. [ 2 ] To install Open Geometry, insert the disk into your CD drive and follow the installation instructions. The default is for a tree of directories to be installed at:
Handbook of Geometric
Programming Using
Open Geometry GL
Georg Glaeser
& Hans-Peter Schröcker
Springer Verlag, 2002
 
This is the Open Geometry
2.0 book and CD you need
to compile and run our
Open Geometry files.
 
C:\Program Files\OpenGeometry
 
After installation is complete, close other MSVC++ 6.0 projects and then open this project file:
 
C:\Program Files\OpenGeometry\OpenGeometry2.0\mfcgl.dsw
 
Then build and execute.  A program should pop up that looks like this:
 
Footnotes:
 
1.   Another book of interest is the Open Geometry 1.0 book (Glaeser/Stachel, 1999). But you should use the software CD from the Open Geometry 2.0 book.
 
2.   We could not compile with VC 7.1. Complete source code is included, but we have not tried porting. Using VC 6.0 works for our uses. Note that Open Geometry has MFC quirks on Microsoft Windows (MFC was not designed for graphics programming). We have not tried using Open Geometry on other operating systems. Linux information is available at the Open Geometry support page. You can also download a template from that page to export from Open Geometry to POV-Ray (on any operating system).
 
Notice that you can press (and hold) the ‘H’ or ‘V’ key to spin the object horizontally or vertically.
 
Close that sample application, but leave the C++ project open, and take a look at the try.cpp file. The program you just ran, which is uncommented in try.cpp, is called paramsurf.cpp.
 
Now comment out that line, and type (or copy/paste) this line into try.cpp:
 
#include "HANDBOOK/circumcircle.cpp"
 
The book (top of page 10, Step 4) says this line is already in the try.cpp file.  But this line is no longer in the file, and if you search for that string as instructed in the book you will not find it. Instead, simply type it into try.cpp, or copy/paste it from above.
 
Now you are ready to proceed with the book's first tutorial, beginning with Step 5 on page 10. Build and execute the program, and an application window should appear with this graphic:
 
 
Close that application window, and open this file in the MSVC++ 6.0 project:
 
C:\Program Files\OpenGeometry\OpenGeometry2.0\HANDBOOK\circumcircle.cpp
 
As instructed in the book, add a fourth point M to the list of points:
 
P2d A, B, C, M;
 
Insert the following line as the last line in Scene::Init( ):
 
M = CircumCircle.GetCenter( );
 
And insert this line at the end of Scene::Draw( ):
 
M.Mark( Gray, 0.15, 0.1 );
 
Then build and execute the program, and the graphic should appear showing the center of the circle:
 
 
The next example (page 10, Section C) animates that window. Close the graphic application window from the last example, comment out its include statement in try.cpp, and copy/paste this line into try.cpp:
 
#include "HANDBOOK/circumference.cpp"
 
Build and execute the program, and in the graphic application window click on the animation (rotation) button:
 
 
 
Open Geometry includes html help as class header listings:
 
C:\Program Files\OpenGeometry\OpenGeometry2.0\oghelp.html
 
For more information look up individual functions in the book's index.
 
 
Some images on our web site were created with Open Geometry, and have a link for you to download the source code (.cpp file) that was used to create the image. You can rotate those images by pressing the ‘H’ or ‘V’ keys (or using the Open Geometry's toolbar buttons).
 
To run an Open Geometry file from our web site, download the file and then create an #include statement for it in try.cpp (as described above for circumcircle and circumference). Make sure only one application file #include statement is uncommented at a time in try.cpp.
 
 
Copyright © 2008 by 3D Software. All rights reserved.
3D Software, P.O. Box 221190, Sacramento CA 95822 USA
www.3DSoftware.com     Contact us
Thursday, 28-Aug-2008 04:21:51 GMT