Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
September 04, 2018 C++ GLM(OpenGL Mathematics) D Equivalent. | ||||
---|---|---|---|---|
| ||||
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! |
September 04, 2018 Re: C++ GLM(OpenGL Mathematics) D Equivalent. | ||||
---|---|---|---|---|
| ||||
Posted in reply to SrMordred | 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.
|
September 04, 2018 Re: C++ GLM(OpenGL Mathematics) D Equivalent. | ||||
---|---|---|---|---|
| ||||
Posted in reply to SrMordred | 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.
|
September 06, 2018 Re: C++ GLM(OpenGL Mathematics) D Equivalent. | ||||
---|---|---|---|---|
| ||||
Posted in reply to SrMordred | 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.
|
September 07, 2018 Re: C++ GLM(OpenGL Mathematics) D Equivalent. | ||||
---|---|---|---|---|
| ||||
Posted in reply to JN | 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. |
Copyright © 1999-2021 by the D Language Foundation