Game Development Reference
In-Depth Information
}
//Step on to next control point
pt++;
}
if (count!=m_numpoints){
//If all control points are not found in the target mesh
//then this function returns FALSE
TRACE(”CLWScene::AssignControlPoints>>
Not all points in control object found in Bendy
target\n”);
delete [] ptindex;
ptindex=NULL;
return FALSE;
}
return TRUE;
}
This function is designed to fail if all the vertices in the control are not
found in the target. This is not essential and you could have a situation
where the same control deforms points in two different meshes, but this
gets rather complicated to set up and usually simple solutions are the
best.
If you are near your computer and have installed the CD software, then
run Toon3D Creator and open the project file Chapter07/Bendy-
points01.t3d. This contains the objects illustrated. These are ridiculously
simple so that the concept is conveyed; the mesh can be as complex as
the target hardware can cope with.
Creating a hierarchy for controlling your single mesh
character
The first thing to do is to notice that ObjectC is parented to ObjectB. This
is achieved by right clicking on the object in the tree control on the left of
the main application window. In the pop-up menu that is displayed select
'properties'. In the dialog box that is generated select the parent object by
name from the combo box list. When an object is parented to another
object it takes on the world position, rotation and scale of the parent. The
object can then be animated from this new position and orientation, but
will move with respect to the parent. The location and orientation of the
parent becomes the new origin for the object. An object can have just one
parent, but an object can be the parent of many other objects.
Search Nedrilad ::




Custom Search