Here's the code I use to create the matrix:
`Prepare the matrix.
MAKE MATRIX 1, 1536, 1536, 48, 48
SET MATRIX 1, 0, 1, 1, 2, 1, 0, 1
SET MATRIX TRIM 1, 0.001, 0.001
PREPARE MATRIX TEXTURE 1, 1000, 5, 4
...and where the command is called to update the matrix tiles:
`Set the matrix tiles.
FOR var_Array_PositionX = var_Chunk_LeftMost TO var_Chunk_RightMost
INC var_Tile_PositionX
var_Tile_PositionZ = -1
FOR var_Array_PositionZ = var_Chunk_BottomMost TO var_Chunk_TopMost
INC var_Tile_PositionZ
IF arr_WorldGen_AllData(var_Array_PositionX, var_Array_PositionZ, 2) > 0
SET MATRIX TILE 1, var_Tile_PositionX, var_Tile_PositionZ, arr_WorldGen_AllData(var_Array_PositionX, var_Array_PositionZ, 2) - 994
ELSE
SET MATRIX TILE 1, var_Tile_PositionX, var_Tile_PositionZ, 1
ENDIF
NEXT var_Array_PositionZ
NEXT var_Array_PositionX
There's also the POSITION and UPDATE commands called after everything else but I don't think those are relevant to the problem I'm having.