My goal is to recreate the "falling chair demo" as shown here:
http://www.youtube.com/watch?v=tT81VPk_ukU
only with different objects (I prefer sheep). A paper was written by the creators of the demo, titled "BD-Tree: Output Sensitive Collision Detection for Reduced Deformable Models" (Doug L. James and Dinesh K. Pai, 2004).
My entire project is going to be based on this paper, with no previous code to work from. I'm going to start out with my own basic graphics engine and a gray-box demo that will eventually evolve into raining sheep!
For those who are wondering what makes this collision demo so different from any other game or simulation collisions, typical bounding volumes aren't used. In fact, to put it simply, the chairs are filled with tiny little spheres that collide with one another, and this serves as the micro to macro collision testing that allows the chairs to "interact" so realistically. James and Pai really had a novel idea when they implemented this. Even though the demo exists already, recreating it with only one developer and having only the paper for reference to the actual project is going to be quite challenging.
I've been reading the OpenGL Superbible to prepare, as I'm a complete n00b when it comes to OpenGL. Besides having used it at a very high level in a game programming class last quarter (on top of an existing game engine), I have no experience with it at all. On the bright side, I do have some experience with the math behind graphics and physics under my belt.
So, let's see how this goes. From 0 to rocket-sauce.
Day 1: coding up some falling boxes... or, a falling box.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Later this day:
Well, I spent the next 2 hours after writing this reading and re-reading the paper by James and Pai. The first run through, I was baffled. Half of the jargon and mathematical symbols used in the first 4 pages are completely unfamiliar to me. After dedicating time to each specific segment though, I started to get a better grasp of the material. Obviously, I still have to keep reminding myself that the two people who wrote this are Professors in big universities, with numerous Ph'D's and extensive backgrounds in mathematics and graphics. The first "self-aware" conclusion that I came to was: do not try to become a mathematical scholar, graphics expert, and physicist all in one day. In fact, don't try to become them at all, unless that is your goal in life. Just learn what you need and apply it, one step at a time.
After making my own notes on the paper, I looked back on them and got this rush of "What if this is entirely gibberish and I really understand nothing at all? I'm going to be embarrassed to show this to Keenan", but after considering that for a second, I realized that if that is the case, at least I'll be told I'm wrong and know not to carry on in the same way. When you have nowhere to go but forward, you go forward. Now then, here is a condensed version of what I took from my reading:
The Wrapping Approach to Bounding Spheres and Building BD-Trees:
- You start out with a model. Say, a star. You then take the following 2 steps to create the BD-Tree (Bounding Deformation Tree) for that model:
- "Build a hierarchy of the underlying geometry" (James, Pai, 2004).
- To be honest, this is still somewhat confusing and something that I want to discuss with Keenan. The authors mention Quinlan's approach, which I will look into, so that I can at least imagine what the idea is here.
- "Build bounding spheres for the nodes" (James, Pai, 2004).
- This means that you start out with a "loose fitting" bounding sphere that contains a set of polygons with associated vertex points. We then generate descendant spheres that get progressively smaller and tighter to specific areas of the object's geometry. Unlike with the layering approach, where the hierarchy of bounding spheres is based on centering the spheres perfectly inside of their predecessors, the wrapping approach is truer to the shape of the underlying object, and much more localized. Here is an image taken directly from the paper by James and Pai that really helped me to understand this better:
Now, going back to what I mentioned all the way at the beginning of my post earlier today, I see that I was slightly wrong, or rather, incomplete with regards to my explanation as to what makes this a novel idea and different approach. It's not that general bounding spheres aren't used. Instead, they are used in combination with increasingly smaller bounding spheres, and all of these together are not necessarily positioned in a centralized manner.
Now that I'm feeling slightly more competent when it comes to this, I am off to really program. More to come soon!
No comments:
Post a Comment