1
oculus로 응용 프로그램을 작성하고 있는데 카메라 설정에 문제가 있습니다. 모든 것이 잘 때로는 잘 작동합니다. 카메라가 흔들 리기 시작하고 우리가보고있는 모델이 흔들리는 것처럼 보입니다. 누구나 지금까지 똑같은 문제가 있습니까? Oculus Rift를 사용할 때 떨리는 카메라
코드
다음과 같이 카메라 행렬이 업데이트 전망 : WDM (Windows 바탕 화면 관리자) 문제를 일으키는// Concatentaion of both the given navigator and the position tracking
OSG::Matrix4f m;
// If a navigator is given, we attach to it
if (navigator) {
m = navigator->getMatrix();
}
// apply position/rotation as obtained from tracking
OSG::Matrix4f trans;
trans.setTranslate(ovr2osg(headPose.Position));
trans.setRotate(ovr2osg(headPose.Orientation));
m.mult(trans);
// compute modelview matrix for player
OSG::Matrix4f modelview;
player->setMatrix(m);
playerNode->getToWorld(modelview);
modelview.invert();
for (int i = 0; i < ovrEye_Count; ++i) {
// The player node acts as the beacon for our stereo setup.
// Basd on the modelview matrix of the player, we
// now compute the viewing matrix for each eye, which
// basically corresponds a small shift to account for eye separation.
OSG::Matrix4f view(modelview);
// The overall shift is determined by the IPD (Interpupillary
// distance): To account for the IPD we just translate the viewing
// matrix by the viewing adjust vector as reported by the oculus SDK.
// NOTE: The Left-handed (!) multiplication is crucial
const OSG::Matrix4f &adjust = ovr2osg(OVR::Matrix4f::Translation(eyeRenderDesc[i].ViewAdjust));
view.multLeft(adjust);
// We use the projection matrices as supplied by the oculus SDK.
const OSG::Matrix4f &proj = ovr2osg(projection[i]);
// Finally, set the computed viewing/projection matrices
camera[i]->setModelviewMatrix(view);
camera[i]->setProjectionMatrix(proj);
}
OSG::Thread::getCurrentChangeList()->commitChanges();