From 7a239fc7f02570faf526a3872f5c123e9e1536e9 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Tue, 16 Apr 2013 20:25:08 -0700 Subject: [PATCH] Small tweaks to initial values for offset camera, so people can make sense of it --- interface/src/Camera.cpp | 2 +- interface/src/main.cpp | 28 ++++++++++++---------------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/interface/src/Camera.cpp b/interface/src/Camera.cpp index ef7943d8f3..320acca51d 100644 --- a/interface/src/Camera.cpp +++ b/interface/src/Camera.cpp @@ -13,7 +13,7 @@ Camera::Camera() { _mode = CAMERA_MODE_THIRD_PERSON; _tightness = DEFAULT_CAMERA_TIGHTNESS; _fieldOfView = 60.0; // default - _nearClip = 0.01; // default + _nearClip = 0.08; // default _farClip = 50.0; // default _yaw = 0.0; _pitch = 0.0; diff --git a/interface/src/main.cpp b/interface/src/main.cpp index 05ab585e12..df0707518a 100644 --- a/interface/src/main.cpp +++ b/interface/src/main.cpp @@ -520,12 +520,12 @@ int frustumDrawingMode = FRUSTUM_DRAW_MODE_ALL; // the mode we're drawing the bool frustumOn = false; // Whether or not to display the debug view frustum bool cameraFrustum = true; // which frustum to look at -bool viewFrustumFromOffset=false; // Wether or not to offset the view of the frustum -float viewFrustumOffsetYaw = -90.0; // the following variables control yaw, pitch, roll and distance form regular -float viewFrustumOffsetPitch = 7.5; // camera to the offset camera -float viewFrustumOffsetRoll = 0.0; -float viewFrustumOffsetDistance = 0.0; -float viewFrustumOffsetUp = 0.0; +bool viewFrustumFromOffset =false; // Wether or not to offset the view of the frustum +float viewFrustumOffsetYaw = -135.0; // the following variables control yaw, pitch, roll and distance form regular +float viewFrustumOffsetPitch = 0.0; // camera to the offset camera +float viewFrustumOffsetRoll = 0.0; +float viewFrustumOffsetDistance = 25.0; +float viewFrustumOffsetUp = 0.0; void render_view_frustum() { @@ -747,24 +747,20 @@ void display(void) Camera viewFrustumOffsetCamera = myCamera; if (::viewFrustumFromOffset && ::frustumOn) { - //---------------------------------------------------- + // set the camera to third-person view but offset so we can see the frustum - //---------------------------------------------------- - viewFrustumOffsetCamera.setYaw ( 180.0 - myAvatar.getBodyYaw() + ::viewFrustumOffsetYaw ); - viewFrustumOffsetCamera.setPitch ( 0.0 + ::viewFrustumOffsetPitch ); - viewFrustumOffsetCamera.setRoll ( 0.0 + ::viewFrustumOffsetRoll ); - viewFrustumOffsetCamera.setUp ( 0.2 + ::viewFrustumOffsetUp ); - viewFrustumOffsetCamera.setDistance ( 0.5 + ::viewFrustumOffsetDistance ); + viewFrustumOffsetCamera.setYaw ( 180.0 - myAvatar.getBodyYaw() + ::viewFrustumOffsetYaw ); + viewFrustumOffsetCamera.setPitch ( ::viewFrustumOffsetPitch ); + viewFrustumOffsetCamera.setRoll ( ::viewFrustumOffsetRoll ); + viewFrustumOffsetCamera.setUp ( ::viewFrustumOffsetUp ); + viewFrustumOffsetCamera.setDistance ( ::viewFrustumOffsetDistance ); viewFrustumOffsetCamera.update(1.f/FPS); whichCamera = viewFrustumOffsetCamera; } - //--------------------------------------------- // transform view according to whichCamera // could be myCamera (if in normal mode) // or could be viewFrustumOffsetCamera if in offset mode - //--------------------------------------------- - // I changed the ordering here - roll is FIRST (JJV) glRotatef ( whichCamera.getRoll(), 0, 0, 1 ); glRotatef ( whichCamera.getPitch(), 1, 0, 0 );