Graphics Reference
In-Depth Information
6.6.3.3 Constructing a Composite Component
A composite node is specified via the instantiation of subcomponents within a
Model3DGroup element; the subcomponents are accumulated into the composite
node's own coordinate system.
6.6.3.4 Creating the Lower Leg
Here is a first draft of our camel's lower leg:
1
2
3
4
5
6
<Model3DGroup x:Name= "LowerLeg" >
<GeometryModel3D Geometry= "{StaticResource RSRCmeshFoot}"
Material=... />
<GeometryModel3D Geometry= "{StaticResource RSRCmeshShin}"
Material=... />
</Model3DGroup>
Testing this composite by instantiating it into the viewport yields the rendering
shown in Figure 6.44.
Inline Exercise 6.11: Back in the lab, select the model “Lower leg (shin +
foot)”.
This unsatisfactory result, in which the two models co-inhabit space causing
the foot's ankle region to intersect the shin, occurs because each component is, by
design, positioned at the origin of its local coordinate system. When composing
parts, we must use instance transforms to properly position the subcomponents
relative to one another. Our goal is for the bottom of the shin to be connected to
the top (ankle) part of the foot.
Thus, we need to translate the shin in the positive y direction; an offset of 13
units is satisfactory. Note that the foot is already properly positioned for its role in
the lower-leg composite and thus needs no transform.
Below is our second draft of the XAML specification for this composite com-
ponent (with the new lines of code highlighted). A couple of views of the result
are shown in Figures 6.45 and 6.46.
Figure 6.45: Rendering of the
lower-leg model, now corrected
via application of a modeling
transformation on the shin sub-
component.
1
2
3
4
5
6
7
8
9
10
11
<Model3DGroup x:Name= "LowerLeg" >
<GeometryModel3D Geometry= "{StaticResource RSRCmeshFoot}"
Material=... />
<GeometryModel3D Geometry= "{StaticResource RSRCmeshShin}"
Material=... >
<GeometryModel3D.Transform>
<TranslateTransform3D OffsetY="13"/>
</GeometryModel3D.Transform>
</GeometryModel3D>@</Model3DGroup>
Figure 6.46: Rendering of the
lower-leg model from a second
point of view.
Inline Exercise 6.12: Return to the lab, and use the hierarchy viewer/editor to
add a transform to the shin to repair the lower-leg composite.
 
 
Search WWH ::




Custom Search