Consider a <DRM Model> instance T representing
a tank that is is comprised of separate tank body, turret, and cannon
submodels, each instantiated by T as depicted in
Figure 6.141.
Figure 6.141 — <DRM Interface Template> example
The turret can be dynamically rotated and the cannon can be dynamically
elevated. Both movements can be controlled separately.
Both movements are rotations, so each of the turret and cannon
submodels have <DRM Rotation> instances at
appropriate points in their hierarchies. Each of these
<DRM Rotation> instances has a
<DRM Rotation Control Link> component, which
in turn has a <DRM Variable> component that
specifies the current rotation. The values supplied for these
<DRM Variable> instances are adjusted from
outside the submodels that contain them. Consequently, the
<DRM Variable> instances in each submodel are
associated with the <DRM Interface Template> component
of its submodel.
However, the turret and cannon rotations are controlled from outside
the entire tank <DRM Model> instance T.
Therefore, it is possible to set rotation values using
the <DRM Interface Template> component of
T,
so T contains a turret rotation
<DRM Variable> instance and a cannon elevation
<DRM Variable> instance. These <DRM Variable> instances
are associated with the <DRM Interface Template> component of
T. Each of the two
<DRM Variable> instances is also aggregated by the
<DRM Geometry Model Instance> instance that
instances the submodel to which they relate.
Finally, it is necessary to tie the <DRM Variable> instances in
T to the equivalent <DRM Variable> instances
in each of the submodels. This is done using the
<DRM Model Instance Template Index>
link object for each tank <DRM Variable> instance. The
<DRM Model Instance Template Index> link object associated with
the turret rotation <DRM Variable> instance of
T
references the equivalent <DRM Variable> instance’s entry in the
turret <DRM Model> instance’s <DRM Interface Template> component.
Similarly, the <DRM Model Instance Template Index>
link object associated with T’s cannon elevation
<DRM Variable> instance references the equivalent
<DRM Variable> instance’s entry in the
<DRM Interface Template> component of the
cannon <DRM Model> instance.
Consequently, T’s <DRM Interface Template>
component allows the turret rotation and cannon elevation to be set from
outside T. The values set in T
themselves set values in the <DRM Variable> instances within the
turret and cannon submodels, thereby rotating the turret and elevating
the cannon as required.
Consider a building <DRM Model> instance that may be instanced on
terrain polygons that are at various different orientations. Each building
wall meets the terrain, leaving no gaps. This means that the lengths of
the walls of the building are adjusted by different amounts in each
instance to match the slope of the ground.
The location of each <DRM Vertex> component of a
<DRM Polygon> instance can be adjusted by using
a <DRM LSR 3D Location Control Link>
instance aggregated by the <DRM LSR 3D Location>
instance that specifies the location of the <DRM Vertex> instance.
Each <DRM LSR 3D Location Control Link>
instance has a <DRM Variable> component that specifies the new
location value. These <DRM Variable> instances are set separately
for each instance to match
the terrain upon which the building is positioned. The
<DRM Variable> instances are set from outside the
building <DRM Model> instance so all of these
<DRM Variable> instances
in the building <DRM Model> instance are associated
with the <DRM Interface Template> component of the
<DRM Model> instance.
When the building is instanced, using a
<DRM Geometry Model Instance> instance
GMI, the values of the
<DRM Variable> instances can be set for
GMI using <DRM Expression> components
of GMI. When the terrain on which
GMI stands is known and fixed, these
<DRM Expression> components can be
<DRM Literal> components. Each
<DRM Literal> component is related to the
<DRM Variable> instance for which it is
specifying a value through a
<DRM Model Instance Template Index>
link object that references the
<DRM Variable> instance by way of the
<DRM Interface Template> component of the
building <DRM Model> instance.