Ignore:
Timestamp:
06/22/08 09:23:45 (16 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Bvh.cpp

    r2795 r2796  
    141141        mGeometrySize = entities.size(); 
    142142        mGeometry = new SceneEntity*[mGeometrySize]; 
    143          
     143 
    144144        mBox.Initialize(); 
    145145 
     
    153153        } 
    154154 
    155         cout << "scene box: " << mBox << endl; 
     155        //cout << "scene box: " << mBox << endl; 
    156156} 
    157157 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/BvhLoader.cpp

    r2795 r2796  
    9494        cout << "... finished loading " << bvh->mNumNodes << " nodes, updating boxes" << endl; 
    9595 
     96        bvh->mBox = bvh->mRoot->GetBox(); 
     97 
     98        cout << "scene box: " << bvh->mBox << endl; 
     99 
    96100        /////////// 
    97101        //-- post process nodes 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Camera.cpp

    r2787 r2796  
    77{ 
    88 
     9using namespace std; 
     10 
    911 
    1012Camera::Camera()  
     
    1214        mWidth = 100; 
    1315        mHeight = 100; 
    14         mFovy = 90.0f * M_PI / 180.0f; 
     16        mFovy = 60.0f * M_PI / 180.0f; 
     17        mIsOrtho = false; 
     18         
     19        SetPosition(Vector3(0, 0, 0)); 
     20 
     21        mPitch = mYaw = 0; 
     22        Precompute(Vector3(0, 1, 0)); 
    1523} 
    1624 
     
    2230         
    2331        mFovy = fieldOfView * M_PI / 180.0f; 
    24 } 
    25  
    26  
    27 void Camera::Precompute()  
    28 { 
    29         mDirection.Normalize(); 
    30  
    31         /*Vector3 side = CrossProd(Vector3(0, 0, 1), mDirection); 
    32         mUp = -Normalize(CrossProd(side, mDirection)); 
    33         mRight = -Normalize(CrossProd(mDirection, mUp));*/ 
    34  
    35         mUp = Vector3(0, 0, 1); 
    36         mRight = -CrossProd(mDirection, mUp); 
    37         mUp = -Normalize(CrossProd(mRight, mDirection)); 
    38 } 
     32 
     33        mIsOrtho = false; 
     34 
     35        SetPosition(Vector3(0, 0, 0)); 
     36 
     37        mPitch = mYaw = 0; 
     38        Precompute(Vector3(0, 1, 0)); 
     39} 
     40 
     41 
     42void Camera::Precompute(const Vector3 &direction)  
     43{ 
     44        /* 
     45        Vector3 side = CrossProd(Vector3(1, 0, 0), direction); 
     46        Vector3 up = -Normalize(CrossProd(side, direction)); 
     47        Vector3 right = -Normalize(CrossProd(direction, up)); 
     48        */ 
     49        Vector3 up = Vector3(0, 0, 1); 
     50        Vector3 right = -Normalize(-CrossProd(direction, up)); 
     51        up = -Normalize(CrossProd(right, direction)); 
     52 
     53        mBaseOrientation = Matrix4x4(right, up, direction); 
     54        mViewOrientation = mBaseOrientation; 
     55} 
     56 
    3957 
    4058 
     
    4260{ 
    4361        mPosition = pos; 
    44         Precompute(); 
    45 } 
    46  
    47  
    48 void Camera::SetDirection(const Vector3 &dir)  
    49 { 
    50         mDirection = dir; 
    51         Precompute(); 
    5262} 
    5363 
     
    5666{ 
    5767        mNear = nearDist; 
    58 } 
    59  
    60  
    61 void Camera::LookInBox(const AxisAlignedBox3 &box) 
    62 { 
    63         //mDirection = Vector3(0, 0, 1); 
    64         mDirection = Vector3(0, 1, 0); 
    65         mPosition = box.Center(); 
    66         mPosition.z = box.Min(2) + 0.9f * box.Size(2); 
    67  
    68         Precompute(); 
    69 } 
    70  
    71  
    72 void Camera::LookAtBox(const AxisAlignedBox3 &box) 
    73 { 
    74         mDirection = Vector3(0, box.Min().y - box.Max().y, 0); 
    75         mPosition = Vector3(0);//box.Max() - mDirection; 
    76  
    77         Precompute(); 
    7868} 
    7969 
     
    156146void Camera::SetupCameraView() 
    157147{ 
    158         glLoadIdentity(); 
    159         gluLookAt(mPosition.x, mPosition.y, mPosition.z, 
    160                   mPosition.x + mDirection.x, mPosition.y + mDirection.y, mPosition.z + mDirection.z,  
    161                           mUp.x, mUp.y, mUp.z); 
    162  
    163         //std::cout << "dir: " << mDirection << " pos: " << mPosition << " up: " << mUp << std::endl; 
     148        Matrix4x4 tview = mViewOrientation; 
     149 
     150        Vector3 pos = -mPosition; 
     151        pos = tview * pos; 
     152 
     153        Matrix4x4 viewOrientation = mViewOrientation; 
     154 
     155        viewOrientation.x[3][0] = pos.x; 
     156        viewOrientation.x[3][1] = pos.y; 
     157        viewOrientation.x[3][2] = pos.z; 
     158 
     159        glLoadMatrixf((float *)viewOrientation.x); 
    164160} 
    165161 
     
    177173        const float w_far = h_far * GetAspect(); 
    178174 
    179         //const Vector3 view = mDirection; 
    180         const Vector3 view = mDirection; 
     175        const Vector3 view = GetDirection(); 
    181176        const Vector3 fc = mPosition + view * z_far;  
    182177         
    183         const Vector3 up = mUp; 
    184         const Vector3 right = mRight; 
     178        const Vector3 up = GetUpVector(); 
     179 
     180        const Vector3 right = GetRightVector(); 
    185181 
    186182        Vector3 t1, t2; 
     
    194190        fbr = fc - t1 + t2; 
    195191 
    196         const Vector3 nc = mPosition + mDirection * z_near; 
     192        const Vector3 nc = mPosition + view * z_near; 
    197193         
    198194        t1 = h_near * 0.5f * up; 
     
    206202 
    207203 
    208 } 
    209  
     204void Camera::SetOrtho(bool ortho) 
     205{ 
     206        mIsOrtho = true; 
     207} 
     208 
     209 
     210void Camera::Yaw(float angle) 
     211{ 
     212        mYaw += angle; 
     213        CalculateFromPitchAndYaw(); 
     214        /* 
     215        Matrix4x4 viewOrientation(mRight, mUp, mDirection); 
     216        Matrix4x4 rot = RotationYMatrix(angle); 
     217 
     218        viewOrientation = viewOrientation * rot; 
     219 
     220        mDirection = Vector3(viewOrientation.x[2][0], viewOrientation.x[2][1], viewOrientation.x[2][2]); 
     221        mRight =     Vector3(viewOrientation.x[0][0], viewOrientation.x[0][1], viewOrientation.x[0][2]); 
     222        mUp =        Vector3(viewOrientation.x[1][0], viewOrientation.x[1][1], viewOrientation.x[1][2]);*/ 
     223} 
     224 
     225 
     226void Camera::Pitch(float angle) 
     227{ 
     228        mPitch += angle; 
     229        CalculateFromPitchAndYaw(); 
     230} 
     231 
     232 
     233void Camera::CalculateFromPitchAndYaw() 
     234{ 
     235        mViewOrientation = mBaseOrientation; 
     236 
     237        Matrix4x4 roty = RotationYMatrix(mPitch); 
     238        Matrix4x4 rotx = RotationXMatrix(mYaw); 
     239 
     240        mViewOrientation *= roty; 
     241        mViewOrientation *= rotx; 
     242} 
     243 
     244 
     245Vector3 Camera::GetDirection() const 
     246{  
     247        return -Vector3(mViewOrientation.x[0][2], mViewOrientation.x[1][2], mViewOrientation.x[2][2]); 
     248} 
     249 
     250 
     251Vector3 Camera::GetUpVector() const  
     252{  
     253        return Vector3(mViewOrientation.x[0][1], mViewOrientation.x[1][1], mViewOrientation.x[2][1]); 
     254} 
     255 
     256 
     257Vector3 Camera::GetRightVector() const  
     258{  
     259        return Vector3(mViewOrientation.x[0][0], mViewOrientation.x[1][0], mViewOrientation.x[2][0]); 
     260                 
     261} 
     262 
     263 
     264} 
     265 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Camera.h

    r2782 r2796  
    2020        { 
    2121                /// the 6 clip planes 
    22                 //float mClipPlane[6][4]; 
    2322                Plane3 mClipPlanes[6]; 
    2423 
     
    3029        Camera(int width, int height, float fieldOfView = 90.f); 
    3130 
    32         void Precompute(); 
    33  
    34         void LookInBox(const AxisAlignedBox3 &box); 
    35  
    36         void LookAtBox(const AxisAlignedBox3 &box); 
    3731 
    3832        void SetPosition(const Vector3 &pos); 
    3933 
    40         void SetDirection(const Vector3 &dir); 
    41  
    4234        inline Vector3 GetPosition() const { return mPosition; } 
    43         inline Vector3 GetDirection() const { return mDirection; } 
    44         inline Vector3 GetUpVector() const { return mUp; } 
    45         inline Vector3 GetRightVector() const { return mRight; } 
     35        Vector3 GetDirection() const; 
     36        Vector3 GetUpVector() const; 
     37        Vector3 GetRightVector() const; 
    4638 
    4739        inline float GetFov() const { return mFovy; } 
     
    4941        inline float GetAspect() const { return (float) mWidth / mHeight; } 
    5042 
     43        /** Sets up viewing in gl 
     44        */ 
    5145        void SetupCameraView(); 
    5246        void GetProjectionMatrix(Matrix4x4 &mat); 
     
    6054        inline float GetNear() const { return mNear; } 
    6155        void SetNear(float nearDist); 
     56         
     57        inline float GetFar() const { return mFar; } 
     58 
     59        void SetFar(float farDist) { mFar = farDist; } 
     60 
     61        void SetOrtho(bool ortho); 
     62 
     63        void Yaw(float angle); 
     64        void Pitch(float angle); 
     65         
    6266 
    6367 
    6468protected: 
    6569 
     70        void Precompute(const Vector3 &direction); 
     71 
     72        void CalculateFromPitchAndYaw(); 
     73 
     74 
    6675        //////////////// 
    67  
    68         Vector3 mPosition; 
    69         Vector3 mDirection; 
    70  
    71         /// up vector takes into account the FOV at a unit distance from the origin 
    72         Vector3 mUp; 
    73         /// right vector takes into account the FOV at a unit distance from the origin 
    74         Vector3 mRight; 
     76        //-- members 
    7577 
    7678        float mFovy; 
     
    7981 
    8082        float mNear; 
     83 
     84        float mFar; 
     85 
     86        bool mIsOrtho; 
     87 
     88        Matrix4x4 mBaseOrientation; 
     89        Matrix4x4 mViewOrientation; 
     90 
     91        float mPitch; 
     92        float mYaw; 
     93 
     94        Vector3 mPosition; 
    8195}; 
    8296 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneQuery.cpp

    r2782 r2796  
    1818 
    1919const static int viewport[4] = {0, 0, 512, 512}; 
    20 //static DepthComponent<float> *sDepth = NULL; 
     20//const static int viewport[4] = {0, 0, 1024, 768}; 
    2121 
    2222 
    2323 
    2424SceneQuery::SceneQuery(const AxisAlignedBox3 &sceneBox, RenderTraverser *renderer):  
    25 mSceneBox(sceneBox) 
     25mSceneBox(sceneBox), mDepth(NULL) 
    2626{ 
    2727        Prepare(renderer); 
     
    3232{ 
    3333        int px = (pt.x - mSceneBox.Min(0)) * (viewport[2] - 1) / mSceneBox.Size(0); 
    34         int py = (pt.y - mSceneBox.Min(2)) * (viewport[3] - 1) /  mSceneBox.Size(2); 
     34        int py = (pt.y - mSceneBox.Min(1)) * (viewport[3] - 1) / mSceneBox.Size(1); 
    3535 
    36         const float d = 1.0f;// - sDepth->getPixel(px, py); 
     36        const float d = mDepth[px + py * viewport[1]]; 
    3737 
    3838        if (d > 0.0f) 
    3939        { 
    40                 pt.z = mSceneBox.Size(2) * d + mSceneBox.Min(2); 
     40                pt.z =  mSceneBox.Min().z + mSceneBox.Size().z * d; 
    4141                cout << "new depth " << pt.z << " (" << d << ")" << endl; 
    4242 
     
    5252        cout << "Preparing scene queries" << endl; 
    5353 
    54         // center camera on "highest" point 
    55         Vector3 pos; 
    56  
    57         pos.x = mSceneBox.Center(0); 
    58         pos.y = mSceneBox.Max(1); 
    59         pos.z = mSceneBox.Center(2); 
    60  
    61         // for ortho cam this is the width 
    62         const Vector3 len = mSceneBox.Size(); 
    63  
    64         Camera *orthoCam = new Camera(len.x, len.y); 
    65         //orthoCam->SetOrtho(true); 
     54        const float xlen = mSceneBox.Size().x * 0.5f; 
     55        const float ylen = mSceneBox.Size().y * 0.5f; 
     56         
     57        Camera *orthoCam = new Camera(xlen, ylen); 
     58        orthoCam->SetOrtho(true); 
    6659 
    6760        orthoCam->SetNear(0.0f); 
    68         //orthoCam->SetFar(len.z); 
     61        orthoCam->Yaw(M_PI * 0.5f); 
    6962 
     63        Vector3 pos = Vector3(mSceneBox.Center().x, mSceneBox.Center().y, mSceneBox.Max().z); 
    7064        orthoCam->SetPosition(pos); 
    7165 
    72         cout << "fov: " << orthoCam->GetFov() << endl; 
    73         cout << "near: " << orthoCam->GetNear() << endl; 
    74         //cout << "far: " << orthoCam->GetFar() << endl; 
    75         cout << "aspect: " << orthoCam->GetAspect() << endl; 
     66        glPixelStorei(GL_PACK_ROW_LENGTH, viewport[2]); 
    7667 
    77         cout << "pos: " << orthoCam->GetPosition() << endl; 
    78         cout << "view: " << orthoCam->GetDirection() << endl; 
    79         cout << "up: " << orthoCam->GetUpVector() << endl; 
     68        // hack: should create offscreen buffer for this 
     69        glViewport(0, 0, viewport[2], viewport[3]); 
    8070 
    81         //orthoCam->SetDirection(Vector3(0, 1, 0)); 
    82         //orthoCam->Yaw(M_PI * 0.5f); 
     71        glMatrixMode(GL_PROJECTION); 
     72        glLoadIdentity(); 
    8373         
    84         renderer->SetCamera(orthoCam); 
     74        glOrtho(-xlen, xlen, -ylen, ylen, 0.0f, mSceneBox.Size().z);  
     75         
     76        glMatrixMode(GL_MODELVIEW); 
     77         
     78        orthoCam->SetupCameraView(); 
    8579 
    86         //OffscreenRenderArea *of = new OffscreenRenderArea(); 
    87         //of->Init(viewport[2], viewport[3]); 
     80        glClear(GL_DEPTH_BUFFER_BIT); 
     81 
     82        mDepth = new float[viewport[2] * viewport[3]]; 
     83 
     84        //renderer->SetCamera(orthoCam); 
    8885 
    8986        renderer->RenderScene(); 
    90         //sDepth = of->GetDepthFloat(); 
    9187 
    92         delete orthoCam; 
     88        glReadPixels(0, 0, viewport[2], viewport[3], GL_DEPTH_COMPONENT, GL_FLOAT, mDepth); 
     89 
     90        DEL_PTR(orthoCam); 
    9391} 
    9492 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneQuery.h

    r2782 r2796  
    1919 
    2020        SceneQuery(const AxisAlignedBox3 &sceneBox, RenderTraverser *traverser); 
    21  
     21        ~SceneQuery() { DEL_ARRAY_PTR(mDepth); } 
    2222        bool CalcIntersection(Vector3 &pt); 
    2323 
     
    3131 
    3232        AxisAlignedBox3 mSceneBox; 
     33 
     34        float *mDepth; 
    3335}; 
    3436 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Visualization.cpp

    r2790 r2796  
    1414namespace CHCDemoEngine 
    1515{ 
    16  
    17 GLUquadric *mSphere; 
    1816 
    1917 
     
    8482 
    8583 
     84Visualization::~Visualization()  
     85{ 
     86        //DEL_PTR(mSphere); 
     87} 
     88 
     89 
    8690void Visualization::SetHierarchy(Bvh *bvh) 
    8791{ 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Visualization.h

    r2790 r2796  
    1212class RenderState; 
    1313class AxisAlignedBox3; 
     14class GLUquadric; 
    1415 
    1516 
     
    2223        Visualization(Bvh *bvh, Camera *camera, Camera *vizCamera, RenderState *renderState); 
    2324 
    24         ~Visualization() {} 
     25        ~Visualization(); 
    2526 
    2627        /** Renders the visualizatioin 
     
    6667        /// the current frame id 
    6768        int mFrameId; 
     69 
     70        GLUquadric *mSphere; 
    6871}; 
    6972 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp

    r2795 r2796  
    2121#include "RenderState.h" 
    2222#include "Timer/PerfTimer.h" 
     23#include "SceneQuery.h" 
    2324 
    2425 
     
    5859int trianglesPerVirtualLeaf = 1000; 
    5960 
     61SceneQuery *sceneQuery = NULL; 
     62 
    6063/// these values get scaled with the frame rate 
    6164const float keyForwardMotion = 50.0f; 
     
    98101/// the accumulated z axis rotation 
    99102float rotation = 0; 
    100  
    101 Matrix4x4 visView = IdentityMatrix(); 
    102103 
    103104SceneEntityContainer skyGeometry; 
     
    121122void Output(int x, int y, const char *string); 
    122123void DrawHelpMessage(); 
     124void RenderSky(); 
    123125 
    124126void Begin2D(); 
     
    135137void RightMotion(int x, int y); 
    136138void MiddleMotion(int x, int y); 
    137 void SetupVisView(); 
    138139void CalcDecimalPoint(string &str, int d); 
    139140void ResetTraverser(); 
     
    156157 
    157158        visCamera = new Camera(winWidth, winHeight, fov); 
    158         visCamera->SetNear(nearDist); 
     159        visCamera->SetNear(0.0f); 
     160        visCamera->Yaw(.5 * M_PI); 
    159161 
    160162        glutInitWindowSize(winWidth, winHeight); 
     
    222224 
    223225        bvh->SetCamera(camera); 
     226 
    224227        ResetTraverser(); 
    225228 
     
    229232 
    230233        visualization = new Visualization(bvh, camera, NULL, &state); 
     234 
     235        sceneQuery = new SceneQuery(bvh->GetBox(), traverser); 
    231236 
    232237        glutMainLoop(); 
     
    488493                KeyVerticalMotion(KeyShift()); 
    489494 
     495         
     496        Vector3 playerPos = camera->GetPosition(); 
     497        sceneQuery->CalcIntersection(playerPos); 
     498        camera->SetPosition(playerPos); 
     499 
    490500        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
    491501 
     
    497507 
    498508         
    499         glEnableClientState(GL_VERTEX_ARRAY); 
    500         glEnableClientState(GL_NORMAL_ARRAY); 
    501  
    502         SceneEntityContainer::const_iterator sit, sit_end = skyGeometry.end(); 
    503  
    504         for (sit = skyGeometry.begin(); sit != sit_end; ++ sit) 
    505                 (*sit)->Render(&state); 
    506  
    507         glDisableClientState(GL_VERTEX_ARRAY); 
    508         glDisableClientState(GL_NORMAL_ARRAY); 
    509  
    510         state.Reset(); 
    511  
     509        /////////////// 
     510        //-- render sky 
     511 
     512        RenderSky(); 
     513         
    512514        if (visMode) DisplayVisualization(); 
    513515         
     
    764766        glLoadIdentity(); 
    765767 
    766         gluPerspective(fov, 1.0f / winAspectRatio, nearDist, 2.0f * Magnitude(bvh->GetBox().Diagonal())); 
     768        gluPerspective(fov, 1.0f / winAspectRatio, nearDist, 10.0f * Magnitude(bvh->GetBox().Diagonal())); 
    767769 
    768770        glMatrixMode(GL_MODELVIEW); 
     
    926928// displays the visualisation of culling algorithm 
    927929void DisplayVisualization() 
    928 {cout<<"here34"<<endl; 
    929         SetupVisView(); 
    930  
     930{ 
    931931        visualization->SetFrameId(traverser->GetCurrentFrameId()); 
    932932         
     
    940940        End2D(); 
    941941         
    942         glViewport(winWidth - winWidth / 4, winHeight - winHeight / 3, winWidth, winHeight); 
     942         
     943        AxisAlignedBox3 box = bvh->GetBox(); 
     944 
     945        const float xoffs = box.Size().x * 0.5f; 
     946        const float yoffs = box.Size().y * 0.5f; 
     947 
     948        Vector3 vizpos = Vector3(box.Center().x, box.Center().y, box.Max().z); 
     949        visCamera->SetPosition(vizpos); 
     950         
     951        glViewport(winWidth - winWidth / 4, winHeight - winHeight / 3, winWidth / 4, winHeight / 3); 
    943952 
    944953        glMatrixMode(GL_PROJECTION); 
    945954        glLoadIdentity(); 
    946955         
    947         gluPerspective(fov, 1.0f / winAspectRatio, nearDist, 20.0f * Magnitude(bvh->GetBox().Diagonal())); 
    948          
    949         AxisAlignedBox3 box = bvh->GetBox(); 
    950         const float offs = 2000; 
    951          
    952         //glOrtho(box.Min().y - offs, box.Max().y + offs, box.Min().y - offs, box.Max().y + offs, 0.1, 20.0f * Magnitude(bvh->GetBox().Diagonal()));  
    953         //glOrtho(-offs, offs, offs, -offs, 0.1, 20.0f * Magnitude(bvh->GetBox().Diagonal()));  
    954         //glPushMatrix(); 
    955  
    956         Vector3 vizpos = Vector3(box.Center().x, box.Center().y, box.Max().z); 
    957         visCamera->SetPosition(vizpos); 
    958         visCamera->Yaw(-0.5 * M_PI); 
    959         cout<<"pos: " << visCamera->GetPosition()<<endl; 
     956        glOrtho(-xoffs, xoffs, -yoffs, yoffs, 0.0f, box.Size().z);  
     957 
    960958        glMatrixMode(GL_MODELVIEW); 
    961         glLoadIdentity(); 
    962959 
    963960        visCamera->SetupCameraView(); 
    964         //glMultMatrixf((float *)visView.x); 
    965  
    966         //SetupLighting(); 
     961         
    967962        GLfloat position[] = {0.8f, 1.0f, 1.5f, 0.0f}; 
    968963        glLightfv(GL_LIGHT0, GL_POSITION, position); 
     
    978973        visualization->Render(); 
    979974         
    980         //glPopMatrix(); 
    981          
    982975        glViewport(0, 0, winWidth, winHeight); 
    983976} 
    984977 
    985  
    986 /** Sets up view matrix for bird eye view 
    987 */ 
    988 void SetupVisView() 
    989 { 
    990         Vector3 pos(-bvh->GetBox().Center()); 
    991   
    992         pos.z = -15.0f * bvh->GetBox().Size().z; 
    993         pos.y += 1400; 
    994         pos.x -= 1170; 
    995  
    996         Vector3 dir(0, 0, 1); 
    997         Vector3 up(0, 1, 0); 
    998  
    999         Vector3 left = Normalize(CrossProd(dir, up)); 
    1000         up = Normalize(CrossProd(left, dir)); 
    1001  
    1002         visView = Matrix4x4(up, left, dir); 
    1003         pos = visView * pos; 
    1004  
    1005         visView.x[3][0] = pos.x; 
    1006         visView.x[3][1] = pos.y; 
    1007         visView.x[3][2] = pos.z; 
    1008  
    1009         //cout << visView<< endl; 
    1010 } 
    1011978 
    1012979// cleanup routine after the main loop 
     
    1014981{ 
    1015982        DEL_PTR(traverser); 
     983        DEL_PTR(sceneQuery); 
    1016984        DEL_PTR(bvh); 
    1017985        DEL_PTR(visualization); 
     
    11391107        End2D(); 
    11401108}        
     1109 
     1110 
     1111void RenderSky() 
     1112{ 
     1113        glEnableClientState(GL_VERTEX_ARRAY); 
     1114        glEnableClientState(GL_NORMAL_ARRAY); 
     1115 
     1116        SceneEntityContainer::const_iterator sit, sit_end = skyGeometry.end(); 
     1117 
     1118        for (sit = skyGeometry.begin(); sit != sit_end; ++ sit) 
     1119                (*sit)->Render(&state); 
     1120 
     1121        glDisableClientState(GL_VERTEX_ARRAY); 
     1122        glDisableClientState(GL_NORMAL_ARRAY); 
     1123 
     1124        state.Reset(); 
     1125} 
Note: See TracChangeset for help on using the changeset viewer.