file = GetString("file", "testground.png", "script png") grassMap = GetString("grass", "", "script png") heightScale = GetInt("scale", 64) tileSize = GetInt("tilesize", 128) hollow = GetInt("hollow", 0) function init() CreateMaterial("rock", 0.39216, 0.37647, 0.34510) -- matRock CreateMaterial("dirt", 0.72941, 0.62745, 0.50196, 1, 0, 0.1) -- matDirt CreateMaterial("unphysical", 0.4549, 0.56471, 0.25098, 1, 0, 0.2) -- matGrass1 CreateMaterial("unphysical", 0.38039, 0.47843, 0.21569, 1, 0, 0.2) -- matGrass2 CreateMaterial("masonry", 0.45490, 0.43137, 0.39216, 1, 0, 0.4) -- matTarmac CreateMaterial("masonry", 0.51765, 0.48621, 0.45490, 1, 0, 0.3) -- matTarmacTrack CreateMaterial("masonry", 0.5, 0.5, 0.5, 1, 0, 0.35) -- matTarmacLine if grassMap == "" then LoadImage(file) else local black = {0.38039, 0.47843, 0.21569} local white = {0.56, 0.56, 0.23} for i=1, 8 do local t = (i-1)/7.0 local r = black[1]*(1-t)+white[1]*t local g = black[2]*(1-t)+white[2]*t local b = black[3]*(1-t)+white[3]*t CreateMaterial("unphysical", r, g, b, 1, 0, 0.2) end LoadImage(file, grassMap) end local w,h = GetImageSize() local maxSize = tileSize local y0 = 0 while y0 < h-1 do local y1 = y0 + maxSize if y1 > h-1 then y1 = h-1 end local x0 = 0 while x0 < w-1 do local x1 = x0 + maxSize if x1 > w-1 then x1 = w-1 end Vox(x0, 0, y0) Heightmap(x0, y0, x1, y1, heightScale) x0 = x1 end y0 = y1 end end