Hierarchy of Objects – Interactive 3D Graphics

Hierarchy of Objects – Interactive 3D Graphics


We’ve used object 3D to give us access to a few extra transforms in the chain. However, object 3D is designed for another purpose that is extremely useful. What object 3D does is create a parent child relationship between two objects. Once an object is a child of another object. That child is affected by whatever is done to the parent. Here I’m sowing the fleshed out set of parent child relationships. The car has two doors and four wheels. Each wheel has a rim a hubcap and a tire. This is usually called a seam graph as it defines the graph of relationships of objects in the scene. This whole tree structure is called the hierarchy another frequently misspelled word so get it right. With this hierarchy we can do a lot. For example, we can move the whole car by applying a transform to just the parent. The other objects in the hierarchy will automatically be updated with this transform and follow along with the body. We can also affect objects within the hierarchy. If I change the wheel’s rotation, the rim, hubcap and tire will also be updated and move along. Under the hood what is happening is that a series of transforms are being maintained. For example, for the hub cap, here’s the series. There’s the scale, rotate and translate set for the hub cap itself. Then another scale rotate and translate for the wheel. And finally a scale rotate and translate for the car as a whole. In practice, the scale matrices are not often used. As many model creators make their models to scale. The good news is that these complex series of transforms can be compressed into a single transform that does it all. It holds all the scales, rotations and translations. Plus any thing else done. We’ll show how this works in the upcoming lesson on matrices. That said, fixed hierarchies in the parent child relationship they establish are extremely useful. Hierarchies allow most objects to be controlled in a natural way. I believe I’ve said this three times, so I’ll invoke Lewis Carroll’s line from The Hunting of the Snark, what I tell you three times is true. Personally, when I’m thinking through what series of transforms I want to apply, I work step by step. Perhaps the most important rule I can offer you is this Once you’ve applied a transform, forget about it entirely. That transforms applied, it’s history and you now have some new object and a new position, possibly with some new location at the origin. Next, draw a picture if it helps. I usually do. Finally, once a transform is applied, where does your new object want to move from there? If you find you’ve messed up and the new object is not moving toward your goal, undo and try again.

Leave a Reply

Your email address will not be published. Required fields are marked *