This project is read-only.

Matrix math for glUniformMatrix* calls

Jan 31, 2014 at 6:13 PM
Edited Jan 31, 2014 at 6:21 PM
Hi, I'm just getting started with SharpGL. I'd like to stick to core OpenGL 4 practices, one of which is rather than calling e.g. glRotate or glFrustum, you do the matrix math yourself and pass the matrix to your vertex shader with a glUniformMatrix* call. Trying to find the best way to do this.

I see there is a SharpGL.OpenGL.UniformMatrix4() method which takes a matrix in a float[]. I also found the SharpGL.SceneGraph.Matrix class, which provides lots of cool matrix math methods, but doesn't provide methods to build matrices with values you'd pass to glRotate or glFrustum.

Before I write my own subclass, am I missing something?

thanks
Mar 25, 2014 at 2:57 PM
This is all supported from v2.2 onwards now. The recommended approach is to use GlmNet:

https://github.com/dwmkerr/glmnet

which is a .NET version of the glm library that is typically used in OpenGL 4 applications - there'll be a tutorial on OpenGL 4 matrix operations soon!
Marked as answer by dwmkerr on 3/25/2014 at 6:57 AM