C ++ 3D Math Library

What is the best, complex math library in C ++? (I would like to use it in a graphics engine)

EDIT: I need to clarify it a bit: it needs to have all the 3D math, like planes, spheres, points, AABB, etc. and, of course, a matrix, a vector, support for quaternions.

+4
source share
6 answers

It depends on what you are going to develop. according to my knowledge, these are good libraries.

Geometric Tools (formerly known as WildMagic)

OxMath 2D / 3D Math Library 2.1

MATHLIB3D

Configurable Math Library (CML)

glmath

+6
source

If you work with OpenGL, you can try the OpenGL Mathematics library (glm) . It implements all its classes from the point of view of GLSL, so it is easy to use between the client and server sides.

+3
source

Do you mean the best, both in speed? If you are writing for Windows and you are talking about vector math, math matrix, etc., I have not come across anything faster than math functions in DirectX / XNA. (D3DX)

DirectX does not offer support for complex numbers; it deals with floats, but I don’t think that people often use complex numbers in graphic engines. It would be easy enough to implement if you got it.

+1
source

Have you tried the Boost library from http://www.boost.org/ ?

This will not give better performance, but it is a fairly standard and cross-platform.

0
source

You can also take a look at the math2-matrix-vector lightweight template library with SIMD support. You can download it in boost vault . "Math - Geometry". And the Ogre3d framework has its own math library (based on WildMagic 0.2). You can extract it from the framework and use it in your application, since Ogre3d> 1.7 is distributed under the MIT license .

0
source

CGAL - the library offers data structures and algorithms such as triangulations, Voronoi diagrams, Boolean operations on polygons and polytopes, processing point sets, curve devices, surface and volume generation, geometry, alpha shapes, convex hull algorithms, shape analysis, AABB trees and KD ...

0
source

Source: https://habr.com/ru/post/1286579/


All Articles