The Pig Pen gang is back again to demonstrate the power and flexibility of the WTGroup object.
Every Web Driver developer must to be familiar with the WTGroup object. The WTGroup acts as a node in your scene's object hierarchy. You can add it to other WTGroups and add other WTGroups to it. You can add Actors, lights, cameras, and even worlds to it to create a complex object hierarchy. The WTGroup is essentially a frame of reference that stores its own coordinate system, scale, orientation, visibility, and other properties. You can even attach geometry or bitmaps to it. In fact, WTGroups are so important as a frame of reference that bitmaps (when used as decals or sprites) or models can't even exist in your 3D world until they have been attached to a WTGroup.
In the scene above, there are four WTGroups. Each has a different model attached to it. Drag the objects around using the mouse. Use the controls to change the scene by adding groups to groups, scaling, setting visibility, spinning, or even making one group "look at" another (don't forget you have to click the button!). Notice that as you drag an object, the absolute and local positions of that object are displayed. The absolute position is the location of the object in the world while the local position is the location of the object relative to its parent. In the Web Driver, Z is forward, X is right, and Y is up.
It's important to understand that WTGroups will not always have geometry attached to them. They are also convenient as empty frames of reference that can be used for things like a pivot point for a circulating camera or a "handle" on a large group of many children.
Since WTGroups may exist in a hierarchy, it's also important to understand that some properties are inherited by their children, and others are not. Here are just a few examples:
After playing around with the scene for a bit, you'll probably end up with quite a mess, so just refresh the page.
WT::createGroup, WTGroup::attach, WTGroup::addObject, WTGroup::setScale, WTGroup::setVisible, WTGroup::setConstantRotation, WTGroup::setLookAt