i started working on a voxel engine yesterday, currently processing an MRI scan of somebody's body (from legs to head).
the MRI scan is a 3-dimensional image, 512x512x226 8-bit grayscale.
normally, a pixel refers to the color at a specific X,Y position in a 2d image.
whereas a voxel refers to a color at a specific X,Y,Z position in a 3d image.
imagine you had a rubix cube that was all black on the outside but had colored squares on the inside. if you just look at the rubix cube, it appears solid black, even though you know there are actually colors inside it. the same thing occurs if you simply 'draw' an MRI or CAT scan; it will appear to be a solid black cube.
in order to draw the person or object(s) INSIDE the scan, raytracing is used. for each pixel in the image being rendered, a ray is shot into the 3d volume. the ray will continue penetrating the volume until a non-black voxel is hit, which is subsequently drawn.
making the raytracing fast is difficult. lets say we are trying to produce a 800x600 rendering of the 512x512x226 mri scan. thats 480,000 individual raytracing operations that HAVE to be performed. if a 'brute force' approach was taken for the raytracing, there would be over 28 trillion ray-to-voxel tests being performed. on a modern computer, it could take hours, days or even months to produce one lousy 800x600 image!!
i implemented an octree-based culling solution which is currently allowing me to render a 800x600 image in approximately 2 or 3 minutes.
unfortunately, the raytracing is severely broken. this is a prototype, and both my first voxel engine AND first raytracer, so im pleased with the fact that i can make out anything at all in the image
http://binarydemons.com/~strike/files/mri.wmv
the MRI scan is a 3-dimensional image, 512x512x226 8-bit grayscale.
normally, a pixel refers to the color at a specific X,Y position in a 2d image.
whereas a voxel refers to a color at a specific X,Y,Z position in a 3d image.
imagine you had a rubix cube that was all black on the outside but had colored squares on the inside. if you just look at the rubix cube, it appears solid black, even though you know there are actually colors inside it. the same thing occurs if you simply 'draw' an MRI or CAT scan; it will appear to be a solid black cube.
in order to draw the person or object(s) INSIDE the scan, raytracing is used. for each pixel in the image being rendered, a ray is shot into the 3d volume. the ray will continue penetrating the volume until a non-black voxel is hit, which is subsequently drawn.
making the raytracing fast is difficult. lets say we are trying to produce a 800x600 rendering of the 512x512x226 mri scan. thats 480,000 individual raytracing operations that HAVE to be performed. if a 'brute force' approach was taken for the raytracing, there would be over 28 trillion ray-to-voxel tests being performed. on a modern computer, it could take hours, days or even months to produce one lousy 800x600 image!!
i implemented an octree-based culling solution which is currently allowing me to render a 800x600 image in approximately 2 or 3 minutes.
unfortunately, the raytracing is severely broken. this is a prototype, and both my first voxel engine AND first raytracer, so im pleased with the fact that i can make out anything at all in the image
http://binarydemons.com/~strike/files/mri.wmv
[ B A H ]
Bad *** by nature,
Hackers by choice
Bad *** by nature,
Hackers by choice