docs.unity.cn
    Show / Hide Table of Contents

    Method LookAt

    LookAt(float3, float3, float3)

    Returns a float4x4 view matrix given an eye position, a target point and a unit length up vector. The up vector is assumed to be unit length, the eye and target points are assumed to be distinct and the vector between them is assumes to be collinear with the up vector. If these assumptions are not met use float4x4.LookRotationSafe instead.

    Declaration
    public static float4x4 LookAt(float3 eye, float3 target, float3 up)
    Parameters
    Type Name Description
    float3 eye

    The eye position.

    float3 target

    The view target position.

    float3 up

    The eye up direction.

    Returns
    Type Description
    float4x4

    The float4x4 view matrix.

    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Tuesday, March 29, 2022
    Terms of use