Heightmap to brick converter?

RE: Heightmap to brick converter?
#8

(2018-06-18, 20:56)NRoland Melkert Wrote:
(2018-06-18, 20:14)Jaco van der Molen Wrote: No idea so far how to do that.
Any thoughts.

If you can somehow generate a lua variable definition with excel.

Then you can do the actual generating of the model in LDCad using a macro. All you would need is the x/z values in an array.

For an 3x3 grid you would need something like this:

Code:
`local depthMap={ {0, 1, 2}, {4, 5, 6}, {7, 8, 9} }`

You use that in a macro run event like so:

Code:
```function renDepthGen()  local sf=ldc.subfile()  if not sf:isLinked() then    ldc.dialog.runMessage('No active session')    return  end    local sel=ldc.selection()  sel:remove()  local depthMap={    {0, 1, 2},    {4, 5, 6},    {7, 8, 9}  }    local h=genTools.tableArrayCount(depthMap)  local w=genTools.tableArrayCount(depthMap[1])    for x=1,w do    for z=1,h do      local v=depthMap[z][x]            local v1=v // 3      local v2=v % 3          local xx=(x-1)*20      local zz=(z-1)*20      local yy=0            for b=1,v1  do        yy=yy-24        sel:add(sf:addNewRef('3005.dat', 4, ldc.matrix(xx, yy, zz)))            end            for p=1,v2 do        yy=yy-8        sel:add(sf:addNewRef('3024.dat', 4, ldc.matrix(xx, yy, zz)))      end          end  end end```

Which would give you:

Ah! Ok, I see. That is exactly what I meant!
My excel source can make the depth map, I understand how it works.
For a 16 by 16 baseplate you have 16 arrays with each 16 values.
Now if you can incorporate the color of the column too, I am there.
Jaco van der Molen
lpub.binarybricks.nl
« Next Oldest | Next Newest »

 Messages In This Thread Heightmap to brick converter? - by Michael Horvath - 2015-08-14, 10:28 Re: Heightmap to brick converter? - by Willy Tschager - 2015-08-14, 16:13 Re: Heightmap to brick converter? - by Michael Horvath - 2015-08-15, 5:21 RE: Heightmap to brick converter? - by Gerald Lasser - 2018-06-18, 13:40 RE: Heightmap to brick converter? - by Jaco van der Molen - 2018-06-18, 20:14 RE: Heightmap to brick converter? - by Roland Melkert - 2018-06-18, 20:56 RE: Heightmap to brick converter? - by Jaco van der Molen - 2018-06-18, 21:10 RE: Heightmap to brick converter? - by Roland Melkert - 2018-06-18, 21:35 RE: Heightmap to brick converter? - by Jaco van der Molen - 2018-06-19, 10:00 RE: Heightmap to brick converter? - by Jaco van der Molen - 2018-06-19, 13:28 RE: Heightmap to brick converter? - by Roland Melkert - 2018-06-19, 18:19 RE: Heightmap to brick converter? - by Jaco van der Molen - 2018-06-20, 10:22 RE: Heightmap to brick converter? - by Roland Melkert - 2018-06-20, 17:18 RE: Heightmap to brick converter? - by Jaco van der Molen - 2018-06-21, 5:50 RE: Heightmap to brick converter? - by Roland Melkert - 2018-06-21, 22:17 RE: Heightmap to brick converter? - by Jaco van der Molen - 2018-06-22, 7:14 RE: Heightmap to brick converter? - by Roland Melkert - 2018-06-22, 17:39 RE: Heightmap to brick converter? - by Jaco van der Molen - 2018-06-25, 12:34 RE: Heightmap to brick converter? - by Roland Melkert - 2018-06-25, 19:57 RE: Heightmap to brick converter? - by Jaco van der Molen - 2018-06-26, 6:42 RE: Heightmap to brick converter? - by Jaco van der Molen - 2018-06-18, 9:49 RE: Heightmap to brick converter? - by Michael Horvath - 2019-06-19, 6:04

Forum Jump:

Users browsing this thread: 1 Guest(s)