---
title: "spatialLocation(ofIndex:)"
framework: modelio
role: symbol
role_heading: Instance Method
path: "modelio/mdlvoxelarray/spatiallocation(ofindex:)"
---

# spatialLocation(ofIndex:)

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

## Declaration

```swift
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

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

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:) initializer, the bounding box specified at initialization.

## See Also

### Relating Voxels to Scene Space

- [boundingBox](modelio/mdlvoxelarray/boundingbox.md)
- [index(ofSpatialLocation:)](modelio/mdlvoxelarray/index(ofspatiallocation:).md)
- [voxelBoundingBox(atIndex:)](modelio/mdlvoxelarray/voxelboundingbox(atindex:).md)
