{!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 노드 | Shader Graph | 10.8.0
docs.unity3d.com
"{0}"의 검색 결과

    목차 표시/숨기기

    Rotate 노드

    설명

    Rotation 입력 값만큼 Center 입력에서 정의된 레퍼런스 점을 중심으로 UV 입력 값을 회전시킵니다. 회전 각도의 단위는 Unit 파라미터를 사용하여 선택할 수 있습니다.

    포트

    이름 방향 Type 바인딩 설명
    UV 입력 벡터 2 UV 입력 UV 값
    Center 입력 벡터 2 None 회전할 센터 포인트
    Rotation 입력 플로트 None 적용할 회전 양
    Out 출력 벡터 2 None 출력 UV 값

    컨트롤

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

    생성된 코드 예제

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

    Radians

    void Unity_Rotate_Radians_float(float2 UV, float2 Center, float Rotation, out float2 Out)
    {
        UV -= Center;
        float s = sin(Rotation);
        float c = cos(Rotation);
        float2x2 rMatrix = float2x2(c, -s, s, c);
        rMatrix *= 0.5;
        rMatrix += 0.5;
        rMatrix = rMatrix * 2 - 1;
        UV.xy = mul(UV.xy, rMatrix);
        UV += Center;
        Out = UV;
    }
    

    Degrees

    void Unity_Rotate_Degrees_float(float2 UV, float2 Center, float Rotation, out float2 Out)
    {
        Rotation = Rotation * (3.1415926f/180.0f);
        UV -= Center;
        float s = sin(Rotation);
        float c = cos(Rotation);
        float2x2 rMatrix = float2x2(c, -s, s, c);
        rMatrix *= 0.5;
        rMatrix += 0.5;
        rMatrix = rMatrix * 2 - 1;
        UV.xy = mul(UV.xy, rMatrix);
        UV += Center;
        Out = UV;
    }
    
    문서 개요
    맨 위로
    Copyright © 2023 Unity Technologies — 상표 및 이용약관
    • 법률정보
    • 개인정보처리방침
    • 쿠키
    • 내 개인정보 판매 금지
    • Your Privacy Choices (Cookie Settings)