Jump to content

  • Curse Sites
Become a Premium Member! Help
Latest News Article

Converting a 3D model to building plans


  • Please log in to reply
611 replies to this topic

#1

erich666
  • Location: Ithaca, NY

Posted 13 October 2010 - 08:21 PM

I recently got Patrick Min hooked on Minecraft. Among other things, he's modified his voxelization programs to help you convert any 3D model to cubes and build it in Minecraft (by hand - anything else is cheating  :P).

Go to his web page and enjoy; he's very open to suggestions to improve the software (links to binvox and viewvox are in the upper left of this page). Also, it's all open source, and works on Windows, Mac, and Linux. I have a post further down in this thread that gives a tutorial. This tutorial is also now Minepedia, so go there to improve it.

Here's a project I built in a few hours (more screenshots here):
Posted Image
All things Vokselian are here.

Register or log in to remove.

#2

MrTorus
    MrTorus

    Obsidian Miner

  • Members
  • 1486 posts
  • Location: Brazil :(

Posted 13 October 2010 - 08:46 PM

Freakin' awesome!
Please, read this thread:
MINECRAFT FACTS: BIG LIST OF WHAT NOTCH HAS ACTUALLY SAID ABOUT THE PLANNED FEATURES OF MINECRAFT

"If something ever doesn't feel fun, I'll remove it." - Notch


#3

KapnKerfuffle

Posted 13 October 2010 - 10:05 PM

That's quiet amazing!
So, where is a good source to get .wrl files to convert with this program?

#4

Mortal_Wombat

Posted 13 October 2010 - 10:27 PM

hi, im new here. do i need to use this program to convert, lets say blender models into 'minecraft' models ? i would like to have some fun making few models for minecraft :Lava:

#5

gazeebo
    gazeebo

    Out of the Water

  • Members
  • 4 posts

Posted 14 October 2010 - 08:13 AM

Would it be possible for someone to dumbify the walkthrough on how to do this?
For example, which file extensions are supported and a bit more non expert mode walkthrough ;).

Rightn ow I have no idea what to do and how to do it.
I dragged a .obj file onto the .exe and i saw it do all kinds of funky stuff with it but then it crashed.
It doesn't support .max files.

#6

pmin00
    pmin00

    Zombie Killer

  • Members
  • 183 posts

Posted 20 October 2010 - 03:11 PM

Mortal_Wombat said:

hi, im new here. do i need to use this program to convert, lets say blender models into 'minecraft' models ? i would like to have some fun making few models for minecraft :)

In blender, you could for example export the model to VRML 2.0 (called VRML 97 in blender),
then voxelize the resulting .wrl file with binvox.

The result is a voxel model (i.e. your model made out of cubes), which
you'll still have to build inside minecraft. My 'viewvox' program helps
visualize the voxel model in such a way that it becomes easier to build
inside minecraft.

I hope this helps,

Patrick
binvox for minecraft is at http://www.patrickmin.com/minecraft.
get your printable Sudoku puzzles here.

#7

pmin00
    pmin00

    Zombie Killer

  • Members
  • 183 posts

Posted 20 October 2010 - 03:14 PM

hi gazeebo,

gazeebo said:

Would it be possible for someone to dumbify the walkthrough on how to do this?
For example, which file extensions are supported and a bit more non expert mode walkthrough :P.

The 3D model formats that binvox supports are listed on its web page:
"- nearly 100% VRML 2.0 support
- will parse Wavefront OBJ, Geomview OFF, Autocad DXF, PLY and STL, if they contain polygons only"

gazeebo said:

Rightn ow I have no idea what to do and how to do it.
I dragged a .obj file onto the .exe and i saw it do all kinds of funky stuff with it but then it crashed.
It doesn't support .max files.

Note that both binvox and viewvox are command line programs, this means they must
be run from the command shell ("cmd" in Windows).

And yes, binvox doesn't support .max files.

best,

Patrick
binvox for minecraft is at http://www.patrickmin.com/minecraft.
get your printable Sudoku puzzles here.

#8

masters1222

Posted 20 October 2010 - 05:11 PM

omg that's awesome!
Posted Image

Win prizes just by searching^
Sign up under my referral link for double swag bucks! (The page the banner takes you to)

#9

trondaron

Posted 20 October 2010 - 09:57 PM

Some models I found:
http://people.sc.fsu...ta/obj/obj.html
http://lodbook.com/models/
http://shapes.aim-at.../viewmodels.php
http://dd-freebies.b...label/3D models
http://www.oyonale.c...g=en&format=OBJ

Some of the models in the sites come in compressed archives with several other files to filter through, but I found at least one model on each site that worked just using the info linked by erich666.

