History

Merge pull request #49 from ZappoMan/view_frustum_work

Latest view frustum work

Philip Rosedale committed 13 years ago

Commit 1cdeac02 parents 1e38834 246380b5 files · +346 −225Browse files

Showing the changes to interface/src/main.cpp (1 of 5 files). Show all

Unified · Split

interface/src/main.cpp+164−85
@@ -79,6 +79,9 @@ · 78 unmodified lines
7979
8080 using namespace std;
8181
82+void reshape(int width, int height); // will be defined below
83+
84+
8285 pthread_t networkReceiveThread;
8386 bool stopNetworkReceiveThread = false;
8487
@@ -97,10 +100,13 @@ bool wantColorRandomizer = true; // for addSphere and load file · 12 unmodified lines
97100
98101 Oscilloscope audioScope(256,200,true);
99102
100−Head myAvatar; // The rendered avatar of oneself
101−Camera myCamera; // My view onto the world (sometimes on myself :)
103+ViewFrustum viewFrustum; // current state of view frustum, perspective, orientation, etc.
104+
105+Head myAvatar; // The rendered avatar of oneself
106+Camera myCamera; // My view onto the world (sometimes on myself :)
107+Camera viewFrustumOffsetCamera; // The camera we use to sometimes show the view frustum from an offset mode
102108
103− // Starfield information
109+// Starfield information
104110 char starFile[] = "https://s3-us-west-1.amazonaws.com/highfidelity/stars.txt";
105111 FieldOfView fov;
106112 Stars stars;
@@ -528,39 +534,57 @@ float viewFrustumOffsetUp = 0.0; · 421 unmodified lines
528534
529535 void render_view_frustum() {
530536
531− glm::vec3 cameraPosition = ::myCamera.getPosition();
532− glm::vec3 headPosition = ::myAvatar.getHeadPosition();
533−
534− glm::vec3 cameraDirection = ::myCamera.getOrientation().getFront() * glm::vec3(1,1,-1);
535− glm::vec3 headDirection = myAvatar.getHeadLookatDirection(); // direction still backwards
536−
537− glm::vec3 cameraUp = myCamera.getOrientation().getUp() * glm::vec3(1,1,1);
538− glm::vec3 headUp = myAvatar.getHeadLookatDirectionUp();
539−
540− glm::vec3 cameraRight = myCamera.getOrientation().getRight() * glm::vec3(1,1,-1);
541− glm::vec3 headRight = myAvatar.getHeadLookatDirectionRight() * glm::vec3(-1,1,-1); // z is flipped!
542−
543537 // We will use these below, from either the camera or head vectors calculated above
544538 glm::vec3 position;
545539 glm::vec3 direction;
546540 glm::vec3 up;
547541 glm::vec3 right;
542+ float fov, nearClip, farClip;
548543
549544 // Camera or Head?
550545 if (::cameraFrustum) {
551− position = cameraPosition;
552− direction = cameraDirection;
553− up = cameraUp;
554− right = cameraRight;
546+ position = ::myCamera.getPosition();
547+ direction = ::myCamera.getOrientation().getFront() * glm::vec3(1,1,-1);
548+ up = ::myCamera.getOrientation().getUp() * glm::vec3(1,1,1);
549+ right = ::myCamera.getOrientation().getRight() * glm::vec3(1,1,-1);
550+ fov = ::myCamera.getFieldOfView();
551+ nearClip = ::myCamera.getNearClip();
552+ farClip = ::myCamera.getFarClip();
555553 } else {
556− position = headPosition;
557− direction = headDirection;
558− up = headUp;
559− right = headRight;
554+ position = ::myAvatar.getHeadPosition();
555+ direction = ::myAvatar.getHeadLookatDirection();
556+ up = ::myAvatar.getHeadLookatDirectionUp();
557+ right = ::myAvatar.getHeadLookatDirectionRight() * glm::vec3(-1,1,-1);
558+
559+ // NOTE: we use the same lens details if we draw from the head
560+ fov = ::myCamera.getFieldOfView();
561+ nearClip = ::myCamera.getNearClip();
562+ farClip = ::myCamera.getFarClip();
560563 }
561−
564+
565+ /*
566+ printf("position.x=%f, position.y=%f, position.z=%f\n", position.x, position.y, position.z);
567+ printf("direction.x=%f, direction.y=%f, direction.z=%f\n", direction.x, direction.y, direction.z);
568+ printf("up.x=%f, up.y=%f, up.z=%f\n", up.x, up.y, up.z);
569+ printf("right.x=%f, right.y=%f, right.z=%f\n", right.x, right.y, right.z);
570+ printf("fov=%f\n", fov);
571+ printf("nearClip=%f\n", nearClip);
572+ printf("farClip=%f\n", farClip);
573+ */
574+
575+ // Set the viewFrustum up with the correct position and orientation of the camera
576+ viewFrustum.setPosition(position);
577+ viewFrustum.setOrientation(direction,up,right);
578+
579+ // Also make sure it's got the correct lens details from the camera
580+ viewFrustum.setFieldOfView(fov);
581+ viewFrustum.setNearClip(nearClip);
582+ viewFrustum.setFarClip(farClip);
583+
562584 // Ask the ViewFrustum class to calculate our corners
563− ViewFrustum vf(position,direction,up,right,::WIDTH,::HEIGHT);
585+ viewFrustum.calculate();
586+
587+ //viewFrustum.dump();
564588
565589 // Get ready to draw some lines
566590 glDisable(GL_LIGHTING);
@@ -593,64 +617,64 @@ void render_view_frustum() { · 26 unmodified lines
593617 if (::frustumDrawingMode == FRUSTUM_DRAW_MODE_ALL || ::frustumDrawingMode == FRUSTUM_DRAW_MODE_PLANES
594618 || ::frustumDrawingMode == FRUSTUM_DRAW_MODE_NEAR_PLANE) {
595619 // Drawing the bounds of the frustum
596− // vf.getNear plane - bottom edge
620+ // viewFrustum.getNear plane - bottom edge
597621 glColor3f(1,0,0);
598− glVertex3f(vf.getNearBottomLeft().x, vf.getNearBottomLeft().y, vf.getNearBottomLeft().z);
599− glVertex3f(vf.getNearBottomRight().x, vf.getNearBottomRight().y, vf.getNearBottomRight().z);
622+ glVertex3f(viewFrustum.getNearBottomLeft().x, viewFrustum.getNearBottomLeft().y, viewFrustum.getNearBottomLeft().z);
623+ glVertex3f(viewFrustum.getNearBottomRight().x, viewFrustum.getNearBottomRight().y, viewFrustum.getNearBottomRight().z);
600624
601− // vf.getNear plane - top edge
602− glVertex3f(vf.getNearTopLeft().x, vf.getNearTopLeft().y, vf.getNearTopLeft().z);
603− glVertex3f(vf.getNearTopRight().x, vf.getNearTopRight().y, vf.getNearTopRight().z);
625+ // viewFrustum.getNear plane - top edge
626+ glVertex3f(viewFrustum.getNearTopLeft().x, viewFrustum.getNearTopLeft().y, viewFrustum.getNearTopLeft().z);
627+ glVertex3f(viewFrustum.getNearTopRight().x, viewFrustum.getNearTopRight().y, viewFrustum.getNearTopRight().z);
604628
605− // vf.getNear plane - right edge
606− glVertex3f(vf.getNearBottomRight().x, vf.getNearBottomRight().y, vf.getNearBottomRight().z);
607− glVertex3f(vf.getNearTopRight().x, vf.getNearTopRight().y, vf.getNearTopRight().z);
629+ // viewFrustum.getNear plane - right edge
630+ glVertex3f(viewFrustum.getNearBottomRight().x, viewFrustum.getNearBottomRight().y, viewFrustum.getNearBottomRight().z);
631+ glVertex3f(viewFrustum.getNearTopRight().x, viewFrustum.getNearTopRight().y, viewFrustum.getNearTopRight().z);
608632
609− // vf.getNear plane - left edge
610− glVertex3f(vf.getNearBottomLeft().x, vf.getNearBottomLeft().y, vf.getNearBottomLeft().z);
611− glVertex3f(vf.getNearTopLeft().x, vf.getNearTopLeft().y, vf.getNearTopLeft().z);
633+ // viewFrustum.getNear plane - left edge
634+ glVertex3f(viewFrustum.getNearBottomLeft().x, viewFrustum.getNearBottomLeft().y, viewFrustum.getNearBottomLeft().z);
635+ glVertex3f(viewFrustum.getNearTopLeft().x, viewFrustum.getNearTopLeft().y, viewFrustum.getNearTopLeft().z);
612636 }
613637
614638 if (::frustumDrawingMode == FRUSTUM_DRAW_MODE_ALL || ::frustumDrawingMode == FRUSTUM_DRAW_MODE_PLANES
615639 || ::frustumDrawingMode == FRUSTUM_DRAW_MODE_FAR_PLANE) {
616− // vf.getFar plane - bottom edge
640+ // viewFrustum.getFar plane - bottom edge
617641 glColor3f(0,1,0); // GREEN!!!
618− glVertex3f(vf.getFarBottomLeft().x, vf.getFarBottomLeft().y, vf.getFarBottomLeft().z);
619− glVertex3f(vf.getFarBottomRight().x, vf.getFarBottomRight().y, vf.getFarBottomRight().z);
642+ glVertex3f(viewFrustum.getFarBottomLeft().x, viewFrustum.getFarBottomLeft().y, viewFrustum.getFarBottomLeft().z);
643+ glVertex3f(viewFrustum.getFarBottomRight().x, viewFrustum.getFarBottomRight().y, viewFrustum.getFarBottomRight().z);
620644
621− // vf.getFar plane - top edge
622− glVertex3f(vf.getFarTopLeft().x, vf.getFarTopLeft().y, vf.getFarTopLeft().z);
623− glVertex3f(vf.getFarTopRight().x, vf.getFarTopRight().y, vf.getFarTopRight().z);
645+ // viewFrustum.getFar plane - top edge
646+ glVertex3f(viewFrustum.getFarTopLeft().x, viewFrustum.getFarTopLeft().y, viewFrustum.getFarTopLeft().z);
647+ glVertex3f(viewFrustum.getFarTopRight().x, viewFrustum.getFarTopRight().y, viewFrustum.getFarTopRight().z);
624648
625− // vf.getFar plane - right edge
626− glVertex3f(vf.getFarBottomRight().x, vf.getFarBottomRight().y, vf.getFarBottomRight().z);
627− glVertex3f(vf.getFarTopRight().x, vf.getFarTopRight().y, vf.getFarTopRight().z);
649+ // viewFrustum.getFar plane - right edge
650+ glVertex3f(viewFrustum.getFarBottomRight().x, viewFrustum.getFarBottomRight().y, viewFrustum.getFarBottomRight().z);
651+ glVertex3f(viewFrustum.getFarTopRight().x, viewFrustum.getFarTopRight().y, viewFrustum.getFarTopRight().z);
628652
629− // vf.getFar plane - left edge
630− glVertex3f(vf.getFarBottomLeft().x, vf.getFarBottomLeft().y, vf.getFarBottomLeft().z);
631− glVertex3f(vf.getFarTopLeft().x, vf.getFarTopLeft().y, vf.getFarTopLeft().z);
653+ // viewFrustum.getFar plane - left edge
654+ glVertex3f(viewFrustum.getFarBottomLeft().x, viewFrustum.getFarBottomLeft().y, viewFrustum.getFarBottomLeft().z);
655+ glVertex3f(viewFrustum.getFarTopLeft().x, viewFrustum.getFarTopLeft().y, viewFrustum.getFarTopLeft().z);
632656 }
633657
634658 if (::frustumDrawingMode == FRUSTUM_DRAW_MODE_ALL || ::frustumDrawingMode == FRUSTUM_DRAW_MODE_PLANES) {
635659 // RIGHT PLANE IS CYAN
636− // right plane - bottom edge - vf.getNear to distant
660+ // right plane - bottom edge - viewFrustum.getNear to distant
637661 glColor3f(0,1,1);
638− glVertex3f(vf.getNearBottomRight().x, vf.getNearBottomRight().y, vf.getNearBottomRight().z);
639− glVertex3f(vf.getFarBottomRight().x, vf.getFarBottomRight().y, vf.getFarBottomRight().z);
662+ glVertex3f(viewFrustum.getNearBottomRight().x, viewFrustum.getNearBottomRight().y, viewFrustum.getNearBottomRight().z);
663+ glVertex3f(viewFrustum.getFarBottomRight().x, viewFrustum.getFarBottomRight().y, viewFrustum.getFarBottomRight().z);
640664
641− // right plane - top edge - vf.getNear to distant
642− glVertex3f(vf.getNearTopRight().x, vf.getNearTopRight().y, vf.getNearTopRight().z);
643− glVertex3f(vf.getFarTopRight().x, vf.getFarTopRight().y, vf.getFarTopRight().z);
665+ // right plane - top edge - viewFrustum.getNear to distant
666+ glVertex3f(viewFrustum.getNearTopRight().x, viewFrustum.getNearTopRight().y, viewFrustum.getNearTopRight().z);
667+ glVertex3f(viewFrustum.getFarTopRight().x, viewFrustum.getFarTopRight().y, viewFrustum.getFarTopRight().z);
644668
645669 // LEFT PLANE IS BLUE
646− // left plane - bottom edge - vf.getNear to distant
670+ // left plane - bottom edge - viewFrustum.getNear to distant
647671 glColor3f(0,0,1);
648− glVertex3f(vf.getNearBottomLeft().x, vf.getNearBottomLeft().y, vf.getNearBottomLeft().z);
649− glVertex3f(vf.getFarBottomLeft().x, vf.getFarBottomLeft().y, vf.getFarBottomLeft().z);
672+ glVertex3f(viewFrustum.getNearBottomLeft().x, viewFrustum.getNearBottomLeft().y, viewFrustum.getNearBottomLeft().z);
673+ glVertex3f(viewFrustum.getFarBottomLeft().x, viewFrustum.getFarBottomLeft().y, viewFrustum.getFarBottomLeft().z);
650674
651− // left plane - top edge - vf.getNear to distant
652− glVertex3f(vf.getNearTopLeft().x, vf.getNearTopLeft().y, vf.getNearTopLeft().z);
653− glVertex3f(vf.getFarTopLeft().x, vf.getFarTopLeft().y, vf.getFarTopLeft().z);
675+ // left plane - top edge - viewFrustum.getNear to distant
676+ glVertex3f(viewFrustum.getNearTopLeft().x, viewFrustum.getNearTopLeft().y, viewFrustum.getNearTopLeft().z);
677+ glVertex3f(viewFrustum.getFarTopLeft().x, viewFrustum.getFarTopLeft().y, viewFrustum.getFarTopLeft().z);
654678 }
655679
656680 glEnd();
@@ -660,8 +684,6 @@ void render_view_frustum() { · 3 unmodified lines
660684
661685 void display(void)
662686 {
663− //printf( "avatar head lookat = %f, %f, %f\n", myAvatar.getAvatarHeadLookatDirection().x, myAvatar.getAvatarHeadLookatDirection().y, myAvatar.getAvatarHeadLookatDirection().z );
664−
665687 PerfStat("display");
666688
667689 glEnable(GL_LINE_SMOOTH);
@@ -708,13 +730,14 @@ void display(void) · 40 unmodified lines
708730 //----------------------------------------------------
709731 myCamera.setTargetPosition ( myAvatar.getPos() );
710732 myCamera.setYaw ( 180.0 - myAvatar.getBodyYaw() );
711− myCamera.setPitch ( 10.0 );
733+ myCamera.setPitch ( 0.0 ); // temporarily, this must be 0.0 or else bad juju
712734 myCamera.setRoll ( 0.0 );
713735 myCamera.setUp ( 0.45 );
714736 myCamera.setDistance ( 0.5 );
715737 myCamera.setTightness ( 10.0f );
716738 myCamera.update ( 1.f/FPS );
717739 }
740+
718741 // Note: whichCamera is used to pick between the normal camera myCamera for our
719742 // main camera, vs, an alternate camera. The alternate camera we support right now
720743 // is the viewFrustumOffsetCamera. But theoretically, we could use this same mechanism
@@ -725,21 +748,20 @@ void display(void) · 4 unmodified lines
725748 // myCamera is. But we also want to do meaningful camera transforms on OpenGL for the offset camera
726749 Camera whichCamera = myCamera;
727750 Camera viewFrustumOffsetCamera = myCamera;
728−
751+
729752 if (::viewFrustumFromOffset && ::frustumOn) {
730753 //----------------------------------------------------
731754 // set the camera to third-person view but offset so we can see the frustum
732755 //----------------------------------------------------
733756 viewFrustumOffsetCamera.setYaw ( 180.0 - myAvatar.getBodyYaw() + ::viewFrustumOffsetYaw );
734− viewFrustumOffsetCamera.setPitch ( 0.0 + ::viewFrustumOffsetPitch );
735− viewFrustumOffsetCamera.setRoll ( 0.0 + ::viewFrustumOffsetRoll );
736− viewFrustumOffsetCamera.setUp ( 0.2 + 0.2 );
737− viewFrustumOffsetCamera.setDistance( 0.5 + 0.2 );
738− viewFrustumOffsetCamera.update( 1.f/FPS );
739−
757+ viewFrustumOffsetCamera.setPitch ( 0.0 + ::viewFrustumOffsetPitch );
758+ viewFrustumOffsetCamera.setRoll ( 0.0 + ::viewFrustumOffsetRoll );
759+ viewFrustumOffsetCamera.setUp ( 0.2 + ::viewFrustumOffsetUp );
760+ viewFrustumOffsetCamera.setDistance ( 0.5 + ::viewFrustumOffsetDistance );
761+ viewFrustumOffsetCamera.update(1.f/FPS);
740762 whichCamera = viewFrustumOffsetCamera;
741763 }
742−
764+
743765 //---------------------------------------------
744766 // transform view according to whichCamera
745767 // could be myCamera (if in normal mode)
@@ -750,6 +772,8 @@ void display(void) · 4 unmodified lines
750772 glRotatef ( whichCamera.getRoll(), 0, 0, 1 );
751773 glTranslatef( -whichCamera.getPosition().x, -whichCamera.getPosition().y, -whichCamera.getPosition().z );
752774
775+
776+
753777 if (::starsOn) {
754778 // should be the first rendering pass - w/o depth buffer / lighting
755779 stars.render(fov);
@@ -966,7 +990,14 @@ int setDisplayFrustum(int state) { · 210 unmodified lines
966990 }
967991
968992 int setFrustumOffset(int state) {
969− return setValue(state, &::viewFrustumFromOffset);
993+ int value = setValue(state, &::viewFrustumFromOffset);
994+
995+ // reshape so that OpenGL will get the right lens details for the camera of choice
996+ if (state == MENU_ROW_PICKED) {
997+ reshape(::WIDTH,::HEIGHT);
998+ }
999+
1000+ return value;
9701001 }
9711002
9721003 int setFrustumOrigin(int state) {
@@ -1026,12 +1057,13 @@ void initMenu() { · 53 unmodified lines
10261057 menuColumnOptions->addRow("(V)oxels", setVoxels);
10271058 menuColumnOptions->addRow("Stars (*)", setStars);
10281059 menuColumnOptions->addRow("(Q)uit", quitApp);
1060+
10291061 // Tools
10301062 menuColumnTools = menu.addColumn("Tools");
10311063 menuColumnTools->addRow("Stats (/)", setStats);
10321064 menuColumnTools->addRow("(M)enu", setMenu);
10331065
1034− // Debug
1066+ // Frustum Options
10351067 menuColumnFrustum = menu.addColumn("Frustum");
10361068 menuColumnFrustum->addRow("Display (F)rustum", setDisplayFrustum);
10371069 menuColumnFrustum->addRow("Use (O)ffset Camera", setFrustumOffset);
@@ -1187,7 +1219,7 @@ void key(unsigned char k, int x, int y) · 149 unmodified lines
11871219 if (k == 'V' || k == 'v') ::showingVoxels = !::showingVoxels; // toggle voxels
11881220 if (k == 'F') ::frustumOn = !::frustumOn; // toggle view frustum debugging
11891221 if (k == 'C') ::cameraFrustum = !::cameraFrustum; // toggle which frustum to look at
1190− if (k == 'O' || k == 'G') ::viewFrustumFromOffset = !::viewFrustumFromOffset; // toggle view frustum offset debugging
1222+ if (k == 'O' || k == 'G') setFrustumOffset(MENU_ROW_PICKED); // toggle view frustum offset debugging
11911223
11921224 if (k == '[') ::viewFrustumOffsetYaw -= 0.5;
11931225 if (k == ']') ::viewFrustumOffsetYaw += 0.5;
@@ -1199,8 +1231,10 @@ void key(unsigned char k, int x, int y) · 5 unmodified lines
11991231 if (k == '>') ::viewFrustumOffsetDistance += 0.5;
12001232 if (k == ',') ::viewFrustumOffsetUp -= 0.05;
12011233 if (k == '.') ::viewFrustumOffsetUp += 0.05;
1202− if (k == '|') ViewFrustum::fovAngleAdust -= 0.05;
1203− if (k == '\\') ViewFrustum::fovAngleAdust += 0.05;
1234+
1235+// if (k == '|') ViewFrustum::fovAngleAdust -= 0.05;
1236+// if (k == '\\') ViewFrustum::fovAngleAdust += 0.05;
1237+
12041238 if (k == 'R') setFrustumRenderMode(MENU_ROW_PICKED);
12051239
12061240 if (k == '&') {
@@ -1359,27 +1393,66 @@ void idle(void) { · 152 unmodified lines
13591393 }
13601394
13611395
1362−
13631396 void reshape(int width, int height)
13641397 {
13651398 WIDTH = width;
13661399 HEIGHT = height;
1400+ float aspectRatio = ((float)width/(float)height); // based on screen resize
1401+
1402+ float fov;
1403+ float nearClip;
1404+ float farClip;
1405+
1406+ // get the lens details from the current camera
1407+ if (::viewFrustumFromOffset) {
1408+ fov = ::viewFrustumOffsetCamera.getFieldOfView();
1409+ nearClip = ::viewFrustumOffsetCamera.getNearClip();
1410+ farClip = ::viewFrustumOffsetCamera.getFarClip();
1411+ } else {
1412+ fov = ::myCamera.getFieldOfView();
1413+ nearClip = ::myCamera.getNearClip();
1414+ farClip = ::myCamera.getFarClip();
1415+ }
13671416
1417+ //printf("reshape() width=%d, height=%d, aspectRatio=%f fov=%f near=%f far=%f \n",
1418+ // width,height,aspectRatio,fov,nearClip,farClip);
1419+
1420+ // Tell our viewFrustum about this change
1421+ ::viewFrustum.setAspectRatio(aspectRatio);
1422+
1423+
1424+ glViewport(0, 0, width, height); // shouldn't this account for the menu???
13681425
13691426 glMatrixMode(GL_PROJECTION); //hello
1370− fov.setResolution(width, height)
1371− .setBounds(glm::vec3(-0.5f,-0.5f,-500.0f), glm::vec3(0.5f, 0.5f, 0.1f) )
1372− .setPerspective(0.7854f);
1373− glLoadMatrixf(glm::value_ptr(fov.getViewerScreenXform()));
13741427
1428+ // XXXBHG - Note: this is Tobias's code for loading the perspective matrix. At Philip's suggestion, I'm removing
1429+ // it and putting back our old code that simply loaded the fov, ratio, and near/far clips. But I'm keeping this here
1430+ // for reference for now.
1431+ //fov.setResolution(width, height)
1432+ // .setBounds(glm::vec3(-0.5f,-0.5f,-500.0f), glm::vec3(0.5f, 0.5f, 0.1f) )
1433+ // .setPerspective(0.7854f);
1434+ //glLoadMatrixf(glm::value_ptr(fov.getViewerScreenXform()));
1435+
1436+ glLoadIdentity();
1437+
1438+ // XXXBHG - If we're in view frustum mode, then we need to do this little bit of hackery so that
1439+ // OpenGL won't clip our frustum rendering lines. This is a debug hack for sure! Basically, this makes
1440+ // the near clip a little bit closer (therefor you see more) and the far clip a little bit farther (also,
1441+ // to see more.)
1442+ if (::frustumOn) {
1443+ nearClip -= 0.01f;
1444+ farClip += 0.01f;
1445+ }
1446+
1447+ // On window reshape, we need to tell OpenGL about our new setting
1448+ gluPerspective(fov,aspectRatio,nearClip,farClip);
1449+
13751450 glMatrixMode(GL_MODELVIEW);
13761451 glLoadIdentity();
13771452
1378− glViewport(0, 0, width, height);
1453+
13791454 }
13801455
1381−
1382−
13831456 void mouseFunc( int button, int state, int x, int y )
13841457 {
13851458 if( button == GLUT_LEFT_BUTTON && state == GLUT_DOWN )
@@ -1469,6 +1542,12 @@ int main(int argc, const char * argv[]) · 83 unmodified lines
14691542 #ifdef _WIN32
14701543 glewInit();
14711544 #endif
1545+
1546+ // Before we render anything, let's set up our viewFrustumOffsetCamera with a sufficiently large
1547+ // field of view and near and far clip to make it interesting.
1548+ //viewFrustumOffsetCamera.setFieldOfView(90.0);
1549+ viewFrustumOffsetCamera.setNearClip(0.1);
1550+ viewFrustumOffsetCamera.setFarClip(500.0);
14721551
14731552 printf( "Created Display Window.\n" );
14741553