Contents

MeshDescriptor

Defines a 3D mesh’s structure and data.

Declaration

struct MeshDescriptor

Overview

Create or modify 3D shapes in a RealityKit scene using MeshDescriptor, which provides properties and methods to define the vertices, normals, texture coordinates, and other attributes of the mesh.

Apply the mesh to an Entity by creating a MeshResource with MeshResource/generate(from:)-6l1q2, and create a ModelComponent with init(mesh:materials:).

Start by creating a basic triangle with a MeshDescriptor instance.

var descriptor = MeshDescriptor(name: "triangle")
descriptor.positions = MeshBuffers.Positions([
    [-1, -1, 0], [1, -1, 0], [0, 1, 0]
])
descriptor.primitives = .triangles([0, 1, 2])

Topics

Initializers

Instance Properties

Enumerations

See Also

Static meshes