Noah Paessel scripted an add-on to generate 'voxel' type images from bitmaps.
It all started when I wanted to grab some colors from Vincent Van Gogh for use in one of my renders. I figured it should be possible to convert pixels into voxels, and using Blender's Python API, it was pretty easy. This technique might have general appeal, so I created a video tutorial for it.
The python script reads pixels RGB values from an texture image you specify by name. It then creates a new diffuse shader material of the same color for each pixel (wasteful!), and final it creates a rectangular prism at x,y coordinates, whose hight is determined by the pixels intensity.
Thanks for checking it out!
9 Comments
nice script!
the resulting renders look pretty slick. :)
would be awesome btw. if we could work with actual voxel grids like this in blender
awesome thing. instead of a new material per cube i would suggest to use vertex colors and one material, that uses the vertex colors as input.
I had always wanted to get into some automated process with pixel data and forming "extruded images", but I had no idea it would be that simple! Nicely done.
Cool, but these aren't voxels. Voxels are 3D pixels, forming a 3D grid. This is just a 2D grid with a height property. A smoke simulation, for example, has voxels, or a mesh remeshed with the Octree modifier in "Blocks" mode.
Hah hah! This is what inspired me to make my addon! :D
Thank you for the script It is AWESOME!!!
As someone highly interested in voxels, I approve of this post. But I wish Blender had better voxel systems... such as a marching cubes algorithm builtin. Guess we have to stick with metaballs for now.
Zachman asked about this on blender.stackexchange and the tests I ran showed that a mesh (which can be vertices only) using dupliverts for a cube is the quickest way to perform this duplication task.
And here's my animated experiment but it's based on particle (so I used another method)
http://youtu.be/mSuGJyogVy8?list=UUyIRizI78DKyE3abqpZI25g