andykorth / opentk

The Open Toolkit is a low-level C# library that wraps OpenGL, OpenCL and OpenAL. This fork has been superseded by https://github.com/thefiddler/opentk Please direct your attention to that official repository.
71 stars 27 forks source link

More matrix classes #7

Closed Robmaister closed 11 years ago

Robmaister commented 11 years ago

This is a complete set of all the matrix sizes supported by GLSL, both the float and double versions. All basic functionality is implemented, but I haven't done much testing on it.

Additionally, I added the ability to add and subtract matrices and multiply them by scalars.

There's probably a few things here or there that I forgot about (mostly in documentation), I'm planning on going through the vector/matrix classes and fixing all the minor documentation inconsistencies later, but if you want me to include documentation before you pull, that's fine too.

I included additional helper methods in Source/OpenTK/Graphics/OpenGL/GLHelper.cs and /Source/OpenTK/Graphics/ES20/Helper.cs

Also this pull request solves issue #4.

EDIT: One more thing, I just realized that I kept the 4x3 x 4x3 multiplication in there (as well as Matrix4x3.Invert()). When I made the Matrix4x3 class, I was trying to load frames from an IQM file and took some functionality from the demo that isn't technically correct but gets a useful answer. I can remove that functionality if you feel it shouldn't be there or just add some documentation explaining exactly what it's doing.

andykorth commented 11 years ago

Probably will merge it tonight, looked pretty good through the first pass.

andykorth commented 11 years ago

I made a few comments on the matrix multiplies, feel free to add more to any funcitons that might not do what people expect. Thanks a lot!

Robmaister commented 11 years ago

I'm going to try and find ways of doing those things properly at some point, most likely by using Matrix3 for the multiplication and having an API to put a Matrix3 inside a larger matrix (either a constructor or some CreateTransformation method)