Geometry Property
Collapse the table of content
Expand the table of content

Viewport2DVisual3D.Geometry Property


Gets or sets the 3-D geometry for this Viewport2DVisual3D.

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

public Geometry3D Geometry { get; set; }

Property Value

Type: System.Windows.Media.Media3D.Geometry3D

The 3-D geometry for this Viewport2DVisual3D.

Geometry is introduced in the .NET Framework version 3.5.

The following example shows how to place a button, a 2-D object, on a 3-D object:

        <PerspectiveCamera Position="0, 0, 4"/>

    <!-- Button on 3D -->
        <!-- Give the plane a slight rotation -->
                    <AxisAngleRotation3D Angle="40" Axis="0, 1, 0" />

        <!-- The Geometry, Material, and Visual for the Viewport2DVisual3D -->
            <MeshGeometry3D Positions="-1,1,0 -1,-1,0 1,-1,0 1,1,0"
                            TextureCoordinates="0,0 0,1 1,1 1,0" TriangleIndices="0 1 2 0 2 3"/>

            <DiffuseMaterial Viewport2DVisual3D.IsVisualHostMaterial="True" Brush="White"/>

        <Button>Hello, 3D</Button>

    <!-- Lights -->
            <DirectionalLight Color="#FFFFFFFF" Direction="0,0,-1"/>

For the complete sample, see Interactive 2-D on 3-D Sample.

.NET Framework
Available since 3.0
Return to top
© 2015 Microsoft