---
title: "convertVector(_:to:)"
framework: scenekit
role: symbol
role_heading: Instance Method
path: "scenekit/scnnode/convertvector(_:to:)"
---

# convertVector(_:to:)

Converts a direction vector from the node’s local coordinate space to that of another node.

## Declaration

```swift
func convertVector(_ vector: SCNVector3, to node: SCNNode?) -> SCNVector3
```

## Parameters

- `vector`: A direction vector in the node’s local coordinate space.
- `node`: Another node in the same scene graph as the node, or nil to convert to the scene’s world coordinate space.

## Return Value

Return Value A direction vector in the local coordinate space defined by the other node.

## Discussion

Discussion Unlike the convertPosition(_:to:) method, this method ignores the translational aspect of both nodes’ transforms. As such, this method is more appropriate for use with vectors that represent only directional information, such as velocity or facing.

## See Also

### Related Documentation

- [simdConvertVector(_:to:)](scenekit/scnnode/simdconvertvector(_:to:).md)

### Converting Between Coordinate Spaces (SceneKit Types)

- [convertPosition(_:from:)](scenekit/scnnode/convertposition(_:from:).md)
- [convertPosition(_:to:)](scenekit/scnnode/convertposition(_:to:).md)
- [convertTransform(_:from:)](scenekit/scnnode/converttransform(_:from:).md)
- [convertTransform(_:to:)](scenekit/scnnode/converttransform(_:to:).md)
- [convertVector(_:from:)](scenekit/scnnode/convertvector(_:from:).md)
