Here you can find light-weight code releases that contain C++ classes for computer graphics use. The code releases only include header files, so no pre-compilation is needed. They only use standard C++ libraries, so there are no external dependancies, unless otherwise noted.
Instead of providing a complete library that includes all of these classes, I keep code releases separate for each component, so that you can just download the parts that you need. I believe this approach makes it easier for you to use them. I try to keep code releases as simple and as small as possible, therefore some of the code releases may need some previous code releases to compile. Please check the requirements list of the code release that you are interested in. If you have any problems with the code, documentation or usability, please let me know.
Code releases are provided in C++ header form. They only use standard C++ libraries and they do NOT have any external dependencies, unless otherwise specified. Some code releases depend on other code releases, as indicated.
All source code in cyCodeBase is released under the simple and permissive MIT license, which allows code modifications and commercial use.
All file names begin with "cy" prefix. All classes and structs are defined in namespace cy. Most classes and structs are also defined outside of the namespace cy with an additional "cy" prefix. All constants begin with "CY_", and all internal constants begin with "_CY_". All functions and class methods begin with an upper-case letter. All variable names begin with a lower-case letter. If the function or variable name is made up of more than one word, each secondary word begins with an upper case letter, and the rest of the function and variable names use lower-case letters.
All source files are on a GIT repository for easy access and updates. They can be accessed on github.
List of Code Releases
cyCodeBase includes the following code releases that can be downloaded and used independently. Note that some code releases depend on other code releases, as described below.
Core Functions and Macros
2D, 3D, 4D, and N-Dimensional vector classes
templatesVec, Vec2, Vec3, Vec4
Using <float>: Vec2f, Vec3f, Vec4f
Using <double>: Vec2d, Vec3d, Vec4d
2D, 3D, and N-Dimensional integer vector classescyVector release, these classes overload bitwise operations. These classes can be converted to and from the classes in the cyVector release.
templatesIVec, IVec2, IVec3, IVec4,
Using <int8_t>: IVec2b, IVec3b, IVec4b,
Using <uint8_t>: IVec2ub, IVec3ub, IVec4ub,
Using <int16_t>: IVec2s, IVec3s, IVec4s,
Using <uint16_t>: IVec2us, IVec3us, IVec4us,
Using <int32_t>: IVec2i, IVec3i, IVec4i,
Using <uint32_t>: IVec2ui, IVec3ui, IVec4ui,
Using <int64_t>: IVec2l, IVec3l, IVec4l,
Using <uint64_t>: IVec2ul, IVec3ul, IVec4ul,
2x2, 3x3, 3x4, and 4x4 matrix classes
templatesMatrix2, Matrix3, Matrix34, Matrix4
Using <float>: Matrix2f, Matrix3f, Matrix34f, Matrix4f
Using <double>: Matrix2d, Matrix3d, Matrix34d, Matrix4d
Quaternion class for 3D vectors
Using <float>: Quatf,
Using <double>: Quatd,
dependenciescyCore, cyVector, cyMatrix
Spatial vector algebra classesRoy Featherstone's Spatial Vector Algebra page.
templatesSpatialVector6, SpatialTrans6, SpatialMatrix6
Using <float>: SpatialVector6f, SpatialTrans6f, SpatialMatrix6f
Using <double>: SpatialVector6d, SpatialTrans6d, SpatialMatrix6d
dependenciescyCore, cyVector, cyMatrix
Color classes with 3/4 8-bit/32-bit components
classesColor, ColorA, Color24, Color32
Triangular mesh class
Bounding Volume Hierarchy
dependenciesnone, but can also be used with cyTriMesh
OpenGL helper classes
classesGL, GLDebugCallback, GLTexture, GLTexture1, GLTexture2, GLTexture3, GLTextureCubeMap, GLRenderBuffer, GLRenderTexture, GLRenderDepth, GLSLShader, GLSLProgram
typedefsGLTexture1D, GLTexture2D, GLTexture3D, GLTexture1DArray, GLTexture2DArray, GLTextureBuffer, GLTextureRect, GLRenderTexture2D, GLRenderTextureRect, GLRenderDepth2D, GLRenderDepthRect,
dependenciesnone, but can also be used with cyVector, cyMatrix, and cyIVector.
Points in k-d trees
Generic PointCloud2, PointCloud3, PointCloud4, PointCloudN,
Using <float>: PointCloud2f, PointCloud3f, PointCloud4f, PointCloudNf,
Using <double>: PointCloud2d, PointCloud3d, PointCloud4d, PointCloudNd,
dependenciesnone, but can also be used with cyVector
Heap structure with random access
Load and save HAIR model filesHAIR file description for more information). This code release includes a class to handle HAIR files for loading and saving hair model data. See Using HAIR Files in the solutions section for an example use of this code release.
Alpha DistributionAlpha Distribution methods for alpha testing.
Lighting Grid HierarchyLighting Grid Hierarchy method for efficiently handling many lights.
dependenciescyVector, cyIVector, cyColor, cyPointCloud
Weighted Sample Eliminationweighted sample elimination algorithm for generating Poisson Disk sample sets in any dimensions.
String class for char arrays
Timer classes for WindowsEasy Performance Analysis in the solutions section for an example use of this code release.
2D, 3D, 4D, and N-Dimensional point (vector) classescyVector code release instead.
templatesPoint, Point2, Point3, Point4
Using <float>: Point2f, Point3f, Point4f
Using <double>: Point2d, Point3d, Point4d
2D, 3D, and N-Dimensional integer point (vector) classescyIVector code release instead.
templatesIPoint, IPoint2, IPoint3, IPoint4,
Using <int8_t>: IPoint2b, IPoint3b, IPoint4b,
Using <uint8_t>: IPoint2ub, IPoint3ub, IPoint4ub,
Using <int16_t>: IPoint2s, IPoint3s, IPoint4s,
Using <uint16_t>: IPoint2us, IPoint3us, IPoint4us,
Using <int32_t>: IPoint2i, IPoint3i, IPoint4i,
Using <uint32_t>: IPoint2ui, IPoint3ui, IPoint4ui,
Using <int64_t>: IPoint2l, IPoint3l, IPoint4l,
Using <uint64_t>: IPoint2ul, IPoint3ul, IPoint4ul,