GMlib comes with a demo application that you can use as a starting point to get started.
The core of GMlib is a scene (a Scene class). The scene represents a Euclidean space with affine structure ( BB page 14). The scene has a scene graph, which is a non-cyclic tree (a hierarchical model) of SceneObjects. This means that the Scene has a list of SceneObjects, and each SceneObject also has a list of SceneObjects. The command to insert an object into the scene graph is insert(object). Both the scene and the scene objects have an insert() function. The following rules must be followed:
- SceneObject must be created with new ...
- A SceneObject can only be inserted one place.
- When an object is inserted, the object it is inserted into has taken over responsibility for the inserted object and thus also for its deletion (delete)...
- You can get the responsibility back using remove(). If the object has the device you want and allows you to take it back, it returns the device address and removes the device from its list, otherwise it returns nullptr.
-
Core - Which is template-based and contains:
- Types - These are the core of handling an Affine structure, and are static basic types. These are:
- Angle
- Point, Vector, UnitVector
- Arrow, ScalarPoint, Sphere, Box, PlaneArrow
- Matrix, SqMatrix, HqMatrix
- Simplex, LineSegment, Triangle, Tetrahedron
- SubSpace, Line, Plane, Cube
- Containers - These are dynamic types that supplement the std:containers. These are:
- Array, ArrayLX, ArrayT
- DVector, DVectorN, DMatrix (These are mathematical types with operators and inverting
- Utils - contains a series of helper types and functions such as:
- Color
- Divided differences
- Random
- Simplex methode
- SortObject
- Stream operator og Separator
- GMTimer
- compValueF, binomial, clamp
- Functions for std::vector as streamoperator, isIn, findIndexToElem
- Types - These are the core of handling an Affine structure, and are static basic types. These are:
-
Scene - which contains Scene and SceneObject, as well as:
- Camera
- Camera, a camera with standard projection.
- IsoCamera, which preserves measurements.
- Light, base class for
- PointLight
- SpotLight
- Sun
-
Parametric, template based and is the base class for parameterized curves, surfaces and triangles:
- Curves, template-defined. This is:
- Line, Circle, Arc
- LogSpiral, RoseCurve, Butterfly, Lemniskate, ChrysanthemumCurve
- BezierCurve, HermiteCurve, BSplineCurve, BlendingSplineCurve
- Sub division curves:
- LaneRiesenfeldt, CatmullClarc, Chaikins
- CatmullRom
- Surfaces. These are:
- Plane, Cone, Cylinder, Sphere, Torus
- SweepSurf, CoonsPatch, PBezierCurveSurf, PHermiteCurveSurf, RotationalSurf
- BezierSurf, HermiteSurf, BSplineSurf, SubSurf, BlendingSplineSurf
- AsteroidalSphere, BentHorns, BohemianDome, Bottle8, BoysSurface
- CrossCap, DiniSurface, EightSurface, EnnepersSurface, Heart, Helicoid
- InsideOutTorus, KleinsBottle, KuenSurface, MoebiusStrip, MonkeySaddle
- Seashell, SinSurface, SlippersSurface, SteinerSurf, SwallowTail
- TrianguloidTrefoil, WhitneyUmbrella
- Sub division surfaces:
- Catmull-Clark, Doo-Sabin, Mid_Edge Converges towards 3- and 2-degree B-splines
- Loop, Sqrt3-Kobbelt Converges towards box-splines, triangle-based
- Butterfly, Modified Butterfly Interpolating subdivision - Lagrange
- Triangle based surfaces parameterized with homogeneous barycentric coordinates. These are:
- BezierTriangle
- BlendingTriangle
- SubTriangle
- Curves, template-defined. This is:
-
TriangleSystem - A class for Delaunay triangulation of a set of unique points.
- TriangleFacets Delaunay triangulation
- TSVertex, TSEdge, TSTriangle
- TSTile Voronoi diagram
- TSLine, TSVEdge
In addition, there is a module called OpenGL. The module contains shaders and renderers.
There are plans to create a module for Vulkan as well, so that you can choose the graphics system you want to use.
- TriangleFacets Delaunay triangulation