How to Build a Chair

Suppose you need to populate a virtual auditorium with a bunch of chairs. These chairs are identical in size and color. The only difference between the chairs is their location on the auditorium floor—in other words, a TranslateTransform3D.

You'll probably want the entire chair to be defined as a resource so that you can simply set it to the Content property of a ModelVisual3D and then set the Transform property to move the chair to its proper location:

<ModelVisual3D Content="{StaticResource chair}">
    <ModelVisual3D.Transform>
        <TranslateTransform3D OffsetX="-3" OffsetZ="2" />
    </ModelVisual3D.Transform>
</ModelVisual3D>

That resource must be a type that descends from Model3D. You might assume it's a GeometryModel3D, where the ...

Get 3D Programming for Windows® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.