Instance Method


Projects a point from the 3D world coordinate system of the scene to the 2D pixel coordinate system of the view.


func project(_ point: SIMD3<Float>) -> CGPoint?



The point in 3D world coordinates.

Return Value

A point in the view’s coordinate space.

See Also

Mapping Between Coordinate Spaces

func unproject(CGPoint, ontoPlane: float4x4) -> SIMD3<Float>?

Maps a 2D point from the view’s coordinate system onto the given plane in 3D space.

func unproject(CGPoint, viewport: CGRect) -> SIMD3<Float>?

Maps a 2D point from the pixel coordinate system of a viewport into a 3D coordinate space.

func ray(through: CGPoint) -> (origin: SIMD3<Float>, direction: SIMD3<Float>)?

Determines the position and direction of a ray through the given point in the 2D space of the view.