Tried to read the docs, got confused, but would like to see a small example of using voxels. How do I make a small scene with say two voxels of a solid color? The documentation is a bit confusing, and some examples on the site uses addAssetPack which isnt documented.
But I would like to just add some colored voxels to a volume without texture and try it out a bit
I know how to make it with meshes, but not with craft

.
Comments
@tnlogy Here’s an example I have that uses voxels.
@tnlogy Heres another example that might be closer to what you want if you’re still looking for an example. I tried to keep it as small as possible. It creates a red and blue sprite in the Dropbox folder. Once the sprites are created, you can comment or remove those 2 lines.
~~~
viewer.mode=FULLSCREEN
function setup()
assert(OrbitViewer, "Please include Cameras as a dependency")
scene = craft.scene() scene.camera:add(OrbitViewer,vec3(7,7,0), 20, 0, 10000)
scene.voxels.visibleRadius=90
scene.voxels:resize(vec3(60,1,60))
scene.voxels.coordinates = vec3(0,0,0)
blank = scene.voxels.blocks:new("Blank")
blank.setTexture(ALL, "Blocks:Blank White")
blank.tinted = true
--draw 6 blocks of each color
for z=1,6 do
local c = color(255, 0, 106)
scene.voxels:set(7,z*2,0,"name","Blank","color", c)
c = color(20, 0, 255)
scene.voxels:set(z*2,7,0,"name","Blank","color", c)
end
end
function update(dt)
scene:update(dt)
end
function draw()
update(DeltaTime)
scene:draw()
end
~~~
This uses tinted instead. I find the documentation for Craft a bit lacking and confusing compared to the documentation of the other parts of Codea. Thanks a lot for the help in understanding!
@tnlogy I like your version. I never used voxels:set, so something new. I agree that the docs sometimes don’t give enough info on how to use things.
~~~
scene.voxels:fill("name","Blank",
"color",color(154, 233, 80))
scene.voxels:block(7,z*2,1)
~~~
@tnlogy Heres an example of a Sierpinski cube using the voxel color code you used above. Uncomment the color lines near the bottom of the code to see different color schemes.