2017-04-22 7 views
0

기본적으로 modelInstance는 중심 (0,0,0)만큼 회전되며, (0,2,2)만큼 회전하려고합니다. 다른 게임 엔진에서는 model.setRotationPivot(float)과 같은 메서드가 있다는 것을 알고 있습니다. 비슷한 방법이 libgdx에 있습니까?libgdx - 모델 회전 피벗을 설정하는 방법?

// how to set rotation pivot? 
modelInstance.transform.set(position, rotation, scale); 

고마워요!

+0

텍스처를 회전하고 싶습니까? 그게 당신이 요구하는 것입니까? –

+0

@JasonSingh, 3D 모델을 회전하고 싶습니다. – akabc

답변

0

늦게 답변 :

피벗을 설정할 방법이 없습니다. 이에 대한 해결 방법을 사용합니다.

Vector3 vec3 = new Vector3(0, 2, 2); 
vec3.rotate(Vector3.Y, rotation); 
modelInstance.transform.setToTranslation(vec3); 
this.transform.rotate(Vector3.Y, rotation);