좌표계의 축을 내 장면으로 렌더링하려고 할 때 현재 일부 문제가 있습니다. 이러한 축의 경우 3D 큐브의 중심을 지나는 3 개의 직선을 그립니다. 문제가 무엇인지 설명하는 것은 꽤 힘듭니다. 따라서 사진을 게시하는 가장 시범적인 방법은 사진을 게시하는 것입니다.Perspective OpenGL의 3D 좌표계 문제
전체 장면 1)보기 : click here
2) 좌표계의 원점에보기 확대 : 나는 더 작은 조금 확대하면 click here
3)의 두 축이 사라지고 어떤 이유로 인해 다른 축이 이동 한 것으로 보입니다. click here
왜 이런 일이 발생하며 어떻게 방지 할 수 있습니까?
내 모델 뷰 및 프로젝션 행렬은 다음과 같은 모양 "클리핑"라고
// Set ProjectionMatrix
projectionMatrix = glm::perspective(90.0f, (GLfloat)width/(GLfloat) height, 0.0001f, 1000.f);
glBindBuffer(GL_UNIFORM_BUFFER, globalMatricesUBO);
glBufferSubData(GL_UNIFORM_BUFFER, 0, sizeof(glm::mat4), glm::value_ptr(projectionMatrix));
glBindBuffer(GL_UNIFORM_BUFFER, 0);
// Set ModelViewMatrix
glm::mat4 identity = glm::mat4(1.0); // Start with the identity as the transformation matrix
glm::mat4 pointTranslateZ = glm::translate(identity, glm::vec3(0.0f, 0.0f, -translate_z)); // Zoom in or out by translating in z-direction based on user input
glm::mat4 viewRotateX = glm::rotate(pointTranslateZ, rotate_x, glm::vec3(1.0f, 0.0f, 0.0f)); // Rotate the whole szene in x-direction based on user input
glm::mat4 viewRotateY = glm::rotate(viewRotateX, rotate_y, glm::vec3(0.0f, 1.0f, 0.0f)); // Rotate the whole szene in y-direction based on user input
glm::mat4 pointRotateX = glm::rotate(viewRotateY, -90.0f, glm::vec3(1.0f, 0.0f, 0.0f)); // Rotate the camera by 90 degrees in negative x-direction to get a frontal look on the szene
glm::mat4 viewTranslate = glm::translate(pointRotateX, glm::vec3(-dimensionX/2.0f, -dimensionY/2.0f, -dimensionZ/2.0f)); // Translate the origin to be the center of the cube
Frustrum culling? – Alexander
2 축이 사라지는 이유를 설명하겠습니까? 하지만 왜 조금 더 확대해도 세 번째 이미지의 다른 이미지가 완전히 왜곡 된 이유는 무엇입니까? – Schnigges
어쩌면 그것의 일부가 렌더링되고 당신은 친밀감 때문에 부자연 스럽다고 생각할 수 있습니다. – Alexander