How do you put objs. Into voxel terrain
@donhard Here’s something simple. Not sure if this is what you’re after.
displayMode(FULLSCREEN)
function setup()
assert(OrbitViewer, "Please include Cameras (not Camera) as a dependency")
scene = craft.scene()
viewer = scene.camera:add(OrbitViewer, vec3(40,30,0), 100, 0, 400)
scene.sun.rotation = quat.eulerAngles(25, 125, 0)
scene.ambientColor = color(127, 127, 127, 255)
entity=scene:entity()
blockSet()
-- Setup voxel terrain
scene.voxels:resize(vec3(5,1,5))
scene.voxels.coordinates = vec3(0,0,0)
-- position and size voxels
scene.voxels:fill("Bedrock")
scene.voxels:box(0,10,0,16*5,10,16*5)
scene.voxels:fill("Dirt")
scene.voxels:box(0,8,0,16*5,9,16*5)
scene.voxels:set(40,11,40,"Error")
end
function update(dt)
scene:update(dt)
end
function draw()
update(DeltaTime)
scene:draw()
end
function blockSet()
-- Assets must be added to the voxel system for them to be available
scene.voxels.blocks:addAssetPack("Blocks")
-- setup block voxels
local dirt = scene.voxels.blocks:new("Dirt")
dirt.setTexture(ALL, "Blocks:Dirt")
local bedrock = scene.voxels.blocks:new("Bedrock")
bedrock.setTexture(ALL, "Blocks:Greystone")
local errBlk = scene.voxels.blocks:new("Error")
errBlk.setTexture(ALL, "Blocks:Error")
end