Instance Method

projectPoint:

Projects a point from the 3D world coordinate system of the SceneKit scene to the 2D viewport coordinate system of the SpriteKit node.

Declaration

- (vector_float3)projectPoint:(vector_float3)point;

Parameters

point

A point in the world coordinate system of the Scene Kit scene.

Return Value

The corresponding point in the SpriteKit node’s coordinate system.

Discussion

The z-coordinate of the returned point describes the depth of the projected point relative to the near and far clipping planes of the viewing frustum (defined by the pointOfView property). Projecting a point on the near clipping plane returns a point whose z-coordinate is 0.0; projecting a point on the far clipping plane returns a point whose z-coordinate is 1.0.

See Also

Projecting Points and Performing Hit-Testing

- hitTest:options:

Searches the Scene Kit scene for objects corresponding to a point in the rendered image.

- unprojectPoint:

Unprojects a point from the SpriteKit node’s 2D viewport coordinate system to the 3D world coordinate system of the SceneKit scene.