toji / gl-matrix

Javascript Matrix and Vector library for High Performance WebGL apps
glmatrix.net
MIT License
5.38k stars 723 forks source link

predefined top,bottom,forward,back,left,right vectors #76

Open denisnarushevich opened 11 years ago

denisnarushevich commented 11 years ago

After switching from my own lib to glMatrix I miss a lot a predefined vectors, such as left - [1,0,0], right - [-1,0,0], top [0,1,0] and so on, for vec2 too. They can help avoid creation of unnecesary arrays, e.g. when passing axis parameter in mat4.rotate method & quat.setAxisAngle

thomcc commented 8 years ago

I have this (and constants for one and zero) in a few programs that use gl-matrix, but really it should be named along the lines of {pos,neg}{X,Y,Z}, since what axis represents up, down, forward, etc. is dependent on the application.