{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Rotate About Axis 노드 | Shader Graph | 10.8.0
docs.unity3d.com
"{0}"의 검색 결과

    목차 표시/숨기기

    Rotate About Axis 노드

    설명

    Rotation 값만큼 Axis 축을 중심으로 In 입력 벡터를 회전시킵니다. 회전 각도의 단위는 Unit 파라미터를 사용하여 선택할 수 있습니다.

    포트

    이름 방향 Type 바인딩 설명
    In 입력 벡터 3 None 입력 값
    축 입력 벡터 3 None 회전할 축
    Rotation 입력 플로트 None 적용할 회전 양
    Out 출력 벡터 3 None 출력 값

    컨트롤

    이름 Type 옵션 설명
    Unit 드롭다운 Radians, Degrees Rotation 입력의 단위를 전환합니다.

    생성된 코드 예제

    다음 예제 코드는 Unit 모드에 대한 이 노드의 가능한 결과 중 하나입니다.

    Radians

    void Unity_RotateAboutAxis_Radians_float(float3 In, float3 Axis, float Rotation, out float3 Out)
    {
        float s = sin(Rotation);
        float c = cos(Rotation);
        float one_minus_c = 1.0 - c;
    
        Axis = normalize(Axis);
        float3x3 rot_mat = 
        {   one_minus_c * Axis.x * Axis.x + c, one_minus_c * Axis.x * Axis.y - Axis.z * s, one_minus_c * Axis.z * Axis.x + Axis.y * s,
            one_minus_c * Axis.x * Axis.y + Axis.z * s, one_minus_c * Axis.y * Axis.y + c, one_minus_c * Axis.y * Axis.z - Axis.x * s,
            one_minus_c * Axis.z * Axis.x - Axis.y * s, one_minus_c * Axis.y * Axis.z + Axis.x * s, one_minus_c * Axis.z * Axis.z + c
        };
        Out = mul(rot_mat,  In);
    }
    

    Degrees

    void Unity_RotateAboutAxis_Degrees_float(float3 In, float3 Axis, float Rotation, out float3 Out)
    {
        Rotation = radians(Rotation);
        float s = sin(Rotation);
        float c = cos(Rotation);
        float one_minus_c = 1.0 - c;
    
        Axis = normalize(Axis);
        float3x3 rot_mat = 
        {   one_minus_c * Axis.x * Axis.x + c, one_minus_c * Axis.x * Axis.y - Axis.z * s, one_minus_c * Axis.z * Axis.x + Axis.y * s,
            one_minus_c * Axis.x * Axis.y + Axis.z * s, one_minus_c * Axis.y * Axis.y + c, one_minus_c * Axis.y * Axis.z - Axis.x * s,
            one_minus_c * Axis.z * Axis.x - Axis.y * s, one_minus_c * Axis.y * Axis.z + Axis.x * s, one_minus_c * Axis.z * Axis.z + c
        };
        Out = mul(rot_mat,  In);
    }
    
    문서 개요
    맨 위로
    Copyright © 2023 Unity Technologies — 상표 및 이용약관
    • 법률정보
    • 개인정보처리방침
    • 쿠키
    • 내 개인정보 판매 금지
    • Your Privacy Choices (Cookie Settings)