Changeset 525 for trunk/VUT/GtpVisibilityPreprocessor/src/GlRenderer.cpp
- Timestamp:
- 01/12/06 14:27:18 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/GlRenderer.cpp
r524 r525 53 53 static void handleCgError() 54 54 { 55 fprintf(stderr, "Cg error: %s\n", cgGetErrorString(cgGetError()));55 Debug << "Cg error: " << cgGetErrorString(cgGetError()) << endl; 56 56 exit(1); 57 57 } … … 639 639 { 640 640 // 1. setup the view port to match the desired samples 641 glViewport(0, 0, desiredSamples, desiredSamples); 642 641 643 // 2. setup the projection matrix and view matrix to match the viewpoint + beam.mDirBox 642 644 SetupProjectionForViewPoint(viewPoint, beam, sourceObject); 645 643 646 // 3. reset z-buffer to 0 and render the source object for the beam 644 647 // with glCullFace(Enabled) and glFrontFace(GL_CW) … … 740 743 { 741 744 glBeginOcclusionQueryNV(sQueries[queryIdx ++]); 742 745 743 746 RenderIntersectable(*vit); 744 747 745 748 glEndOcclusionQueryNV(); 746 749 } … … 785 788 } 786 789 } 790 791 void GlRendererBuffer::SetupProjectionForViewPoint(const Vector3 &viewPoint, 792 const Beam &beam, 793 Intersectable *sourceObject) 794 { 795 float left, right, bottom, top, znear, zfar; 796 797 beam.ComputeFrustum(left, right, bottom, top, znear, zfar, 798 mSceneGraph->GetBox()); 799 800 glFrustum(left, right, bottom, top, znear, zfar); 801 802 const Vector3 eye = viewPoint + beam.GetMainDirection; 803 const Vector3 up = AbitraryNormal(eye); 804 805 gluLookAt(eye, viewPoint, up); 806 }
Note: See TracChangeset
for help on using the changeset viewer.