Instance Method

unproject(_:viewport:)

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

Declaration

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

Parameters

point

A point in viewport.

viewport

A viewport.

Return Value

A view-space 3D coordinate.

See Also

Mapping Between Coordinate Spaces

func project(SIMD3<Float>) -> CGPoint?

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

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 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.