docs.unity.cn
    Show / Hide Table of Contents

    Class Projection

    Contains functions for projecting 3D points to 2D space.

    Inheritance
    Object
    Projection
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEngine.ProBuilder
    Syntax
    public static class Projection

    Methods

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

    Finds the plane that best fits the specified 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, this method considers only the vertices referenced by this array.

    Returns
    Type Description
    Plane

    The 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>)

    Projects a collection of 3D positions to a 2D plane. This method uses FindBestPlane(IList<Vector3>, IList<Int32>) to calculate the direction from which the vertices are projected.

    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

    A collection of indices to project. The returned array matches the length of this collection.

    Returns
    Type Description
    Vector2[]

    The positions array projected into 2D coordinates.

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

    Projects a collection of 3D positions to a 2D plane in the specified direction.

    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 matches the length of this collection.

    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
    Generated by DocFX
    on Tuesday, June 13, 2023