OpenGL 3.x+ GLM-like Math Libraries in Go?

831 views
Skip to first unread message

Carlos Cobo

unread,
Jul 18, 2013, 7:57:28 AM7/18/13
to golan...@googlegroups.com
Hi there gophers,

I've been attempting to do some OpenGL 3.x+ work on Windows (Win7 x64) with go during last week.

I finally got it all working using github.com/chsc/gogl and github.com/go-gl/glfw3, works like a charm.

Now I'm following this tutorial series and I found all camera operations must be done with 3rd party libraries, then uploaded to the GPU, almost every tutorial out there uses C++, so they use GLM for that.

Is there any GLM equivalent in Go?

I found:
  1. go.matrix by John Asmuth which does a lot of things but no camera operations (Perspective, LookAt, ...)
  2. github.com/Jragonmiris/mathgl, looks cool but a bit abandoned. Has anyone used this?

Any suggestions?


Thanks in advance,
Carlos

Ross Light

unread,
Jul 18, 2013, 11:01:39 AM7/18/13
to Carlos Cobo, golang-nuts

No camera operations, but I've used it to implement the camera operations before.  It's not too tricky to find the formula behind each of the glPerspective and glLookAt calls and port it.

Ross Light | Software Engineer | li...@google.com | 661-375-7677


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Carlos Cobo

unread,
Jul 18, 2013, 11:08:08 AM7/18/13
to golan...@googlegroups.com, Carlos Cobo
Lighter and prettier (for my taste) than go.matrix, I saw that on the list a while ago but didn't pop out while googling.. what a shame.

If I don't get any feedback on mathgl I'd probably go your way.

Thanks for your contribution Ross!

David DENG

unread,
Jul 18, 2013, 11:39:13 AM7/18/13
to golan...@googlegroups.com

Carlos Cobo

unread,
Jul 18, 2013, 11:52:31 AM7/18/13
to golan...@googlegroups.com
Found 4 more with go-search.org:

  1. https://github.com/drakmaniso/glam GLM in Go. Awesome work by drakmaniso. OpenGL oriented. Lots of recent activity.
  2. https://github.com/Agon/googlmath, does a lots of things, plus a float32 version of Go's std/math. Lots of recent activity.
  3. https://github.com/Ysgard/GoGLutils, incomplete as docs say, not active in 2+ months
  4. https://github.com/threeguys/math3d, incomplete (no camera operations), 2 days work, inactive since then (8~10 days ago).
GLAM seems like the way to go, it also includes perlin and simplex noise and Go's std/math for float32s with some optimizations written in assembly.

Thanks David.

Stephen Gutekanst

unread,
Jul 18, 2013, 2:00:42 PM7/18/13
to golan...@googlegroups.com
Hi,

It's not GLM -- but I've ported majority (all) of the algorithms in Panda3D (an game engine from Disney)'s linmath library to Go, which can be found at:



Features include:
    Two, three, and four component vectors types.
    3x3 and 4x4 matrix types.
    Quaternion data type.
    Support for multiple coordinate systems.
    Support for using float32 and float64 data types for all of the above types using an build tag (the tag 'float64' implies that math.Real should be of type float64).

Methods that would suit your needs are:

But perhaps you would be more comfortable with some GLM port, I do not know. Just wanted to let you know that the package is there.

Stephen

Carlos Cobo

unread,
Jul 18, 2013, 2:25:20 PM7/18/13
to golan...@googlegroups.com
It seems like there are a couple of libraries ready to use (yours is one of them) so I guess any of them will just work, gotta test them out.

Right now I'm learning low level basics of OpenGL then I'll move to a scene graph, there's none with Go support so I'll probably go for Panda3D because it has C++/Python support and I've heard lots of good things about it.

Anyways it's good to get this nice libraries popping out on the list so they appear on future searches for others with similar problems.


Thanks Stephen, it is indeed a nice library!
Reply all
Reply to author
Forward
0 new messages