Ignore:
Timestamp:
01/12/06 14:27:18 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/GlRenderer.cpp

    r524 r525  
    5353static void handleCgError()  
    5454{ 
    55     fprintf(stderr, "Cg error: %s\n", cgGetErrorString(cgGetError())); 
     55    Debug << "Cg error: " << cgGetErrorString(cgGetError()) << endl; 
    5656    exit(1); 
    5757} 
     
    639639{ 
    640640        // 1. setup the view port to match the desired samples 
     641        glViewport(0, 0, desiredSamples, desiredSamples); 
     642 
    641643        // 2. setup the projection matrix and view matrix to match the viewpoint + beam.mDirBox 
    642    
     644        SetupProjectionForViewPoint(viewPoint, beam, sourceObject); 
     645         
    643646        // 3. reset z-buffer to 0 and render the source object for the beam 
    644647        //    with glCullFace(Enabled) and glFrontFace(GL_CW) 
     
    740743        { 
    741744                glBeginOcclusionQueryNV(sQueries[queryIdx ++]); 
    742    
     745 
    743746                RenderIntersectable(*vit); 
    744    
     747                 
    745748                glEndOcclusionQueryNV(); 
    746749        } 
     
    785788        } 
    786789} 
     790 
     791void 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.