This documentation is archived and is not being maintained.

GeometryModel3D Class

Updated: January 2010

Renders a Geometry3D with the specified Material.

Namespace:  System.Windows.Media.Media3D
Assembly:  PresentationCore (in PresentationCore.dll)

public sealed class GeometryModel3D : Model3D
<GeometryModel3D .../>

If you need to create a Model3D that uses multiple materials, you must use the Model3DGroup class to combine multiple GeometryModel3D objects.

The front and back sides of the GeometryModel3D are determined by the winding order of the triangles in the MeshGeometry3D. The front side winds counter clockwise.

The Material and BackMaterial properties may be Transparent or null. When the material is transparent, you cannot see that side of the triangle, but hit testing works as usual. When the material is null, you cannot see it, and hit testing does not work.

The following code excerpt creates a GeometryModel3D in the shape of a cube.

              Positions="-1 -1 0  1 -1 0  -1 1 0  1 1 0"
              Normals="0 0 1  0 0 1  0 0 1  0 0 1"
              TextureCoordinates="0 1  1 1  0 0  1 0   "
              TriangleIndices="0 1 2  1 3 2" />
                  <SolidColorBrush Color="Cyan" Opacity="0.3"/>
  <!-- Translate the plane. -->
            OffsetX="2" OffsetY="0" OffsetZ="-1"   >

The following code excerpt uses a GeometryModel3D whose Geometry is defined as a static resource.

    <GeometryModel3D Geometry="{StaticResource myTeapot}">
            <SolidColorBrush Color="Blue" Opacity="1.0" />
            <AxisAngleRotation3D x:Name="myAngleRotation" Axis="0,3,0" Angle="1" />

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0




January 2010

Updated Remarks section.

Information enhancement.