본문 바로가기

Technical Artists/Houdini
[Houdini] 방향 정리하기 (normal, up, axis 등)

// normal, up 사용

1. normal vector, up vector 정의

2. maketransform으로 transform matrix 정의

3@prep_orient = maketransform(nor,up);
matrix3 prep_orient = maketransform(nor, up);


3. quaternion으로 orient 4원수 정의

 p@orient = quaternion(@prep_orient);


// angle(radian), axis 사용

① degree로 입력받기
1. float angle(degree), vector axis 정의

2. quaternion으로 orient 4원수 정의(degree를 radian으로 변환해야 함)

 p@orient = quaternion(radians(angle), axis);

② 바퀴수로 입력받기

1. float angle(바퀴수), vector axis 정의 > 바퀴수에 360을 곱해야 함

float angle = chf("turns") * 360;
vector axis = chv("axis");


2. quaternion으로 orient 4원수 정의(degree를 radian으로 변환해야 함)

p@orient = quaternion(radians(angle), axis);

// axis
- X축 좌 ↔ 우    : pitch (앞뒤로 숙이기)
- Y축 위 ↔ 아래 : yaw (좌우로 고개 돌리기)
- Z축 앞 ↔ 뒤     : roll (고개를 좌우로 기울이기)