www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - C++ GLM(OpenGL Mathematics) D Equivalent.

reply SrMordred <patric.dexheimer gmail.com> writes:
Most C++ game related projects uses GLM as they default 
math/vector lib (even if not using opengl).

In D we have (that I found):

gfm.math  - https://github.com/d-gamedev-team/gfm
dlib.math - https://github.com/gecko0307/dlib
Gl3n      - https://github.com/Dav1dde/gl3n

But i'm not sure which to pick.

Can someone point me out some reasons to use one over the other? 
(or show some differences)

I´m expecting something of equivalent functions and performance 
as c++ glm.

Thank you!
Sep 04 2018
next sibling parent reply JN <666total wp.pl> writes:
On Tuesday, 4 September 2018 at 19:23:16 UTC, SrMordred wrote:
 Most C++ game related projects uses GLM as they default 
 math/vector lib (even if not using opengl).

 In D we have (that I found):

 gfm.math  - https://github.com/d-gamedev-team/gfm
 dlib.math - https://github.com/gecko0307/dlib
 Gl3n      - https://github.com/Dav1dde/gl3n

 But i'm not sure which to pick.

 Can someone point me out some reasons to use one over the 
 other? (or show some differences)

 I´m expecting something of equivalent functions and performance 
 as c++ glm.

 Thank you!
I use dlib.math for my 3D engine. It's working fairly well, can't complain. No clue about gfm. Gl3n is nice, but it has a design flaw - it's using row-major matrix ordering. It may or may not be a big deal for you, but in general, it means that all matrices being sent to OpenGL need to be transposed, and the matrix multiplication order is reversed. Another advantage of dlib.math is that it has some extended features, such as support for calculating tangents for a mesh.
Sep 04 2018
parent WhatMeWorry <kheaser gmail.com> writes:
On Tuesday, 4 September 2018 at 19:40:10 UTC, JN wrote:
 On Tuesday, 4 September 2018 at 19:23:16 UTC, SrMordred wrote:
 Most C++ game related projects uses GLM as they default 
 math/vector lib (even if not using opengl).

 In D we have (that I found):

 gfm.math  - https://github.com/d-gamedev-team/gfm
 dlib.math - https://github.com/gecko0307/dlib
 Gl3n      - https://github.com/Dav1dde/gl3n

 But i'm not sure which to pick.

 Can someone point me out some reasons to use one over the 
 other? (or show some differences)

 I´m expecting something of equivalent functions and 
 performance as c++ glm.

 Thank you!
I use dlib.math for my 3D engine. It's working fairly well, can't complain. No clue about gfm. Gl3n is nice, but it has a design flaw - it's using row-major matrix ordering. It may or may not be a big deal for you, but in general, it means that all matrices being sent to OpenGL need to be transposed, and the matrix multiplication order is reversed. Another advantage of dlib.math is that it has some extended features, such as support for calculating tangents for a mesh.
I've used gl3n exclusively for years, but just call opengl functions with the "transpose" argument set to true. Or for readability, I define: alias ROW_MAJOR = GL_TRUE; glUniformMatrix4fv(glGetUniformLocation(this.ID, name), 1, ROW_MAJOR, &matrix[0][0]); However, in hindsight, I think gfm.math might be the way to go.
Sep 07 2018
prev sibling next sibling parent drug <drug2004 bk.ru> writes:
On 04.09.2018 22:23, SrMordred wrote:
 Most C++ game related projects uses GLM as they default math/vector lib 
 (even if not using opengl).
 
 In D we have (that I found):
 
 gfm.math  - https://github.com/d-gamedev-team/gfm
 dlib.math - https://github.com/gecko0307/dlib
 Gl3n      - https://github.com/Dav1dde/gl3n
 
 But i'm not sure which to pick.
 
 Can someone point me out some reasons to use one over the other? (or 
 show some differences)
 
 I´m expecting something of equivalent functions and performance as c++ glm.
 
 Thank you!
I use gfm.math. It works great. I used gl3n before but left it for gfm.math. dlib seems pretending to be a framework. I don't like frameworks.
Sep 04 2018
prev sibling parent Guillaume Piolat <spam smam.org> writes:
On Tuesday, 4 September 2018 at 19:23:16 UTC, SrMordred wrote:
 Most C++ game related projects uses GLM as they default 
 math/vector lib (even if not using opengl).

 In D we have (that I found):

 gfm.math  - https://github.com/d-gamedev-team/gfm
 dlib.math - https://github.com/gecko0307/dlib
 Gl3n      - https://github.com/Dav1dde/gl3n

 But i'm not sure which to pick.

 Can someone point me out some reasons to use one over the 
 other? (or show some differences)

 I´m expecting something of equivalent functions and performance 
 as c++ glm.

 Thank you!
It appears mine is the only one that is nogc.
Sep 06 2018