Pivot 수정방법

2011. 5. 3. 08:47C# And Unity


기본적인 유니티코리아에서의 답변은 아래와 같습니다.

=========================================================================================
가장 추천하는 방법은 3D 모델링 어플리케이션에서 모델의 피벗을 조정하여 가져오는 것입니다. 

유니티 내에서 수정하는 방법은 아래와 같습니다. 
1. GameObject->Create Empty 메뉴를 사용하여 빈 게임오브젝트를 생성합니다. 
2. 새로운 게임오브젝트를 오브젝트기 회전하기를 원하는 곳에 위치시킵니다. 
3. 메쉬를 빈 게임오브젝트 위로 끌어다 놓습니다. 
=========================================================================================

해외 사이트에서 찾아본 결과 Change an object's pivot point? 란 질문으로 올라왔더군요.
다양한 답변이 있었는데 대부분 MAX등 3D모델링 어플리케이션으로 수정하란 말이 있더군요.

=========================================================================================
1)Create a new blank object in your scene, give it a name like "WackoPivotPoint"
2)Put that object just where you want the pivot point to be, for the errent model
3)Now make this new blank object a Child of the errent model
4)whenever you want to rotate the errent model in script, 
  use the "find" function from the errent model's transform. 
  find the child transform by name. In this case 

 Code:
 pivot = errentModel.transform.Find("WackoPivotPoint");

5)Next use the RotateAround function to, well, do just that. in this case 

 Code:
 errentModel.transform.RotateAround(pivot.position, Vector3.up,20);

the following code uses a child transform called "SelectorPivot" to rotate around by 20 degrees

 Code:
 var pivot : Transform = transform.Find("SelectorPivot");
 this.transform.RotateAround(pivot.position, Vector3.up, -20);
=========================================================================================

이답변은 위방법과 동일한 방법 같더군요. 
(ps. unifycommunity wiki 페이지네요 => http://www.unifycommunity.com/wiki/)

다른분이 새로운 방법이라고 올리신 내용이 있는데 아직 익숙하지 않아서인지 이해하기 힘들더군요.
http://solvethesystem.wordpress.com/setpivot/