Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
Model3D Class
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
Model3D Class

Updated: November 2007

Abstract class that provides functionality for 3-D models.

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

Visual Basic (Declaration)
<LocalizabilityAttribute(LocalizationCategory.None, Readability := Readability.Unreadable)> _
Public MustInherit Class Model3D _
    Inherits Animatable _
    Implements IFormattable
Visual Basic (Usage)
Dim instance As Model3D
C#
[LocalizabilityAttribute(LocalizationCategory.None, Readability = Readability.Unreadable)]
public abstract class Model3D : Animatable, 
    IFormattable
Visual C++
[LocalizabilityAttribute(LocalizationCategory::None, Readability = Readability::Unreadable)]
public ref class Model3D abstract : public Animatable, 
    IFormattable
J#
/** @attribute LocalizabilityAttribute(LocalizationCategory.None, Readability = Readability.Unreadable) */
public abstract class Model3D extends Animatable implements IFormattable
JScript
public abstract class Model3D extends Animatable implements IFormattable
XAML
This class is abstract; see Inheritance Hierarchy for derived non-abstract classes usable in XAML.

Objects of this type include GeometryModel3D and Light.

XAML
<DockPanel>
  <Viewport3D Name="myViewport">

    <Viewport3D.Camera>
      <PerspectiveCamera FarPlaneDistance="20" LookDirection="5,-2,-3" UpDirection="0,1,0" NearPlaneDistance="0" Position="-5,2,3" FieldOfView="45" />
    </Viewport3D.Camera>

    <ModelVisual3D x:Name="topModelVisual3D">
      <ModelVisual3D.Children>
        <ModelVisual3D>
          <ModelVisual3D.Content>
            <DirectionalLight Color="#FFFFFFFF" Direction="-3,-4,-5" />
          </ModelVisual3D.Content>
        </ModelVisual3D>

        <ModelVisual3D>
          <ModelVisual3D.Content>
            <GeometryModel3D Geometry="{StaticResource myTeapot}">
              <GeometryModel3D.Material>
                <DiffuseMaterial>
                  <DiffuseMaterial.Brush>
                    <SolidColorBrush Color="Blue" Opacity="1.0" />
                  </DiffuseMaterial.Brush>
                </DiffuseMaterial>
              </GeometryModel3D.Material>
              <GeometryModel3D.Transform>
                <RotateTransform3D>
                  <RotateTransform3D.Rotation>
                    <AxisAngleRotation3D x:Name="myAngleRotation" Axis="0,3,0" Angle="1" />
                  </RotateTransform3D.Rotation>
                </RotateTransform3D>
              </GeometryModel3D.Transform>
            </GeometryModel3D>
          </ModelVisual3D.Content>
        </ModelVisual3D>


      </ModelVisual3D.Children>
    </ModelVisual3D>


    <Viewport3D.Triggers>

      <EventTrigger RoutedEvent="Viewport3D.Loaded">
        <BeginStoryboard>
          <Storyboard>
            <DoubleAnimation 
              Storyboard.TargetName="myAngleRotation"
              Storyboard.TargetProperty="Angle"
              From="0" To="360" Duration="0:0:10"
              RepeatBehavior="Forever" />
          </Storyboard>
        </BeginStoryboard>
      </EventTrigger>
    </Viewport3D.Triggers>


  </Viewport3D>
</DockPanel>

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 Vista

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
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker