Changeset 504


Ignore:
Timestamp:
01/06/06 11:31:28 (18 years ago)
Author:
bittner
Message:

added frustum class for frustum culling support for HW based rendering

Location:
trunk/VUT/GtpVisibilityPreprocessor/src
Files:
2 added
9 edited

Legend:

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

    r502 r504  
    8383  for (i=0; i < mesh->mFaces.size(); i++) { 
    8484        if (mWireFrame) 
     85          glBegin(GL_LINE_LOOP); 
     86        else 
    8587          glBegin(GL_POLYGON); 
    86         else 
    87           glBegin(GL_LINE_LOOP); 
    8888 
    8989        Face *face = mesh->mFaces[i]; 
     
    501501        float dist = Magnitude(mSceneGraph->GetBox().Diagonal())*0.05; 
    502502        Vector3 pos = mViewPoint - dist*Vector3(mViewDirection.x, 
    503                                                                                         1, 
     503                                                                                        -1, 
    504504                                                                                        mViewDirection.y); 
    505505         
     
    508508         
    509509        glLoadIdentity(); 
    510         gluLookAt(mViewPoint.x, mViewPoint.y, mViewPoint.z, 
     510        gluLookAt(pos.x, pos.y, pos.z, 
    511511                          target.x, target.y, target.z, 
    512512                          up.x, up.y, up.z); 
     
    514514 
    515515} 
     516 
     517void 
     518GlRendererWidget::keyPressEvent ( QKeyEvent * e ) 
     519{ 
     520  switch (e->key()) { 
     521  case Qt::Key_T: 
     522        mTopView = !mTopView; 
     523        updateGL(); 
     524        break; 
     525  default: 
     526        e->ignore(); 
     527        break; 
     528  } 
     529   
     530} 
  • trunk/VUT/GtpVisibilityPreprocessor/src/GlRenderer.h

    r502 r504  
    173173  void mouseMoveEvent(QMouseEvent *); 
    174174 
     175  void keyPressEvent ( QKeyEvent * e ) ; 
     176   
    175177  float 
    176178  RenderErrors(); 
  • trunk/VUT/GtpVisibilityPreprocessor/src/KdTree.cpp

    r492 r504  
    66#include "KdTree.h" 
    77#include "ViewCell.h" 
     8#include "Frustum.h" 
    89 
    910int KdNode::mailID = 1; 
     
    963964  return NULL; 
    964965} 
     966 
     967 
     968int 
     969CastFrustum( 
     970                        Frustum &frustum 
     971                        ) 
     972{ 
     973   
     974 
     975  return 0; 
     976} 
  • trunk/VUT/GtpVisibilityPreprocessor/src/KdTree.h

    r469 r504  
    1616class Intersectable; 
    1717//class KdViewCell; 
     18class Frustum; 
    1819 
    1920// -------------------------------------------------------------- 
     
    282283  int 
    283284  CastRay( 
    284           Ray &ray 
    285           ); 
    286  
    287  
     285                  Ray &ray 
     286                  ); 
     287   
     288 
     289  int 
     290  CastFrustum( 
     291                          Frustum &frustum 
     292                          ); 
     293   
     294   
    288295  /** Casts line segment into tree. 
    289296          @returns intersected view cells. 
  • trunk/VUT/GtpVisibilityPreprocessor/src/Makefile

    r502 r504  
    11############################################################################# 
    22# Makefile for building: preprocessor 
    3 # Generated by qmake (2.00a) (Qt 4.1.0) on: ?t 5. I 09:42:49 2006 
     3# Generated by qmake (2.00a) (Qt 4.1.0) on: pá 6. I 11:25:45 2006 
    44# Project:  preprocessor.pro 
    55# Template: app 
  • trunk/VUT/GtpVisibilityPreprocessor/src/Plane3.h

    r487 r504  
    2424 
    2525  Plane3(const Vector3 &normal, 
    26         const Vector3 &point 
    27         ):mNormal(normal) 
     26                const Vector3 &point 
     27                ):mNormal(normal) 
    2828  { 
    2929    mD = -DotProd(normal, point); 
  • trunk/VUT/GtpVisibilityPreprocessor/src/RssPreprocessor.cpp

    r503 r504  
    548548                //Vector3 viewpoint = GetViewpoint(mViewSpaceBox); 
    549549                Vector3 viewpoint;  
    550                 //              mViewCellsManager->GetViewPoint(viewpoint); 
    551                 viewpoint = GetViewpoint(mViewSpaceBox); 
     550                mViewCellsManager->GetViewPoint(viewpoint); 
     551                //              viewpoint = GetViewpoint(mViewSpaceBox); 
    552552                Vector3 direction = InitialGetDirection(viewpoint, mViewSpaceBox); 
    553553                 
  • trunk/VUT/GtpVisibilityPreprocessor/src/default.env

    r502 r504  
    1313#;../data/vienna/vienna-plane.x3d 
    1414# filename ../data/vienna/viewcells-25-sel.x3d 
    15 # filename ../data/atlanta/atlanta2.x3d 
     15filename ../data/atlanta/atlanta2.x3d 
    1616# filename ../data/soda/soda.dat 
    17 filename ../data/soda/soda5.dat 
     17# filename ../data/soda/soda5.dat 
    1818} 
    1919 
     
    6969RssPreprocessor { 
    7070        samplesPerPass  100000 
    71         initialSamples 500000 
     71        initialSamples 1000000 
    7272        vssSamples 10000000 
    7373        vssSamplesPerPass 500000 
     
    169169        #type kdTree 
    170170        #type vspKdTree 
    171         type bspTree 
    172         #type vspBspTree 
     171        # type bspTree 
     172        type vspBspTree 
    173173         
    174174        #type sceneDependent 
  • trunk/VUT/GtpVisibilityPreprocessor/src/preprocessor.pro

    r492 r504  
    3030# Input 
    3131HEADERS += Halton.h VssRay.h VssPreprocessor.h RssTree.h GlRenderer.h \ 
    32 PreprocessorThread.h Preprocessor.h 
     32PreprocessorThread.h Preprocessor.h Frustum.h 
    3333 
    3434 
     
    4343RenderSimulator.cpp VspKdTree.cpp RayInfo.cpp RssTree.cpp RssPreprocessor.cpp \ 
    4444ViewCellsManager.cpp VspBspTree.cpp GlRenderer.cpp \ 
    45 PreprocessorThread.cpp Renderer.cpp 
     45PreprocessorThread.cpp Renderer.cpp Frustum.cpp 
    4646 
Note: See TracChangeset for help on using the changeset viewer.