Untested/Potential Registration:
http://www.turbosquid.com

#10

erich666
  • Location: Ithaca, NY

Posted 22 October 2010 - 01:42 AM

Here's the quick (?) tutorial, for people not familiar with "cmd", etc. This tutorial is also now Minepedia, so go there to improve it.

Get the software and some models. To make it easy on you, I've bundled up the latest (as of 11/17/2010) binvox and viewvox programs, the GLUT DLL, and two models with batch files to display them. Get it all  HERE and unzip it to somewhere. Read the README.TXT in there if you just want to quickstart without reading further. Mondeus' video showing how it's used may also help you - basically, double-click a .bat file and the corresponding model is converted and displayed.

If you want to do it the hard way, but are assured of getting the latest versions, do the following. You should know about Patrick's minecraft page - bookmark it. First, download binvox and viewvox into some directory. You could put them on the desktop, if that's how you roll. You will also need to download GLUT and put the DLL in that zip file into either the same directory as binvox, or if you know what you're doing, your Windows system DLL directory (e.g. on Windows 7, C:\Windows\SysWOW64).

Second, find a model to convert and put it in the binvox directory, for simplicity. The previous post has a number of sites for free models, and there are more out there, e.g. TurboSquid's, 3dvia's, Princeton's, and Nasa's. You can use any model directly that is in one of these formats: VRML, OBJ, OFF, DXF, PLY and STL.

If you have a model in another format, you can use Milkshape, Blender, or another model converter and convert it from your format to something binvox will read.

Anyway, let's take a nice simple model from Aim*SHAPE, a hand model. You don't need to get the high-res model, a low-resolution mesh is fine - after all, it'll become blocks. So pick the third one from the left, in the bottom row. Once you've downloaded it, unzip it to wherever you put binvox and viewvox, for simplicity. The only file you'll actually need is gipshand2-3k.obj, which is actually a text file of the model's data.

Now, click the Start menu button (lower-left corner of your screen) and in the search line at the bottom of the screen type:

cmd

A black text window will open up. Go to wherever you put your binvox file and model, e.g. for my desktop it's:

cd C:\Users\Eric\Desktop

