Attreid:
I tried your code and it seems to be fine. A few minor changes tho.
This will produce pretty low heights. Change it to:
And then this:
Should be changed to:
Because a bitmap starts at 1,1 while the matrix starts at point 0,0
Because of this you should also change:
to
And then it works fine. But the preparematrixtexture(1,1,10,10) looks a bit odd, unless you have a texture with 10x10 tiles. You could better use something like texturematrix(1,1,32,32.
That's all.
Kevil