Class Projection | ProBuilder | 4.3.1
docs.unity3d.com
    Show / Hide Table of Contents

    Class Projection

    Functions for projecting 3d points to 2d space.

    Inheritance
    Object
    Projection
    Namespace: UnityEngine.ProBuilder
    Syntax
    public static class Projection

    Methods

    FindBestPlane(IList<Vector3>, IList<Int32>)

    Find a plane that best fits a set of 3d points.

    Declaration
    public static Plane FindBestPlane(IList<Vector3> points, IList<int> indexes = null)
    Parameters
    Type Name Description
    IList<Vector3> points

    The points to find a plane for. Order does not matter.

    IList<Int32> indexes

    If provided, only the vertices referenced by the indexes array will be considered.

    Returns
    Type Description
    Plane

    A plane that best matches the layout of the points array.

    Remarks

    http://www.ilikebigbits.com/blog/2015/3/2/plane-from-points

    PlanarProject(IList<Vector3>, IList<Int32>)

    Project a collection of 3d positions to a 2d plane. The direction from which the vertices are projected is calculated using FindBestPlane(IList<Vector3>, IList<Int32>).

    Declaration
    public static Vector2[] PlanarProject(IList<Vector3> positions, IList<int> indexes = null)
    Parameters
    Type Name Description
    IList<Vector3> positions

    A collection of positions to project based on a direction.

    IList<Int32> indexes
    Returns
    Type Description
    Vector2[]

    The positions array projected into 2d coordinates.

    PlanarProject(IList<Vector3>, IList<Int32>, Vector3)

    Project a collection of 3d positions to a 2d plane.

    Declaration
    public static Vector2[] PlanarProject(IList<Vector3> positions, IList<int> indexes, Vector3 direction)
    Parameters
    Type Name Description
    IList<Vector3> positions

    A collection of positions to project based on a direction.

    IList<Int32> indexes

    A collection of indices to project. The returned array will match the length of indices.

    Vector3 direction

    The direction from which vertex positions are projected into 2d space.

    Returns
    Type Description
    Vector2[]

    The positions array projected into 2d coordinates.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023