MAX 뷰포트 쉐이더에서 텍스쳐 W 로테이션 값을 조정하기
출처 쉐이더 FX
float2 rotateUVs(float2 Texcoords, float2 center, float theta) {
// compute sin and cos for this angle
float2 sc;
sincos( (theta/180.0f*3.14159f), sc.x, sc.y );
// pi to dgree
//sincos(x,s,c) : sin(x)와 cos(x)를 동시에 s, c로 리턴한다. 여기서 s, c는 x와 동일한 차원의 타입이어야 한다.
// move the rotation center to the origin : 중점이동
float2 uv = Texcoords - center;
// rotate the uv : 기본 UV 좌표와의 dot연산
float2 rotateduv;
rotateduv.x = dot( uv, float2( sc.y, -sc.x ) );
rotateduv.y = dot( uv, sc.xy );
// move the uv’s back to the correct place
rotateduv += center;
return rotateduv;
}