Finally, I decided to make my own WebGL 3D engine from the ground up, I begin tutorials from http://www.khronos.org/webgl/ and http://learningwebgl.com and https://developer.mozilla.org/en/WebGL
But problem is that each tutorial used/recommend different library for Matrix calculations, so I'm confused!
Question is: Which one is well suited for 3D WebGL Applications, Charts and Games? (both performance and usability matters)
Thanks
Look at http://glmatrix.googlecode.com/hg/benchmark/matrix_benchmark.html http://greggman.github.io/webgl-matrix-benchmarks/matrix_benchmark.html
I use glMatrix, and it works fine. The API is a bit weird.
var in = vec3.create([1, 2, 3]);
//overwrite 'in' in-place
vec3.scale(in, 2);
//write output to a different vector
var out = vec3.create();
vec3.scale(in, 2, out);
Or for glMatrix 2
var in = vec3.fromValues(1, 2, 3);
//overwrite 'in' in-place
vec3.scale(in, in, 2);
//write output to a different vector
var out = vec3.create();
vec3.scale(out, in, 2);
But it's fast, it supports the operations I want, and it's straightforward. Additionally, The source is very understandable.
I have no experience with the others, though.
Update:
There are benchmarks of more libraries available at http://stepheneb.github.com/webgl-matrix-benchmarks/matrix_benchmark.html. In Chrome on my Mac, Closure wins pretty handily. In Chrome on my PC, it's much more of a toss-up. I'm still using glMatrix for now, since it lives in a single Javascript file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With