Contents

unproject(_:ontoPlane:)

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

Declaration

@MainActor @preconcurrency func unproject(_ point: CGPoint, ontoPlane planeTransform: float4x4) -> SIMD3<Float>?

Parameters

  • point:

    The point in the view’s coordinate system.

  • planeTransform:

    A transform used to define the coordinate system of the plane. The positive y-axis is taken as the normal of the plane.

Return Value

The 3D position in world coordinates, or nil if the mapping isn’t possible.

See Also

Mapping between coordinate spaces