Sunday, March 20, 2011

Animation Project: Fast 3D Sculpter


Here's a simple tool I've made for whipping up complex 3D structures quickly.  Right now it's best at making things like fractals and spirals, but you can make anything with it (houses, cars, animals, etc.) with relatively few commands.

The video below mainly just shows how it works; fast forward to the end to watch it produce some complicated formations.  Later on I'll record myself building a more visually realistic scene.

The user interface I made for this sculpter is extremely simple and has just a few buttons, with the clever "copy/paste" buttons doing most of the work.  These let you duplicate entire branches of the scene graph of all your objects, allowing you to exploit symmetries and patterns in the objects you're trying to make so that they're done in fewer clicks.

Speed, not visual accuracy, is the goal.  The idea is to quickly crank out prototypes with this, and then to use some more precise modeling tools later that will use the prototype's shape as a guideline.

The video:


Something like this will eventually be integrated into my long-term virtual environment project as the main way to construct things.  Specifically, when you're done whipping up shapes with this tool, your finished structure will be used as a bounding volume to be filled with particles of physical materials (such as cloth, fluids, sand, metal, etc.); the structure will then exist in the environment as if it were made of those materials, by using soft body dynamics and other techniques.

This was made in 2 weeks for "Introduction to Graphics" class and is my first OpenGL creation.  The class assignment was to animate something to show that we had learned how to do basic 3D stuff. I decided to make more of a construction sandbox than an animation; this "animation" won first place out of 49 others in a class vote, where its eligibility was borderline since I kind of went wild and did my own thing, but the results show the class at least seemed to approve. This sculpting tool was all done using C++ code; single matrix transforms (see examples) are used to simultaneously set the location, orientation, and shape of each object, with some more math thrown in when needed to make things bounce around.





Above:  Pictures from early development (Click for bigger).


Above:  Some shapes that were defined recursively, by doing copy/pastes within the scene graph.


Above:  The same shape is in both pictures, but in the second a scale transform is applied to the graph's root node along one axis.



Above:  Only one side of the house and ground needed to be drawn by hand.  The other three sides were automatically generated by simply hitting the paste button three times, after having copied that part of the scene graph in a way that also included a rotation transform.  Also shown is a tree, drawn by recursively replicating its own parts in a similar manner.  The second drawing shows the whole first drawing replicated with a transform, which causes the scene to mutate in interesting ways.


No comments:

Post a Comment