Templatized Geometry Library

Affine (and to some extent, projective) geometry is the foundation for almost all graphics programming. A common library to express basic geometric data types, e.g., vectors and points, and operations on those data types, e.g., vector arithmetics, dot and cross products and transformations, can significantly speed up development of graphics applications. To be most useful, such a library should be generic, i.e., offer data types and operations for n-dimensional geometry on arbitrary underlying field types, while at the same time performing as well as special-purpose handwritten code. The C++ template and inline mechanisms can be used to achieve both goals at the same time, and can as well be used to perform semantics enforcement at compile-time; for example, adding two affine points or creating a vector with the wrong number of components should generate compiler errors.

Project Goals

The main goals were to design and implement a geometry library that is powerful and general enough to be used in a wide variety of geometry-related projects. The library should offer the following features/functionality:

Project Status

The current version of the templatized geometry library offers all functionality described above. The library API is frozen at version 2.1, and the library is currently undergoing testing by myself and other researchers at IDAV. All source code needed to compile and use the library can be downloaded from the download page.
Note: Support for templates is fundamentally broken in all Microsoft C++ compilers I've tried, up to and including the version that ships with Visual Studio .net 2003. I've heard rumors that the newest release has better support, but I'm not holding my breath. To use the TGL under Windows, you would either have to use the GNU C++ compiler (but I don't know whether that can generate native Windows applications), or the Intel C++ compiler. That one is very good, and it compiles TGL without problems. It also generates much better code than the Microsoft compilers, and drops right into the Visual Studio IDE. Alas, it is not free.

News

Pages In This Section

Design Philosophy
Fundamental design approaches used in the templatized geometry library, and the reasoning behind them. Users should be aware of these to make optimal use of the library.
Scalar Field Type Requirements
Required interface for user-defined data types that are to be used as scalar types for geometry objects.
Vector Space Algebra
A very brief overview of axioms and definitions regarding algebraic structures fundamental to geometry - groups, rings, fields, vector spaces. By no means a tutorial!
Download
Download page for all source code necessary to compile and use the templatized geometry library.
Library Documentation
Detailed documentation of all classes and operations provided by the templatized geometry library.