<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ModelIO",
  "identifier" : "/documentation/ModelIO/MDLVoxelArray/spatialLocation(ofIndex:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Model I/O"
    ],
    "preciseIdentifier" : "c:objc(cs)MDLVoxelArray(im)spatialLocationOfIndex:"
  },
  "title" : "spatialLocation(ofIndex:)"
}
-->

# spatialLocation(ofIndex:)

Returns the location of the specified voxel in world coordinate space.

```
func spatialLocation(ofIndex index: MDLVoxelIndex) -> vector_float3
```

## Parameters

`index`

An index describing the location of a voxel within the three-dimensional grid of the voxel array. (The w component is ignored for this query.)

## Return Value

The center point for the single voxel at the specified location, in the world coordinate space of the asset from which the voxel array was created.

## Discussion

The coordinate space for spatial locations of voxels is the world space of the asset from which the voxel array was created, or for voxel arrays created with the [`init(data:boundingBox:voxelExtent:)`](/documentation/ModelIO/MDLVoxelArray/init(data:boundingBox:voxelExtent:)) initializer, the bounding box specified at initialization.

---

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)