<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/ClothMeshResource/position(at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:22RealityFoundationCloth0C12MeshResourceC8position2ats5SIMD3VySfGs6UInt32V_tF"
  },
  "title" : "position(at:)"
}
-->

# position(at:)

Returns the position of the vertex at the given index.

```
final func position(at vertexIndex: UInt32) -> SIMD3<Float>
```

## Parameters

`vertexIndex`

Index of the vertex to get the position for.

## Return Value

The position of the specified vertex.

## Discussion

If you want to obtain the position for a specific vertex within a specific primitive (for example the third
vertex of the 20th triangle in a triangle mesh), you can use
[`vertexIndex(at:)`](/documentation/RealityKit/ClothMeshResource/vertexIndex(at:)) to obtain the right vertex index:

```swift
let vertexIndex = myMesh.vertexIndex(at: 3 * 19 + 2)
let vertexPosition = myMesh.position(at: vertexIndex)
print("The third vertex of the 20th triangle is at X=\(vertexPosition.x)")
```

> Warning: This returned position corresponds to the mesh used to generate the bodies,
> rather than the bodies themselves. Therefore, this position does not change as the body deforms
> when this resource is used in ``doc://com.apple.RealityKit/documentation/RealityKit/ClothBodyComponent/mesh``.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)