(though I decided to use another directory, since I don't like to clutter my desktop). To run binvox, you then type:

binvox gipshand2-3k.obj

For a minute or so you'll see a bunch of hand renderings in the upper left of your screen. This is binvox slicing the model up and finding the voxels. This creates a file called "gipshand2-3k.binvox" - this name gets mentioned in the CMD window, looking like this:

Voxels::print_filled_area
  area filled: 185 x 92 x 243
  integer bounding box: [6,6,7] - [190,97,249]

writing voxel file...
VoxelFile::write_file(gipshand2-3k.binvox)
Wrote 426642 set voxels out of 16777216, in 148528 bytes
The top part shows how large the model is; the third value is the height, 243 blocks high. Too high for a Minecraft world, but we'll get to size in a minute.

If you didn't get anything, make sure you are in the same directory! That is, "cd" is "change directory" - look carefully for how I used it above. If you don't know DOS commands, make your life simple and put the binvox.exe program (and related files) and your model file in the same directory, the same location. This is the #1 problem people have with running binvox, not understanding that binvox needs to know where your file is located.

To view that output file, type:

viewvox gipshand2-3k.binvox

Tip: you can use the up-arrow in the CMD window to bring up the command you just typed (you can press it multiple times) and the left and right arrows and delete keys to change what's on the line. So in this case, instead of typing "gipshand2-3k.obj" again, you could up-arrow and change "obj" to "binvox" and "bin" to "view". Your call.

You should get something like this (the CMD window is scrolled up a bit, to show the command line I typed in, though oops I cut off the end of my command line):

Posted Image

Viewvox shows some very useful info for minecrafters, e.g.

Voxels::remove_internal_voxels
  removing 383513 voxels, which leaves 43129 voxels
This tells you how many blocks you'll need to build something. To close viewvox's window, click on the CMD window and type Control-C. Don't ask me why. You should get a ">" prompt when you're really done.

However, by default, binvox makes models into block sets that are 256 blocks high (or long, or deep, whatever's largest). We'd like say 64. Now, you could type this:

binvox gipshand2-3k.obj -d 64

"-d 64" says how many blocks high you'd like the scan. Technical note: On Windows machines there's a GLUT bug that the window cannot be smaller than around 120 voxels (Linux doesn't have this problem). We added some code internally to increase the resolution and then downsample, so it sort of works the same. The manual way around this problem is:

binvox gipshand2-3k.obj -down -down

What each "-down" does is halve the resolution. We start at 256 by default, so divide by 2, and 2 again, i.e. 4, gives 64. Another way around this problem is to use the "-e" option, which does an "exact" (any voxel overlapped gets tagged) voxelization:

binvox gipshand2-3k.obj -d 64 -e

Exact voxelization avoids any precision problems that come from using the GPU to compute the voxelization. The downside of exact voxelization is that there is no further control. All voxels that are touched by any polygon are flagged, which can sometimes look bad. There are numerous options to control the density, whether edges get emphasized, etc.

Whichever you use, a new binvox model is output. Use viewvox on this new model, which you'll notice is called gipshand2-3k_1.binvox. So type:

viewvox gipshand2-3k_1.binvox

You can control the view of the object by using the mouse. Left-mouse button held down rotates, middle mouse pans, right mouse  zooms (in a funky way). Here's a view of our model, rotated:

Posted Image

Looks pretty good, and viewvox says the hollow shell has 2471 blocks. At say 5 seconds a block, that's about 3.5 hours of building time. But, how to build it? Very easy (other than all the heavy lifting):

First, press the S key. This toggles between showing the whole model and just a horizontal slice. It's still hard to count blocks off, so press the A key. This causes checkerboard coloring to be used. You want to see the slices above and below? Hit N to toggle these neighbors on, then T to make them semitransparent. Hitting 1 toggles the coordinate numbers on. Note that in the CMD window all of these options are listed at startup.

Here's a view after all that, a horizontal slice through the middle of the model.

Posted Image

Pro tip: Personally, now that I'm used to the program, I always type "antspy" (think "ant spy") when starting up viewvox. This gets me into an overhead view, showing one layer, with transparency above and below. I usually hit N again two more times, to show just the neighboring layer below.

You of course want to start at the bottom of the model and build up. Hitting the J key takes you to the slice below, K above. You can see what number slice you're on (numbering starts at 0) by looking in the CMD window.

That's the basics, and that's only if everything goes really well. First, I picked a model that was "watertight", that would not leak water if you filled it, and had no "hanging edges". Most models you find on the internet will not be like this, they're usually surfaces just glued together to get an effect. So, you'll need to try out various options on the command line. Here are the vital ones for binvox.

-c - If your model is not watertight, this is the option you really must use. It actually renders much faster, but can miss nooks and crannies.

-dc - small features can be missed when voxelizing. This option attempts to thicken the model.

-aw - draw all the edges of the model. This is another thickening technique for very thin features.

-dmin 1 - when using "-down", make the smaller model's voxel get filled if any voxel in the larger model is filled. Another thickening technique.

-rotx - rotate the model 90 degrees along the X axis. In viewvox the X axis is red, Y green, Z blue (RGB). You can do this multiple times.

-rotz - rotate 90 degrees along the Z axis. Many models come in with their "up" direction different than what binvox expects. Just keep trying -rotx and -rotz commands to get the thing oriented correctly.

-cb - this isn't critical, but I always use it (except in the tutorial above, just to keep things simple). The model is usually shifted so that it is in the lower left hand bottom corner of the cube formed. This option puts the model in the middle, making it easier to read the coordinate axes. It's up to you.

-t schematic - instead of outputting to a .binvox file, output to a .schematic file. This type of file can be imported directly into a Minecraft world by using MCEdit or other tools.

You can see more command options if you type just "binvox". After fussing with these options awhile, the voxelizations are usually about 98% correct - I find I'd need to trim a block here, add a block there.

As an example, here's a knight model that I converted with:

binvox chevalier.obj -d 536 -aw -c -dc -cb -dmin 1 -down -down -down

Posted Image

Have fun, and post any problems here or PM me or, better yet, Patrick.

If you want to import models directly into a Minecraft world, which to me is entirely unimpressive without all the sweat and tears of actually building it, read about that option here.

New binvox and viewvox versions and options are being added all the time, so keep downloading them if you're using them. You can always check the version and options supported in binvox by just typing "binvox" (no arguments) into the CMD window.

Eric
All things Vokselian are here.

#11

JaydenB
    JaydenB

    Full Stack

  • Members
  • 64 posts

Posted 23 October 2010 - 10:13 AM

Eric: that looks awesome! Can't wait to use it. Now I need to find the perfect model to do it on :)
Posted Image

#12

rcpongo
    rcpongo

    Tree Puncher

  • Members
  • 12 posts

Posted 26 October 2010 - 06:13 PM

Thanks so much.

Using this technique, I have been able to build something very large. Mount Rushmore!

Posted Image



#13

_carcass_

Posted 27 October 2010 - 07:54 PM

It's an awesome program.
Just finished my project and Patrick has now placed it on his website alongside the cool and epic Mount Rushmore, mug and the shark.

It took 2500+ blocks to create
It's dimensions are approximately 60 in length, 20 in width and 40 in height
2 deaths from falls
2 mistakes were made
4+ hours in total
5 cups of coffee
3/4 of a pack of biscuits were consumed.

Posted Image

#14

erich666
  • Location: Ithaca, NY

Posted 28 October 2010 - 09:55 AM

I built the knight model I used in the tutorial, here it is. The joke is "darn contractors!" - they need to be more careful reading the plans.

Posted Image
All things Vokselian are here.

#15

michaelrose
  • Minecraft: michaelrose

Posted 28 October 2010 - 11:03 AM

I decided to give Binvox and Viewvox ago. Posting in this thread where it's most relevant.

My first project: A Japanese Gojuu
=====================

Well... it took 8 hours and 4 cups of coffee, but I think she's finished.

Posted Image

I used Binvox and Viewvox to make this happen and I really like the way this approach combines clever 3D modelling/conversion and hand-building.

If one could import these models directly into Minecraft I think that'd be interesting for a few hours and then just get very boring.

The fact I had to build this one block at a time, referring again and again to the blueprints, has given me a good sense of how the building is actually constructed and it gave a great feeling of satisfaction when done. I even made a few design decisions of my own during the build, like placing hidden lighting inside the Gojuu, which again
makes this feel like a personal project rather than just something I copy-pasted from the internet.

Anyway, I hope you like it... my next project is going to use twice as many blocks and be made entirely out of gold! I started last night but I have a feeling it's going to take at least a week of late nights to get it finished -- it's gonna be awesome (:
Posted Image

#16

_carcass_

Posted 29 October 2010 - 07:35 AM

Cool stuff guys.
I totally agree, importing it into the program like the guy who did the massive starship enterprise is ok, but just not the same.  Same goes with classic mode.  It's nice to create some stuff with coloured textures but being in survival mode, collecting the blocks yourself from exploring, being on the edge of danger every second with risking falling off (don't know if anyone else forgot to go back from the edge to press the inventory button while still holding shift? oops...) and keeping an eye out for anything that could blow it up any second just adds to the fun and the total sense of satisfaction when it is done.  
I made mine and walked away to the nearest hill without looking, it was so satisfying to see it completed for the first time knowing I had spent hours placing each individual block.  The inside of the cows belly is bigger than any natural cave I have found so far.

I'm curious what this gold build is going to be!

#17

erich666
  • Location: Ithaca, NY

Posted 29 October 2010 - 10:12 AM

_carcass_ said:

... keeping an eye out for anything that could blow it up any second just adds to the fun

Full disclosure: I made the teapot on a multiplayer alpha server, so falling off wasn't a huge deal (that said, I did try to avoid it, accidentally falling to my death once, from indeed not holding down shift). I made the teapot just after we had moved our world to a new server, and this server had monsters spawn at night. After the fifth creeper blew a hole in the teapot, we realized what was going on and set it to "peaceful". Still, gathering the materials, gathering wood from a tree farm to smelt them (note my knight is entirely in true stone), and placing each block definitely gives some sense of accomplishment.

OK, so here's a crazy-person project that I don't think I have enough crazy for: horizontal sculptures of vast proportions. For example, a reclining nude, or a fallen statue, or even just some creature like a gecko, could be quite long compared to its height, possibly hundreds of blocks long or longer.
All things Vokselian are here.

#18

_carcass_

Posted 29 October 2010 - 08:01 PM

erich666 said:

OK, so here's a crazy-person project that I don't think I have enough crazy for: horizontal sculptures of vast proportions. For example, a reclining nude, or a fallen statue, or even just some creature like a gecko, could be quite long compared to its height, possibly hundreds of blocks long or longer.

Now that's a plan!!
I was going to dig out a quarry and build a digger on the edge of it but that project sounds quite cool.  The only annoyance would be finding the largest flat area which would take the least amount of time to completely level out.  Might need an inventory of shovels for that one.  I'll have a look on turbosquid.com and see if I can find anything worthy of a challenge!  They seem to have the most biggest and diverse collection of 3d images so far.

#19

michaelrose
  • Minecraft: michaelrose

Posted 30 October 2010 - 02:23 PM

_carcass_ said:

I'm curious what this gold build is going to be!

Just posted here: viewtopic.php?f=25&t=60742&p=1086042#p1086042

Really love the way it turned out. I wanted to do bigger but he's already got his head in the clouds!
Posted Image

#20

pullie
    pullie

    Out of the Water

  • Members
  • 5 posts

Posted 03 November 2010 - 02:40 PM

plz make a guide on youtube words are 1 ting but its pissing me off sins it wont work ore make a prie made pak in place off 500000 difrent dll folders and exe shit