mirror of
https://github.com/overte-org/overte.git
synced 2025-08-05 05:50:19 +02:00
Removed frustum display in preview mode
This commit is contained in:
parent
f21a2798ff
commit
229821e211
1 changed files with 0 additions and 98 deletions
|
@ -135,105 +135,7 @@ void GLWidget::paintGL() {
|
|||
glEnd();
|
||||
|
||||
glScalef(1.0f / TREE_SCALE, 1.0f / TREE_SCALE, 1.0f / TREE_SCALE);
|
||||
|
||||
_voxelSystem->render(false);
|
||||
|
||||
|
||||
ViewFrustum& viewFrustum = *Application::getInstance()->getSharedVoxelSystem()->getViewFrustum();
|
||||
glm::vec3 position = viewFrustum.getOffsetPosition();
|
||||
glm::vec3 direction = viewFrustum.getOffsetDirection();
|
||||
glm::vec3 up = viewFrustum.getOffsetUp();
|
||||
glm::vec3 right = viewFrustum.getOffsetRight();
|
||||
|
||||
// Calculate the origin direction vectors
|
||||
glm::vec3 lookingAt = position + (direction * 0.2f);
|
||||
glm::vec3 lookingAtUp = position + (up * 0.2f);
|
||||
glm::vec3 lookingAtRight = position + (right * 0.2f);
|
||||
|
||||
glBegin(GL_LINES);
|
||||
// Looking At = white
|
||||
glColor3d(1.0f, 1.0f, 1.0f);
|
||||
glVertex3d(position.x, position.y, position.z);
|
||||
glVertex3d(lookingAt.x, lookingAt.y, lookingAt.z);
|
||||
|
||||
// Looking At Up = purple
|
||||
glColor3d(1.0f, 0.0f, 1.0f);
|
||||
glVertex3d(position.x, position.y, position.z);
|
||||
glVertex3d(lookingAtUp.x, lookingAtUp.y, lookingAtUp.z);
|
||||
|
||||
// Looking At Right = cyan
|
||||
glColor3d(0.0f, 1.0f, 1.0f);
|
||||
glVertex3d(position.x, position.y, position.z);
|
||||
glVertex3d(lookingAtRight.x, lookingAtRight.y, lookingAtRight.z);
|
||||
|
||||
|
||||
// Drawing the bounds of the frustum
|
||||
// viewFrustum.getNear plane - bottom edge
|
||||
glColor3d(1.0f, 0.0f, 0.0f);
|
||||
glVertex3d(viewFrustum.getNearBottomLeft().x, viewFrustum.getNearBottomLeft().y, viewFrustum.getNearBottomLeft().z);
|
||||
glVertex3d(viewFrustum.getNearBottomRight().x, viewFrustum.getNearBottomRight().y, viewFrustum.getNearBottomRight().z);
|
||||
|
||||
// viewFrustum.getNear plane - top edge
|
||||
glVertex3d(viewFrustum.getNearTopLeft().x, viewFrustum.getNearTopLeft().y, viewFrustum.getNearTopLeft().z);
|
||||
glVertex3d(viewFrustum.getNearTopRight().x, viewFrustum.getNearTopRight().y, viewFrustum.getNearTopRight().z);
|
||||
|
||||
// viewFrustum.getNear plane - right edge
|
||||
glVertex3d(viewFrustum.getNearBottomRight().x, viewFrustum.getNearBottomRight().y, viewFrustum.getNearBottomRight().z);
|
||||
glVertex3d(viewFrustum.getNearTopRight().x, viewFrustum.getNearTopRight().y, viewFrustum.getNearTopRight().z);
|
||||
|
||||
// viewFrustum.getNear plane - left edge
|
||||
glVertex3d(viewFrustum.getNearBottomLeft().x, viewFrustum.getNearBottomLeft().y, viewFrustum.getNearBottomLeft().z);
|
||||
glVertex3d(viewFrustum.getNearTopLeft().x, viewFrustum.getNearTopLeft().y, viewFrustum.getNearTopLeft().z);
|
||||
|
||||
|
||||
// viewFrustum.getFar plane - bottom edge
|
||||
glColor3d(0.0f, 1.0f, 0.0f); // GREEN!!!
|
||||
glVertex3d(viewFrustum.getFarBottomLeft().x, viewFrustum.getFarBottomLeft().y, viewFrustum.getFarBottomLeft().z);
|
||||
glVertex3d(viewFrustum.getFarBottomRight().x, viewFrustum.getFarBottomRight().y, viewFrustum.getFarBottomRight().z);
|
||||
|
||||
// viewFrustum.getFar plane - top edge
|
||||
glVertex3d(viewFrustum.getFarTopLeft().x, viewFrustum.getFarTopLeft().y, viewFrustum.getFarTopLeft().z);
|
||||
glVertex3d(viewFrustum.getFarTopRight().x, viewFrustum.getFarTopRight().y, viewFrustum.getFarTopRight().z);
|
||||
|
||||
// viewFrustum.getFar plane - right edge
|
||||
glVertex3d(viewFrustum.getFarBottomRight().x, viewFrustum.getFarBottomRight().y, viewFrustum.getFarBottomRight().z);
|
||||
glVertex3d(viewFrustum.getFarTopRight().x, viewFrustum.getFarTopRight().y, viewFrustum.getFarTopRight().z);
|
||||
|
||||
// viewFrustum.getFar plane - left edge
|
||||
glVertex3d(viewFrustum.getFarBottomLeft().x, viewFrustum.getFarBottomLeft().y, viewFrustum.getFarBottomLeft().z);
|
||||
glVertex3d(viewFrustum.getFarTopLeft().x, viewFrustum.getFarTopLeft().y, viewFrustum.getFarTopLeft().z);
|
||||
|
||||
// RIGHT PLANE IS CYAN
|
||||
// right plane - bottom edge - viewFrustum.getNear to distant
|
||||
glColor3d(0.0f, 1.0f, 1.0f);
|
||||
glVertex3d(viewFrustum.getNearBottomRight().x, viewFrustum.getNearBottomRight().y, viewFrustum.getNearBottomRight().z);
|
||||
glVertex3d(viewFrustum.getFarBottomRight().x, viewFrustum.getFarBottomRight().y, viewFrustum.getFarBottomRight().z);
|
||||
|
||||
// right plane - top edge - viewFrustum.getNear to distant
|
||||
glVertex3d(viewFrustum.getNearTopRight().x, viewFrustum.getNearTopRight().y, viewFrustum.getNearTopRight().z);
|
||||
glVertex3d(viewFrustum.getFarTopRight().x, viewFrustum.getFarTopRight().y, viewFrustum.getFarTopRight().z);
|
||||
|
||||
// LEFT PLANE IS BLUE
|
||||
// left plane - bottom edge - viewFrustum.getNear to distant
|
||||
glColor3d(0.0f, 0.0f, 1.0f);
|
||||
glVertex3d(viewFrustum.getNearBottomLeft().x, viewFrustum.getNearBottomLeft().y, viewFrustum.getNearBottomLeft().z);
|
||||
glVertex3d(viewFrustum.getFarBottomLeft().x, viewFrustum.getFarBottomLeft().y, viewFrustum.getFarBottomLeft().z);
|
||||
|
||||
// left plane - top edge - viewFrustum.getNear to distant
|
||||
glVertex3d(viewFrustum.getNearTopLeft().x, viewFrustum.getNearTopLeft().y, viewFrustum.getNearTopLeft().z);
|
||||
glVertex3d(viewFrustum.getFarTopLeft().x, viewFrustum.getFarTopLeft().y, viewFrustum.getFarTopLeft().z);
|
||||
glEnd();
|
||||
|
||||
// Draw the keyhole
|
||||
float keyholeRadius = viewFrustum.getKeyholeRadius();
|
||||
if (keyholeRadius > 0.0f) {
|
||||
glPushMatrix();
|
||||
glColor3d(1.0f, 1.0f, 0.0f);
|
||||
glTranslatef(position.x, position.y, position.z); // where we actually want it!
|
||||
glutWireSphere(keyholeRadius, 20, 20);
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue