- position为 virtual_pos = glm::inverse(vrdriver->HMDPoseInverse * model)[3];
- forward为 virtual_forward = -glm::inverse(vrdriver->HMDPoseInverse * model)[2];
- mat4 tmp = vrdriver->HMDPoseInverse;
- projection = vrdriver->GetHMDMatrixProjectionEye(vr::Hmd_Eye::Eye_Left, NEAR_PLANE, FAR_PLANE);
eyeMat = vrdriver->GetHMDMatrixPoseEye(vr::Hmd_Eye::Eye_Left);
view = eyeMat * tmp; -
使用翻转代替teleportation :if (vrdriver->press_button) {
frame_flag = 8;model = glm::translate(glm::mat4(1.0f), glm::vec3(-camera_pos.x, 0.0f, -camera_pos.z)) * model;
model = glm::rotate(glm::mat4(1.0f), glm::radians(180.0f), glm::vec3(0.0f, 1.0f, 0.0f))* model;
model = glm::translate(glm::mat4(1.0f), glm::vec3(camera_pos.x, 0.0f, camera_pos.z)) * model;/*model = glm::translate(model, glm::vec3(-camera_pos.x, 0.0f, -camera_pos.z));
model = glm::rotate(model, glm::radians(180.0f), glm::vec3(0.0f, 1.0f, 0.0f));
model = glm::translate(model, glm::vec3(camera_pos.x, 0.0f, camera_pos.z));*/vrdriver->press_button = false;
}
关于OpenVr中的参数问题
最新推荐文章于 2024-03-20 09:57:03 发布