HandMeshObserver HandMeshObserver HandMeshObserver HandMeshObserver HandMeshObserver Class


Provides mesh updates each frame that track the detected shape of a hand.

public : sealed class HandMeshObserver
struct winrt::Windows::Perception::People::HandMeshObserver
public sealed class HandMeshObserver
Public NotInheritable Class HandMeshObserver
// This class does not provide a public constructor.

Windows 10 requirements

Device family
Windows 10, version 1903 (introduced v10.0.18362.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v8)


Creating a HandMeshObserver subscribes you to hand mesh updates for a given SpatialInteractionSource that tracks the detected shape of that hand.

When users are directly interacting with virtual objects with their hands, you may wish to render a visualization of the hands to increase the user's confidence in their interactions. By creating a HandMeshObserver, you can get a fixed index buffer for the hand up front by calling @Windows.Perception.People.HandMeshObserver.GetTriangleIndices(System.UInt16[])?text=GetTriangleIndices, and then an updated vertex buffer each frame by calling GetVertexStateForPose. With these buffers, you can render a live visualization of the user's hand.

The hand mesh's index buffer will not change for the lifetime of the HandMeshObserver. The hand mesh's vertex buffer contents will be updated each frame, while the vertex count will not. You can therefore refill the same vertex buffer every frame.

You create a HandMeshObserver for a given interaction source by calling SpatialInteractionSource.TryCreateHandMeshObserverAsync or SpatialInteractionSource.TryCreateHandMeshObserver. It can take more than a frame to initialize the app's subscription to hand mesh updates. You should only call the synchronous version of the method from a background thread. If you are calling from a UI thread, render thread or update thread, you should call the asynchronous version instead.


ModelId ModelId ModelId ModelId ModelId

Gets a hand mesh model ID to identify the same index buffer across multiple source detection and loss events.

NeutralPose NeutralPose NeutralPose NeutralPose NeutralPose

Gets the current neutral HandPose for this hand.

NeutralPoseVersion NeutralPoseVersion NeutralPoseVersion NeutralPoseVersion NeutralPoseVersion

Gets the version of the NeutralPose for this hand.

Source Source Source Source Source

The SpatialInteractionSource whose hand mesh is tracked by this HandMeshObserver.

TriangleIndexCount TriangleIndexCount TriangleIndexCount TriangleIndexCount TriangleIndexCount

Gets the number of elements in the index buffer for this hand mesh model.

VertexCount VertexCount VertexCount VertexCount VertexCount

Gets the count of vertices for this hand.


GetTriangleIndices(UInt16[]) GetTriangleIndices(UInt16[]) GetTriangleIndices(UInt16[]) GetTriangleIndices(UInt16[]) GetTriangleIndices(UInt16[])

Fills an index buffer for this hand mesh model.

GetVertexStateForPose(HandPose) GetVertexStateForPose(HandPose) GetVertexStateForPose(HandPose) GetVertexStateForPose(HandPose) GetVertexStateForPose(HandPose)

Gets the vertex buffer and other state needed to render the hand mesh for a given frame's hand pose, or for the hand mesh's neutral pose.