<Canvas Width="321" Height="201">
<!-- The Viewport3D provides a rendering surface for 3-D visual content. -->
<Viewport3D ClipToBounds="True" Width="150" Height="150" Canvas.Left="0" Canvas.Top="10">
<!-- Defines the camera used to view the 3D object. -->
<PerspectiveCamera Position="0,0,2" LookDirection="0,0,-1" FieldOfView="60" />
<!-- The ModelVisual3D children contain the 3D models -->
<!-- This ModelVisual3D defines the light cast in the scene. Without light, the 3D
object cannot be seen. Also, the direction of the lights affect shadowing. If desired,
you can create multiple lights with different colors that shine from different directions. -->
<DirectionalLight Color="#FFFFFF" Direction="-0.612372,-0.5,-0.612372" />
<!-- The geometry specifies the shape of the 3D plane. In this sample, a flat sheet is created. -->
TriangleIndices="0,1,2 3,4,5 "
Normals="0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 "
TextureCoordinates="0,0 1,0 1,1 1,1 0,1 0,0 "
Positions="-0.5,-0.5,0.5 0.5,-0.5,0.5 0.5,0.5,0.5 0.5,0.5,0.5 -0.5,0.5,0.5 -0.5,-0.5,0.5 " />
<!-- The material specifies the material applied to the 3D object. In this sample a tiled drawing
covers the surface of the 3D object.-->
<DrawingBrush Viewport="0,0,0.1,0.1" TileMode="Tile">
<GeometryDrawing Geometry="M0,0.1 L0.1,0 1,0.9, 0.9,1z"
<GeometryDrawing Geometry="M0.9,0 L1,0.1 0.1,1 0,0.9z"
<GeometryDrawing Geometry="M0.25,0.25 L0.5,0.125 0.75,0.25 0.5,0.5z"
<GeometryDrawing Geometry="M0.25,0.75 L0.5,0.875 0.75,0.75 0.5,0.5z"
<GeometryDrawing Geometry="M0.25,0.75 L0.125,0.5 0.25,0.25 0.5,0.5z"
<GeometryDrawing Geometry="M0.75,0.25 L0.875,0.5 0.75,0.75 0.5,0.5z"
<!-- Apply a transform to the object. In this sample, a rotation transform is applied, rendering the
3D object rotated. -->
<AxisAngleRotation3D Axis="0,3,0" Angle="40" />
PerspectiveCamera specifies a projection of a 3-D model to a 2-D visual surface. This projection includes perspective foreshortening. In other words, the PerspectiveCamera describes a frustrum whose sides converge toward a point on the horizon. Objects closer to the camera appear larger, and objects farther from the camera appear smaller.
The following diagram shows the difference between orthographic and perspective-foreshortened camera projections.
Applies an animation to the specified DependencyProperty. The animation is started when the next frame is rendered. If the specified property is already animated, the SnapshotAndReplace handoff behavior is used.
Applies an animation to the specified DependencyProperty. The animation is started when the next frame is rendered. If the specified property is already animated, the specified HandoffBehavior is used.
Creates a modifiable clone of this PerspectiveCamera, making deep copies of this object's values. When copying dependency properties, this method copies resource references and data bindings (but they might no longer resolve) but not animations or their current values.
Creates a modifiable clone of this PerspectiveCamera object, making deep copies of this object's current values. Resource references, data bindings, and animations are not copied, but their current values are.
Coerces the value of the specified dependency property. This is accomplished by invoking any CoerceValueCallback function specified in property metadata for the dependency property as it exists on the calling DependencyObject.
Raises the Changed event for the Freezable and invokes its OnChanged() method. Classes that derive from Freezable should call this method at the end of any API that modifies class members that are not stored as dependency properties.
Verifies that the Freezable is not frozen and that it is being accessed from a valid threading context. Freezable inheritors should call this method at the beginning of any API that writes to data members that are not dependency properties.