看http://glmatrix.googlecode.com/hg/benchmark/matrix_benchmark.html
我用glMatrix,并能正常工作。这个API有点奇怪。
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);
或为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);
但是,它的速度快,它支持我想要的操作,这是简单的。来源可以理解。
虽然我没有与其他人的经验。
更新:
有更多的图书馆的基准可在http://stepheneb.github.com/webgl-matrix-benchmarks/matrix_benchmark.html。在我的Mac上的Chrome中,Closure非常轻松地胜出。在我个人电脑上的Chrome浏览器中,它更像是一种折腾。我现在仍然在使用glMatrix,因为它生活在一个单独的Javascript文件中。
很遗憾,他们没有针对numeric.js和Sylvester进行基准测试。根据[numeric.js基准测试](http://www.numericjs.com/benchmark.html),至少在我的系统上,Sylvester实际上比3x3(及更高版本)的Google Closure速度更快,至少在我的系统上(WinXP/32与Chrome 20)。 – feklee
我[只是添加了Sylvester](https://github.com/feklee/webgl-matrix-benchmarks)到基准测试(pull request pending)。西尔维斯特是*慢*。为什么它比[数字Javascript基准测试](http://www.numericjs.com/benchmark.html)中的Closure更快?答案:该基准测试Closure的通用矩阵函数,而不是那些专用于WebGL的函数。 – feklee
好吧,在glMatrix 2.2.0中vec3.create不带参数,如下所示创建一个将创建一个零长度的vec3,但vec3.fromValues(1,2,3)将工作 – Octopus