最后,我决定从头开始制作自己的WebGL 3D引擎,我从http://www.khronos.org/webgl/和http://learningwebgl.com以及https://developer.mozilla.org开始教程./ EN/WebGL的
但问题是每个教程使用/推荐不同的库用于Matrix计算,所以我很困惑!
问题是:哪一个非常适合3D WebGL应用程序,图表和游戏?(性能和可用性都很重要)
谢谢
请查看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);
Run Code Online (Sandbox Code Playgroud)
或者对于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);
Run Code Online (Sandbox Code Playgroud)
但它很快,它支持我想要的操作,而且很简单.来源可以理解.
不过,我对其他人没有经验.
更新:
http://stepheneb.github.com/webgl-matrix-benchmarks/matrix_benchmark.html上提供了更多库的基准测试.在Mac上的Chrome中,Closure非常轻松获胜.在我的电脑上的Chrome中,它更像是一个折腾.我现在还在使用glMatrix,因为它只存在于一个Javascript文件中.
归档时间: |
|
查看次数: |
6877 次 |
最近记录: |