docs.unity3d.com
    Show / Hide Table of Contents

    Class VisualizationHelper

    Helper class that contains common visualization methods useful to ground truth labelers.

    Inheritance
    Object
    VisualizationHelper
    Namespace: UnityEngine.Perception.GroundTruth
    Syntax
    public static class VisualizationHelper : object

    Methods

    ConvertToScreenSpace(Camera, Vector3)

    Converts a 3D world space coordinate to image pixel space.

    Declaration
    public static Vector3 ConvertToScreenSpace(Camera camera, Vector3 worldLocation)
    Parameters
    Type Name Description
    Camera camera

    The rendering camera

    Vector3 worldLocation

    The 3D world location to convert

    Returns
    Type Description
    Vector3

    The coordinate in pixel space

    DrawLine(Single, Single, Single, Single, Color, Single, Texture)

    Draw's a texture between two locations of a passed in width.

    Declaration
    public static void DrawLine(float p1X, float p1Y, float p2X, float p2Y, Color color, float width = 3F, Texture texture = null)
    Parameters
    Type Name Description
    Single p1X

    The start point's x coordinate in pixel space

    Single p1Y

    The start point's y coordinate in pixel space

    Single p2X

    The end point's x coordinate in pixel space

    Single p2Y

    The end point's y coordinate in pixel space

    Color color

    The color of the line

    Single width

    The width of the line

    Texture texture

    The texture to use, if null, will draw a solid line of passed in color

    DrawLine(Vector2, Vector2, Color, Single, Texture)

    Draw's a texture between two locations of a passed in width.

    Declaration
    public static void DrawLine(Vector2 p1, Vector2 p2, Color color, float width = 3F, Texture texture = null)
    Parameters
    Type Name Description
    Vector2 p1

    The start point in pixel space

    Vector2 p2

    The end point in pixel space

    Color color

    The color of the line

    Single width

    The width of the line

    Texture texture

    The texture to use, if null, will draw a solid line of passed in color

    DrawPoint(Single, Single, Color, Single, Texture)

    Draw a point (in pixel space) on the screen

    Declaration
    public static void DrawPoint(float x, float y, Color color, float width = null, Texture texture = null)
    Parameters
    Type Name Description
    Single x

    The point's x value, in pixel space

    Single y

    The point's y value, in pixel space

    Color color

    The color of the point

    Single width

    The width of the point

    Texture texture

    The texture to use for the point, defaults to a solid pixel

    DrawPoint(Vector3, Color, Single, Texture)

    Draw a point (in pixel space) on the screen

    Declaration
    public static void DrawPoint(Vector3 pt, Color color, float width = 4F, Texture texture = null)
    Parameters
    Type Name Description
    Vector3 pt

    The point location, in pixel space

    Color color

    The color of the point

    Single width

    The width of the point

    Texture texture

    The texture to use for the point, defaults to a solid pixel

    Back to top
    Terms of use
    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