PDA

View Full Version : webgl matrix set



giuseppe500
08-06-2011, 05:05 AM
hello.
I would understand how i can assign a value to an index in a webgl matrix.
I tryed with
var mx = mat4.create();
mx[0][0] = 0.31312312 or
mx[1][0] = 0.2222222

but don't work.
thanks.

Toji
09-01-2011, 03:28 PM
It looks like you are using glMatrix. If that is the case, the matrices are stored as flat arrays (both for speed and compatibility with shader uniforms).

As such, mx[0][0] is just mx[0], mx[1][0] is mx[4], etc.