Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
component:geolyzer [2020/09/02 04:00]
kristopher38 Long overdue improvement on the scan function
component:geolyzer [2020/09/02 04:02] (current)
kristopher38 Fix wrong coordinate ordering in the code snippet and add offset to those
Line 49: Line 49:
     for z = 0, sizez - 1 do     for z = 0, sizez - 1 do
         for x = 0, sizex - 1 do         for x = 0, sizex - 1 do
-            -- alternatively when thinking in terms of 3-dimensional table: map[x][z][y] = scanData[i]+            -- alternatively when thinking in terms of 3-dimensional table: map[offsety + y][offsetz + z][offsetx + x] = scanData[i]
             map[i] = {posx = offsetx + x, posy = offsety + y, posz = offsetz + z, hardness = scanData[i]}             map[i] = {posx = offsetx + x, posy = offsety + y, posz = offsetz + z, hardness = scanData[i]}
             i = i + 1             i = i + 1