Modeling Realistic 3D Objects

CS 493/693 Lecture, Dr. Lawlor

So to model real-world objects, you need a modeling program.

Blender is a pretty capable free 3D modeling program.  It's available for all platforms.  The only downside is the bizarre, nonstandard user interface.  This is typical for 3D modeling programs, even pro versions--they're just their own weird thing.  Start with the official installer (use the .zip option on the Chapman lab machines, since the .exe installer needs admin access).

Check out the Blender Tutorials and Blender Doc Wiki.  In particular, I've worked over the Volcano Tutorial to the point where it almost makes sense.  Here's my super-compressed cheat sheet:
Blender starts you out with a cube.  To model anything with this, we need more polygons.  Press F9 to get to the Editing panel, and then hit "Add Multires" and then hit "Add Level" six times.  Zoom into the now-smoothed high-poly sphere with control-middle-click.   Switch to "Sculpt Mode".  Hit the "Sculpt" tab to get sculpting options.  Turn on symmetry about the X axis.  Use the "Add", "Grab", and "Smooth" tools to sculpt the object into something meaningful, like a potato.  Save the original as a .blend file.  To save a low-poly triangle version in a nice ASCII format, "Apply Multires", "Add Modifier" "Decimate", and set the decimation ratio to 0.1 or so.  Hit Apply, and File->Export as a RAW or Wavefront .obj file.

Exporting from 3D modelers to "Real Code"

So 3D modeling programs make it pretty easy to generate cool polygon geometry.  The trick is then you've got to somehow move that geometry into your application (game, visualization app, etc).

The easiest way to do this is skip it entirely--just do all your modeling and rendering inside the 3D modeling program!  But the modeling performance of these programs usually isn't that good, and you often need to add some simulation or visualization features that would be easy in C++, but tricky in the 3D program.

The standard way to exchange data between programs is of course files.  We've looked at several very simple file formats, like the OBJ file format, but modeling programs usually support more than the very simplest "just the polygons" formats, because the modeling programs support way more than just polygons--they have colors, textures, "instanced" sub-pieces (like function calls), and transforms.

Blender supports a bunch of decent file formats:
To export a fully-rigged model, preserving all the animation and bone info, takes an industrial-strength file format (the 3D analog of a complicated image file format like JPEG!).  There's a new XML-based standard called COLLADA that attempts to be that format, but it looks pretty complicated, and it's evolving very quickly.

Generating Tetrahedral Meshes

Virtually all 3D model formats export only the object's surface, but to simulate interesting stuff you usually need some representation of the interior volume.  There's a cool package called "TetGen" that can read a *closed* .off or .ply model from Blender and generate interior tetrahedrons.  If your model isn't closed, MeshLab can automatically close the holes.

Reading tetrahedra is much like reading triangles: there's a set of 3D vertices, then 4 vertex indices per tet.  Next week, we'll look at how to simulate physics on tetrahedral slivers of solid objects!