Search code examples
globallocalscenekitcoordinate

Convert local coordinates to scene coordinates in SceneKit


I have a node attached to a node and I want to convert it's coordinates to coordinates of scene. I really don't know how to do that. I've been searching on Apple's documentation and I haven't found a method that fits my need. Any suggestions?


Solution

  • SCNNode exposes the following methods to convert between coordinate spaces:

    -convertPosition:fromNode:
    -convertPosition:toNode:
    -convertTransform:fromNode:
    -convertTransform:toNode: