+- -+ | 1 0 0 0| | 0 1 0 0| | 0 0 0 0| | 0 0 0 1| +- -+
+- -+ | 1 0 0 -(r+l)/2| | 0 1 0 -(t+b)/2| T = | 0 0 0 -(f+n)/2| | 0 0 0 1 | +- -+
+- -+ | 2/(l-r) 0 0 0| | 0 2/(t-b) 0 0| S = | 0 0 -2/(f-n) 0| | 0 0 0 1| +- -+
+- -+ | 2/(l-r) 0 0 -(r+l)/(r-l)| | 0 2/(t-b) 0 -(t+b)/(t-b)| S×T = | 0 0 -2/(f-n) (f+n)/(f-n)| | 0 0 0 1| +- -+
precision mediump float; attribute vec4 aPosition; attribute vec3 aBC; uniform mat4 uMatrix1, uWorld; uniform mat4 uCamera, uVolume; varying vec3 vBC; void main() { gl_Position = uVolume * uCamera * uWorld * uMatrix1 * aPosition; vBC = aBC; }