First off, you'll want to find a model to use. Creating 3D polygonal models is no easy task and falls outside of the scope of this tutorial. Luckily the internet is full of free public domain models for you to use. One resource which I have found invaluable is Archive3D. They have pretty much any common object you would encounter in daily life. For the sake of this lesson we are going to use this attractive porcelain throne.
Firstly you'll want to download poly2vox and Slab6. You'll find them on Ken Silverman's page here. For the sake of clarity here are direct links to poly2vox & Slab6.
What I suggest you do is unzip Slab6 to its own folder and then unzip poly2vox into that folder. You'll be using them together quite often and it's convenient to keep them in close proximity together. For those who haven't used Slab6, it is set up a lot like Voxed and if you aren't familiar with it that's no big deal because we are going to be using it in a fairly limited manner. Mostly to resize and convert the model from KV6 to KVX.
So, having set up your Slab6 folder and added poly2vox to it, go download a model, for our example, a common toilet. It comes packaged in a ZIP file, which is fine because, conveniently, poly2vox can read objects in ZIP files. It's also convenient because often the models come with textures, which poly2vox will also attempt to process, resulting in nice colored voxel-sculpted objects. Sometimes this won't work properly and you'll get strange results. Your ship model may have a deck that is in the wrong place or the colors may be wrong. In case this happens, you'll have to get creative and either use a modeling program to fix your model or find another model. You may need to repaint or retouch the colors in Slab6. I never said this was going to be easy, did I?
So, make sure your new zipped toilet model file is in the same folder as poly2vox. Here's the tricky part, but have no fear for we'll make this as painless as possible. Poly2vox is a command-line program which means you can open a command window and use arcane DOS commands to run the program. If you were to do this you might see something like this:
Code: Select all
As you can easily see, if you speak Wizard, poly2vox is pretty flexible for a command-line program. You could easily write some batch files with notepad (like Bildramer's Bitmap Converter uses in my other tutorial) but this really isn't necessary unless you want to do so. Luckily, poly2vox provides the ability to simply drag and drop files onto it. By doing this we can avoid having to explain anything about the Command Prompt, something I really would rather do.Microsoft Windows [Version 6.0.6002]
Copyright (c) 2006 Microsoft Corporation. All rights reserved.
I:\Ace of Spades\poly2vox>poly2vox
POLY2VOX [input] [output] [/v#] [/s#] [/f#] [/n#] [/r#] [/m#] [/x#] [/p(file)]
by Ken Silverman (http://advsys.net/ken) Compiled: Jul 9 2009
Converts models from polygon to voxel format.
Supported polygon formats: ASC,3DS,MD2,MD3
Supported voxel formats: VOX,KVX,KV6,VXL (default:KV6)
Supported texture formats: PNG,JPG,TGA,GIF,CEL,PCX,BMP
POLY2VOX can load files out of a ZIP file. (Model name must match ZIP name)
/v# Specify voxel size of longest dimension. 1-1024, <=256 for KVX
/s# Specify explicit scale factor. Use this to ensure the size of all frames
is consistent. This factor depends on the coordinate system used by the
polygon model, so it can be anything. Run without the scale factor first
to find a reasonble starting value to try.
/f# Specify frame number (MD2/MD3 only)
/n# Specify next frame number for interpolation (MD2/MD3 only)
/r# Specify interpolation ratio. Range: 0.0-1.0, default:0.0 (MD2/MD3 only)
/m# Specify number of mips to save: 1,5, default:5. (KVX only)
/x Enable an experimental xor-style converter. It's useful for
gap-less models but has buggy color conversion
/p(file) Specify a pre-defined palette (Build PALETTE.DAT format: first 768
bytes, range:0-63)
Examples:
poly2vox bike (finds bike.*, writes bike.kvx, size=128)
poly2vox bike.3ds bike.kv6 /v250 (reads bike.3ds, writes bike.kv6, size=250)
poly2vox land land.vxl (finds land.*, writes land.vxl, size=1024^2*256)
poly2vox pig.md2 pig.kvx /v128 /f2 /n3 /r.5 (convert interpolated frame)
poly2vox trooper.md2 trooper1680.kvx /s.115 /f0 (use explicit scale factor)
poly2vox trooper.md2 trooper1680.kvx /s0.115 /f0 /ppalette.dat
That said, just throw caution to the wind and drag your zipped up toilet model onto the poly2vox program icon. A window should pop up and, after a few seconds should disappear.
There should now be a new .KV6 file in the folder! Take this and drag it onto the Slab6 program icon and it should open in Slab 6.
You should now be staring at an image of a large voxelized commode, or as theGrandMaster would say, a loo.
Feel free to use the , and . keys and the PageUp & PageDown keys in Slab6 to rotate and admire the fine symmetry of this object.
Now, more than likely this object is far too large to fit comfortable onto a 64 voxel high AoS VXL map. It's top would be cut off abruptly. This may or may not suit your purposes for your map but assuming you want something a bit more suitable for "dropping a deuce" into you'll need to resize it. Slab6 can do this easily by selecting Tools > Halve dimensions.
Which should result in a smaller object.
This will still be pretty large on the map. You can keep halving the dimensions until you achieve the desired size.
So now I just want to take a moment to mention something about Slab6 that I am not positive everybody using the program is aware of, the Slice Editor. This is one of the most powerful tools within Slab6. Hit the Enter key and you should see the Slice Editor appear.
As you can see, in the lower right hand corner of the program window, you'll see a cross-section of your object in the X, Y & Z axes. You can resize these axis windows by hovering over them with the mouse and using the / and * keys. PageUp & PageDown will change the active "slice" you are looking at. You can also edit within these windows by adding voxels or copying and pasting portions with the SHIFT key and dragging with the mouse to select a region and then pasting them elsewhere with the SHIFT-Insert key. I only mention this because in the slice editor you'll notice that some interior portions of the model appear in black while other portions appear to be grey or empty. In this case the water tank appears black which indicates that it is not hollow. If you wanted to you could carefully hollow this out. I'm not going to go into much more detail on this and am going to leave it to you to explore more deeply. It can take some practice to get used to. I also highly suggest reading (and maybe even printing out a hard copy of) the slab6.txt help file because there are many more useful slice editor functions to explore.
On with the tutorial! So now we will want to re-save our resized thunderbox into a format appropriate for importing into our map in Voxed. Choose File > Save As and save it with the filename of your choice BUT be sure to save it as a KVX file this time. This is necessary because of the way Voxed imports objects. It will import a KV6 model quite happily, and let you place it on the map, but when you save that map and reload it, your object will, sadly, not be there. (Why is this, you may ask. It has something to do with KV6 being a sprite object or something like that. There are ways around it, involving placing a single "placeholder" block on the map before you import the KV6 but after you actually place it your object will suddenly have it's resolution quartered and it will look really ugly. So just take my word for it and convert it to KVX. I would never lie to you, would I?)
So now you've saved your KVX file and you're ready to import this fine chamber pot into a map in Voxed. I'll be using my greengrassy.vxl map from my other tutorial on Heightmapping. Open up Voxed and load up your map. (Pro Tip: you can just drag and drop a VXL map onto Voxed.exe and it will open that map!)
Now for the magic moment when we import the object onto the map. You'll want to point the tiny voxed crosshair at the block point you want to place your object. Being unimaginative and lazy, I just looked straight down at the center of the map.
Now, simply hit the 'U' key on your keyboard and navigate to the folder you saved your object in. I copied my object over into my voxed folder earlier. Select your object and click Open.
Voilà! Il est aux toilettes très grand!
So now that you've succesful'y placed a large toilet in the middle of your map you'll probably want to make sure it's properly positioned. This is especially true if you happened to have place it on uneven terrain. You don't want your object to appear to be balanced precariously on a single block. So ease it slowly down using the Enter key on your NumPad until it makes firm contact the ground in a manner that looks good to you.
Impressive, no? You could lose a whole team of deuces in there.
So, if you need to move it around you'll use the NumPad again and just for the the record, and because Ken Silverman, in his wisdom, didn't seem to bother to include this in the direction text file, I'll outline what the numpad keys do. Okay I lied. Ken does mention them in his documentation that nobody reads. But it's in no particular order because that's just the way Ken rolls.
Object movement options:
Enter= moves object UP
4= moves object DOWN
1= moves object to the LEFT (relative to which way you are facing)
3= moves object to the RIGHT (relative to which way you are facing)
5= moves object FORWARD/AWAY from you (relative to which way you are facing)
2= moves object BACK/TOWARDS you (relative to which way you are facing)
8= flips the object front to back
7= flips the object side to side
9= flips the object upside down
Other miscellaneous numpad options:
/ and * zoom view in and out
. changes the voxel shading
0 key moves your camera DOWN (as opposed to the CTRL key which moves the camera UP)
(Keep in mind if you add another object or basically do anything else in Voxed you'll lose focus on the object and it will become a fixed part of the map at that point.)
Now you'll want to save your map. You do this by hitting ALT+F3. Choose a filename and hit Save.
Our tutorial is at it's conclusion. I hope this has helped explain both how to import an object into Voxed and how to use Voxed a little better. I left out a lot of stuff such as how to paint in Slab6 and edit your objects, but a that is sort of outside of the scope of this tutorial. One thing I might add, though, for those of you who have a tough time with Voxed is a mention of the app Voxed_Companion. Created by a user known only as Grapist, I've found this tool to be invaluable in making Ken Silverman's counter-intuitive keyboard layout a bit more user-friendly. It can be found on Izzy's aloha.pk forum here. All it really does is rebind the keys a bit differently, letting you use the mouse (no longer inverted!) with the standard WASD keys to move around. Be forewarned some of the standard Voxed commands are now overwritten by the new key bindings but you can turn it off temporarily in the system tray. It also now will minimize Voxed by tapping the Escape key briefly. Hold the Escape key to shut down the program.
Oh, yeah, and if you want it, here's the toilet model I used as an example in the tutorial. Feel free to do whatever you like in it... er, I mean, with it.
Hope you've enjoyed our little exercise. Feel free to ask any questions or nitpick any details I screwed up. Till next time.