Friday, July 2, 2010

glMatrix 0.9.4 (1.0 RC1) Released

I've just finished posting a new version of glMatrix (you know, that really fast javascript matrix library?) to Google code. The release number is 0.9.4 but I would like to treat it as a Release Candidate for 1.0.

I get the impression that some people may be disappointed by this release since for me it was more about house cleaning and documentation than any big new features or optimizations. A good deal of the issues I'm getting back for the library now are stylistic preferences, though, that involve restructuring or renaming the functions of the library to work or read a certain way. Some of these items I think are valid and some I feel are more a matter of personal preference, but in all cases I've decided that I would rather:

A) Get the library to a stable state
B) Get unit tests (a personal requirement before I can call the lib version 1.0) and better documentation in place
C) Get the library out to a wider range of developers and gather more feedback

before I make any big structural changes. Please don't consider this to be a rejection of any specific ideas that have been posted, I simply feel that the library structure is "good enough" for the time being and would like to let it mature a bit before shaking things up in a version 2.0.

That said I'd love to get any and all feedback on the library in it's current state so I can officially move it to a 1.0!

Finally, a Big Huge Thank You to everyone who has pitched in so far! Specifically:

jeroom832, Daniel Heres, Julian Walker, Denis Rangel, Aaku Kokko, and Drew Whitehouse

(And I'm terribly sorry if I missed anyone or misspelled any names!)


  1. Hi Brandon.

    Firstly, kudos on the GLMatrix project. I am currently working on incorporating it into my own project ( and I have a question/feature request...

    Have you got any plans to release a version that uses the Flex style matrix layout (translation in positions 4,8,12 and 16 - see here:

    I would prefer not to start hacking at your code because I don't want to duplicate work, and I would also like to be able to drop in your future updates without constant modification.

    I can do a translation (pun not intended) in my wrapper, but it seems a shame to add execution time to methods you have worked so hard to optimise.


    Jim Sangwine

  2. I don't have any plans to create a version that transposes the ordering, sorry.

    You could simply call mat4.transpose() before sending the matrix to which ever method needs it flipped. This is a little bit of extra processing, but the transpose function is relatively lightweight so it may not be an issue.

  3. H Toji!

    I using your glmatrix and have to say that it really fast. I like it!

    Is there a full documentation ? on there are only some examples and a few functions listed, nothing about vectors.

    I need to create and instantiate a 4d-vector and multiply it with a mat4. Can you give a little example how to do it? in the .js-file I only see vec3.

    thank you for sharing such a great library!


  4. The library only implements an interface for a vec3, but there are a couple of matrix functions that operate on a vec4. The one you would be looking for is "mat4.multiplyVec4"

    As for documentation, I must apologize because I've been terribly slow at getting any out. (I'm not the strongest technical writer in the world, much to my detriment.) Outside of the examples the best place to get a feel for the library is probably just to browse the code in the svn, which has all of the function signatures commented:

    I'm glad you like the library, and am always looking for ways to improve it! Send your suggestions my way!

  5. Hi Brandon, i was looking in your glMatrix Code and i think i found a bug in quat4.inverse: for inplace computation, it does nothing:
    quat4.inverse = function(quat, dest) {
    if(!dest || quat == dest) {
    quat[0] *= -1; // <- here should be a minus-sign
    quat[1] *= -1; // <- and here...
    quat[2] *= -1; // <- also here
    return quat;
    dest[0] = -quat[0];
    dest[1] = -quat[1];
    dest[2] = -quat[2];
    dest[3] = quat[3];
    return dest;