Click or drag to resize
DigitalRuneMorphTarget Class
Defines a morph target (blend shape) of a submesh.
Inheritance Hierarchy
SystemObject
  DigitalRune.GraphicsMorphTarget

Namespace: DigitalRune.Graphics
Assembly: DigitalRune.Graphics (in DigitalRune.Graphics.dll) Version: 1.2.0.0 (1.2.1.14562)
Syntax
public class MorphTarget : IDisposable, 
	INamedObject

The MorphTarget type exposes the following members.

Constructors
  NameDescription
Public methodMorphTarget
Initializes a new instance of the MorphTarget class.
Top
Methods
  NameDescription
Public methodDispose
Releases all resources used by an instance of the Submesh class.
Protected methodDispose(Boolean)
Releases the unmanaged resources used by an instance of the Submesh class and optionally releases the managed resources.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyName
Gets the name of the morph target.
Public propertyStartVertex
Gets or sets the index of the first vertex in the vertex buffer that belongs to this morph target (a.k.a base vertex or vertex offset).
Public propertyVertexBuffer
Gets or sets the vertex buffer.
Top
Remarks

Morph target animation (or per-vertex animation, blend shape interpolation) can be used to deform a model. It is primarily used for facial animation.

The Submesh defines the base shape (neutral expression). A MorphTarget defines a deformed version of the base shape. Morph target animation typically involves several morph targets where each morph target represents a key shape (expressions such as "smile", "closed eye", "raised eyebrow"). A weight, usually in the range [0, 1], is assigned to each morph target. These weights control the influence of the morph targets and are animated over time. When the model is rendered the vertices are interpolated between the submesh and the morph targets.

The submesh and the corresponding morph targets need to have the same structure. That is, the order of the vertices in the VertexBuffer needs to match the order of the vertices in the submesh. The VertexBuffer of morph target stores vertices of type VertexPositionNormal. Vertex positions and normals are relative to the submesh (difference between key shape and base shape, "delta shape").

The morph target weights of a specific mesh instance are stored in the MeshNode (see property MorphWeights). These weights are used during rendering.

See Also