휴대 전화를 다른 방향으로 기울여서 다각형의 다른면을 만들 수있는 간단한 자이로 테스트 앱을 작성하고 있습니다. 이것은 머리 추적 렌더링 기법과 비슷하지만 고정 된 눈 위치를 가정하고 휴대 전화 만 눈 (카메라)에 상대적으로 움직입니다.왼쪽/오른쪽 방향으로 기울어 진 절두체가있는 Android OpenGL 문제
이렇게하려면 필자는 opengl에서 왜곡 된 절두체 트릭을 사용했습니다. 위/아래/가까운/먼 방향의 절두체를 문제없이 오프셋 할 수 있습니다. 정말 기이 한 부분은 오프셋 값을 2로 나누면 왼쪽/오른쪽 방향 만 작동하면 나타납니다. 절두체를 실제로 '축소해야'합니다.
// xEyePhone is the transform of eye relative to the screen, note the /2.0f for the 3rd and 4th params.
Matrix.frustumM(_ProjMatrix, 0, -ratio-xEyePhone[12]/2.0f, ratio-xEyePhone[12]/2.0f, 1-xEyePhone[13], 1-xEyePhone[13], xEyePhone[14], xEyePhone[14]+10);
Matrix.setLookAtM(_VMatrix, 0, xEyePhone[12], xEyePhone[13], xEyePhone[14],
XEyeCenterWorld[12], xEyeCenterWorld[13], xEyeCenterWorld[14],
XUpVectorWorld[12], xUpVectorWorld[13], xUpVectorWorld[14]);
사람이 건너 온 : 여기
는 왼쪽/오른쪽 방향으로 2 분주 버그와 함께 작업 예제 코드?
관련 항목 : http://stackoverflow.com/questions/11697728/why-does-the-matrix-generated-by-androids-frustumm-differ-from-the-redbooks –