3D 시력을 시뮬레이트하기 위해 각 눈에 하나씩 두 개의 동영상을 스트리밍하는 Google 골판지 용 앱을 개발 중입니다. 나는 각 프레임에 적용될 양안 왜곡을 시뮬레이트하기 위해 google vr sdk만을 사용하려고하지만 실제로는 왜곡을 적용하는 this example에서 명확하지 않습니다. 이 예제에서 google vr은 양안 왜곡을 적용합니까?
/**
* Draws a frame for an eye.
*
* @param eye The eye to render. Includes all required transformations.
*/
@Override
public void onDrawEye(Eye eye) {
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);
...
// Apply the eye transformation to the camera.
Matrix.multiplyMM(mView, 0, eye.getEyeView(), 0, mCamera, 0);
// Set the position of the light
Matrix.multiplyMV(mLightPosInEyeSpace, 0, mView, 0, LIGHT_POS_IN_WORLD_SPACE, 0);
// Build the ModelView and ModelViewProjection matrices
// for calculating cube position and light.
float[] perspective = eye.getPerspective(Z_NEAR, Z_FAR);
Matrix.multiplyMM(mModelView, 0, mView, 0, mModelCube, 0);
Matrix.multiplyMM(mModelViewProjection, 0, perspective, 0, mModelView, 0);
drawCube();
// Draw the rest of the scene.
...
}
이 코드
은과 같이 설명되어 있습니다 :- 보물 눈 공간으로 제공 :
이 이벤트의 순서입니다.
- 투영 행렬을 적용합니다. 지정된 눈에 렌더링 된 장면을 제공합니다.
- Google VR SDK는 자동으로 왜곡을 적용하여 최종 장면을 렌더링합니다.
그러나이 세 번째 단계는 실제로 설명되지 않습니다. 실사 영상을 사용하여 렌더링 및 이미지를 제작하지 않기 때문에 왜곡이 적용되는 코드 부분 만 사용해야하지만이 문제가 얼마나 정확한지는 분명하지 않습니다.
아무도 아이디어가있는 경우 알려 주시기 바랍니다.