Thursday 29 September 2011

An Ode To Math

Recently I decided to contribute to the Gladius/Paladin (https://github.com/alankligman/gladius) open source project, more specifically, the Gladius.Math(https://github.com/alankligman/gladius.math) library.  Having only recently decided to get involved with the project, I was feeling a little overwhelmed but excited as well.

The issues/tickets I have decided to work on are the implementations of several math functions involving various size matrices and vectors.

In order to scope this correctly I decided to start with all the functions for 2x2 matrices, then 3x3 and so forth.  For each matrix size from 2x2 to 4x4 there are a number of functions which perform various operations, or specifically:
  • Translate
  • Scale
  • Rotate 
Everyone loves wiki links:
Translations - http://en.wikipedia.org/wiki/Translation_%28geometry%29
Scaling - http://en.wikipedia.org/wiki/Scaling_%28geometry%29
Rotations - http://en.wikipedia.org/wiki/Rotation_matrix

Also an interesting read: http://knol.google.com/k/matrices-for-3d-applications-translation-rotation#

For my first push I implemented these functions for 2x2 matrices.  The unit testing will be the next major focus in order to determine performance and test logic.

Take a look at the code yourself : https://github.com/saecob/gladius.math/commit/20caebde7578ca3a772440a7bc2b2421740b51e6#L0R548

While coding I noticed that there were a number of basic matrix functions which were missing  and a number which didn't seem to be present in other math libraries which i used for code examples.

If I'm going to spend some time with this library I think I'll need to look at some other game engine math libraries to see if there are functions which would help to include.

No comments:

Post a Comment