A bunch of little changes. Most important is that I moved the model creation part, which is not really needed, to the end of the program, and now its entirely optional to display the model. This is good to skip if you're generating large models which will run horribly as a polygon based model. Unless you have some beast of a system.
Also a quick fix for the getpixel error, a prompt at the beginning will as to set a black range, 0-20. 0 if you experience no rouge black pixels on your objects, 20 if you're not sure how to check how off they are from true black.
Some feedback on limits...256x256 with 10 frames is a bit sketchy. I wouldn't show a model of it, just escape after the vox files is made. I didn't include my latest test because they're kind of brutal to my systems. But if you're super curious how well you machine can handle this, create a image thats 128*128 x 128 and just generate grayscale noise. 64^3 models I've tested, took forever to make the model on a netbook. If you have a fast system you can pull it off.
New Post: Almost have it down, some issues with tiny parts dissapearing. You'll find out what I mean if you test the fridge.bmp file in the program, parts of the handle don't get read for some reason.
Aside from that, it now creates a simple color palette so your VOX files will have color in Slab6. However the color is limited to 255(last index is for an empty voxel) and if your image exceed that you'll see some weirdness I'm sure, haven't tested it.
Idealy the max (not tested) size of an image you can use is 255x255 with 255 frames. This may take awhile so I've added some loading bars to show you its just being slow and not dead. So far I've only tested a 32x32 image with 8 frames, the fridge. I've added a doorframe sample too, but this one is just 16x16. Download strip2voxel043010.zip Some bug in it...
Hopefully I'll get a chance to test some larger sprite strips.
Old Post:
A little while back I was toying with the idea of faking voxels with polygon models. I developed a little program that converts a series of sprites in an image strip into a voxel like 3d model. One thing I thought was absent was a sprite to voxel converter as it seems support for it was dropped awhile back.
So I read on the VOX format(being simple) and after a few hair pulling trys I figured out how to properly create the VOX file. Simple confusion over the use of ASCII characters and strings.
Although right now it only feeds in the voxel positions and not the object's colors yet. Currently it only sets the color to a light gray as default and sets the palette up with a gray scale.
This program was originally used to generate 3d models alla voxel. Included is a sample chest.png. The program is currently limited to 16x16x16 images(any color) with black rgb*0 as transparent in the image itself.
At the end you'll see a 3d polygon representation of what it should look like if there was color... Hopefully I'll get around to a version that translates the used colors into the palette, otherwise load a default palette or something. Download Cube16wVOX.zip
Edited by Scott_AW at
Redeemer at
Re: Early stage, sprite 2 voxel program.
Interesting. I can convert my pixel art to some nifty voxel models. 8)
Jinroh at
Pretty Cool.
It's an interesting way of doing it, it converts to polygonal cubes, yes?
Hugo Smits and I were having a little thing about Sprites2Voxels in the past. We both had our own methods, and worked pretty well.
Here are some of my results based on Hugo's DooM Sprite Rips. These were generated from 3 images of Front, Side, and Top. I fiddle around with my Sprite2Voxel program every now and then. I've optimized it, but failed to compile a release for my portfolio yet. Ken also made a Sprite2Voxel functionality for one of his SlabSpri tools IIRC way back in the day.
Great job though. ^_^ Keep it up. http://portfolio.jinrohdev.net23.net/Rocketshot.png http://portfolio.jinrohdev.net23.net/Barrelshot.png http://portfolio.jinrohdev.net23.net/Shellsshot.png
Scott_AW at
I played around with it, but it didn't seem to create vox files.
This program does create voxels, limited currently to 32^3, although I got a new version almost done that should both be up to 255^3 and include colors.
The polygon object is just a representation of the sprites converted, a actual VOX file is produced and you can play around with it in Slab6
Scott_AW at
Re: closer to done, sprite 2 voxel program.
Small bug in the current release is actually very simple, its ignoring the first color grabbed and marking it as transparent!!! Quick fix, use a color you'll never use on the top left corner pixel of the first frame.
But this more about a larger test for you guys to check out, it may stall a few times due to the size, I need to add two more progress bars, one for when the view model is created and one for when the vox file is written.
I wanted to make a model, and this was the first object I found. No, I did not take it apart to get the look of the guts. http://i206.photobucket.com/albums/bb140/scott_aw/th_calculator.png
And here's it in Slab6, all voxely and a destroyed version. http://i206.photobucket.com/albums/bb140/scott_aw/th_calc_cap1.png http://i206.photobucket.com/albums/bb140/scott_aw/th_calc_cap2.png
Atomic at
Very cool! I've noticed that you don't write a full palette with 256 entries when not needed, shouldn't you write it anyways?
Scott_AW at
At the moment that's all its doing, reading up to the last unique color and then stops there. I'm not sure if this is actually a problem though, I could have the option of having palettes preloaded. As long as your colors in the image match with colors of whatever palette your using it should be fine.
Still, this isn't complete, but its getting close.
ConsistentCallsign at
http://i225.photobucket.com/albums/dd202/highwingx3/Casio.png This is for the heavyweights 8)
Edited by ConsistentCallsign at
Scott_AW at
http://host-a.net/scott_aw/strip2voxel050210.zip
Should be working now. There is four loading intensive phases now accompanied by loading bars. Theres the prepping(clears out a 255^3 grid space), reading of the image, building and optimizing the display model, and finally creating the voxel file.
Included are an updated fridge.png, with a few more layers and junk inside. Also the a large test model calculator displayed before.