Changeset 340
- Timestamp:
- 10/18/05 17:28:31 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/Intersectable.h
r339 r340 43 43 virtual void GetRandomSurfacePoint(Vector3 &point, Vector3 &normal) = 0; 44 44 45 virtual ostream &Describe(ostream &s) = 0; 46 45 47 }; 46 48 -
trunk/VUT/GtpVisibilityPreprocessor/src/Makefile
r339 r340 1 1 ############################################################################# 2 2 # Makefile for building: preprocessor 3 # Generated by qmake (1.07a) (Qt 3.3.2) on: Tue Oct 18 1 1:00:5520053 # Generated by qmake (1.07a) (Qt 3.3.2) on: Tue Oct 18 16:48:33 2005 4 4 # Project: preprocessor.pro 5 5 # Template: app … … 13 13 LEX = flex 14 14 YACC = byacc 15 CFLAGS = -nologo -Zm200 -W0 -MD d -Zi -Gm -GX -DUNICODE -DWIN32 -DQT_DLL -DQT_THREAD_SUPPORT16 CXXFLAGS = -nologo -Zm200 -W0 -MD d -Zi -Gm -GX -DUNICODE -DWIN32 -DQT_DLL -DQT_THREAD_SUPPORT15 CFLAGS = -nologo -Zm200 -W0 -MD -O2 -G7 -GX -DUNICODE -DWIN32 -DQT_DLL -DQT_THREAD_SUPPORT -DQT_NO_DEBUG 16 CXXFLAGS = -nologo -Zm200 -W0 -MD -O2 -G7 -GX -DUNICODE -DWIN32 -DQT_DLL -DQT_THREAD_SUPPORT -DQT_NO_DEBUG 17 17 LEXFLAGS = 18 18 YACCFLAGS =-d 19 19 INCPATH = -I"..\src" -I"..\support\xerces\include" -I"..\support\zlib\include" -I"..\support\boost" -I"..\support\devil\include" -I"$(QTDIR)\include" -I"d:\gametools\svn\trunk\VUT\GtpVisibilityPreprocessor\src" -I"C:\Qt\3.3.2\mkspecs\win32-msvc.net" 20 20 LINK = "c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\link.exe" 21 LFLAGS = /NOLOGO /DE BUG/SUBSYSTEM:CONSOLE /LIBPATH:"../support/xerces/lib" /LIBPATH:"../support/devil/lib" /LIBPATH:"$(QTDIR)\lib"21 LFLAGS = /NOLOGO /DELAYLOAD:comdlg32.dll /DELAYLOAD:oleaut32.dll /DELAYLOAD:winmm.dll /DELAYLOAD:wsock32.dll /DELAYLOAD:winspool.dll /SUBSYSTEM:CONSOLE /LIBPATH:"../support/xerces/lib" /LIBPATH:"../support/devil/lib" /LIBPATH:"$(QTDIR)\lib" 22 22 LIBS = "qt-mt332.lib" "qtmain.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "imm32.lib" "winmm.lib" "wsock32.lib" "winspool.lib" "delayimp.lib" "xerces-c_2.lib" "devil.lib" "ilu.lib" "ilut.lib" "opengl32.lib" "glu32.lib" 23 23 MOC = $(QTDIR)\bin\moc.exe … … 188 188 -$(DEL_FILE) ViewCell.obj 189 189 -$(DEL_FILE) ViewCellBsp.obj 190 -$(DEL_FILE) preprocessor.pdb191 -$(DEL_FILE) preprocessor.ilk192 -$(DEL_FILE) vc*.pdb193 -$(DEL_FILE) vc*.idb194 195 190 196 191 … … 349 344 SceneGraph.h \ 350 345 X3dExporter.h \ 351 Containers.h \ 352 AxisAlignedBox3.h \ 353 Rectangle3.h \ 354 Matrix4x4.h \ 355 Vector3.h \ 356 Plane3.h \ 357 common.h \ 358 Exporter.h \ 359 Material.h \ 346 Intersectable.h \ 347 Containers.h \ 348 AxisAlignedBox3.h \ 349 Rectangle3.h \ 350 Matrix4x4.h \ 351 Vector3.h \ 352 Plane3.h \ 353 common.h \ 354 Exporter.h \ 355 Material.h \ 356 Pvs.h \ 360 357 361 358 -
trunk/VUT/GtpVisibilityPreprocessor/src/Mesh.cpp
r339 r340 9 9 Mesh::Preprocess() 10 10 { 11 mBox.Initialize(); 12 11 Cleanup(); 12 13 mBox.Initialize(); 13 14 VertexContainer::const_iterator vi = mVertices.begin(); 14 15 for (; vi != mVertices.end(); vi++) { … … 282 283 } 283 284 point *= 1.0f/sum; 284 normal = GetFacePlane(faceIndex).mNormal; 285 286 normal = GetFacePlane(faceIndex).mNormal; 285 287 } 286 288 … … 324 326 { 325 327 Face *face = mFaces[faceIndex]; 326 328 return Plane3(mVertices[face->mVertexIndices[0]], 327 329 mVertices[face->mVertexIndices[1]], 328 330 mVertices[face->mVertexIndices[2]]); 331 } 332 333 bool 334 Mesh::ValidateFace(const int i) 335 { 336 Face *face = mFaces[i]; 337 338 Plane3 plane = Plane3(mVertices[face->mVertexIndices[0]], 339 mVertices[face->mVertexIndices[1]], 340 mVertices[face->mVertexIndices[2]]); 341 342 if (!eq(Magnitude(plane.mNormal), 1.0f)) 343 return false; 344 } 345 346 void 347 Mesh::Cleanup() 348 { 349 int toRemove = 0; 350 FaceContainer newFaces; 351 for (int i=0; i < mFaces.size(); i++) 352 if (ValidateFace(i)) { 353 newFaces.push_back(mFaces[i]); 354 } else { 355 cout<<"d"; 356 delete mFaces[i]; 357 toRemove++; 358 } 359 360 if (toRemove) { 361 mFaces = newFaces; 362 } 363 364 // cleanup vertices?? 329 365 } 330 366 -
trunk/VUT/GtpVisibilityPreprocessor/src/Mesh.h
r333 r340 77 77 void AddTriangle(const Triangle3 &triangle); 78 78 void AddRectangle(const Rectangle3 &triangle); 79 79 80 void Cleanup(); 81 bool 82 ValidateFace(const int face); 83 80 84 void AddFace(Face *face) 81 85 { … … 141 145 void GetRandomSurfacePoint(Vector3 &point, Vector3 &normal); 142 146 147 virtual ostream &Describe(ostream &s) { 148 return s<<"Mesh #vertices="<<mVertices.size()<<" #faces="<<mFaces.size(); 149 } 150 143 151 }; 144 152 … … 179 187 180 188 189 virtual ostream &Describe(ostream &s) { 190 s<<"MeshInstance Id="<<GetId(); 191 return mMesh->Describe(s); 192 } 193 181 194 }; 182 195 -
trunk/VUT/GtpVisibilityPreprocessor/src/Ray.h
r328 r340 233 233 friend float DistanceToZPlane(const Vector3 &vec, const Ray &ray); 234 234 friend int MakeIntersectLine(const Plane3 &p, const Plane3 &q, Ray &ray); 235 236 friend ostream &operator<<(ostream &s, const Ray &r) { 237 return s<<"Ray:loc="<<r.loc<<" dir="<<r.dir; 238 } 235 239 }; 236 240 -
trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp
r339 r340 153 153 int sampleContributions = 0; 154 154 155 long t1 = Get Time();155 long t1 = GetRealTime(); 156 156 // cast ray to KD tree to find intersection with other objects 157 157 mKdTree->CastRay(ray); 158 long t2 = GetTime(); 159 160 cout<<object->GetId()<<" "<<TimeDiff(t1, t2); 158 long t2 = GetRealTime(); 159 160 if (0 && object->GetId() > 2197) { 161 object->Describe(cout)<<endl; 162 cout<<ray<<endl; 163 } 164 165 // cout<<object->GetId()<<" "<<TimeDiff(t1, t2)<<endl; 161 166 162 167 if (mViewCellsType == BSP_VIEW_CELLS) … … 380 385 bool viewcellSample = true; 381 386 int sampleContributions; 382 387 bool debug = false; //(object->GetId() >= 2199); 383 388 if (viewcellSample) { 384 389 nodeToSample = mKdTree->GetRandomLeaf(Plane3(normal, point)); … … 394 399 break; 395 400 } 396 397 401 if (tries == maxTries) 398 402 direction = UniformRandomVector(normal); 403 404 if (debug) { 405 cout<< 406 "normal "<<normal<<endl<< 407 "tries "<<tries<<endl<< 408 "dir="<<direction<<endl; 409 } 410 399 411 } 400 412 else { -
trunk/VUT/GtpVisibilityPreprocessor/src/UnigraphicsParser.cpp
r312 r340 143 143 currentMesh->AddFace(face); 144 144 if (meshGrouping != 0 && 145 146 currentMesh->Preprocess();147 // make an instance of this mesh148 MeshInstance *mi = new MeshInstance(currentMesh);149 root->mGeometry.push_back(mi);150 currentMesh = new Mesh;145 currentMesh->mFaces.size() >= meshGrouping) { 146 currentMesh->Preprocess(); 147 // make an instance of this mesh 148 MeshInstance *mi = new MeshInstance(currentMesh); 149 root->mGeometry.push_back(mi); 150 currentMesh = new Mesh; 151 151 } 152 152 } -
trunk/VUT/GtpVisibilityPreprocessor/src/Vector3.cpp
r176 r340 200 200 201 201 Vector3 dir(sinTheta*sin(fi), 202 203 204 202 cosTheta, 203 sinTheta*cos(fi)); 204 205 205 206 206 // return Normalize(dir); 207 207 208 208 Matrix4x4 m = RotationVectorsMatrix( 209 210 209 normal, 210 Vector3(0,1,0)); 211 211 Matrix4x4 mi = Invert(m); 212 212 m = m*RotationVectorsMatrix( 213 214 213 Vector3(0,1,0), 214 Normalize(dir))*mi; 215 215 216 216 return TransformNormal(m, normal); 217 217 218 // return TransformNormal(219 // RotationVectorsMatrix(220 // Vector3(0,1,0),221 // Normalize(dir)222 // ),223 // normal224 // );225 } 218 // return TransformNormal( 219 // RotationVectorsMatrix( 220 // Vector3(0,1,0), 221 // Normalize(dir) 222 // ), 223 // normal 224 // ); 225 } -
trunk/VUT/GtpVisibilityPreprocessor/src/default.env
r335 r340 9 9 # filename vienna.x3d 10 10 # filename ../data/vienna/vienna-simple.x3d 11 filename ../data/vienna/vienna-buildings.x3d11 # filename ../data/vienna/vienna-buildings.x3d 12 12 # filename ../data/vienna/viewcells-25-sel.x3d 13 #filename ../data/atlanta/atlanta2.x3d13 filename ../data/atlanta/atlanta2.x3d 14 14 # filename ../data/soda/soda.dat 15 15 # filename ../data/soda/soda5.dat … … 61 61 62 62 ViewCells { 63 #hierarchy kdTree64 hierarchy bspTree63 hierarchy kdTree 64 #hierarchy bspTree 65 65 # hierarchy sceneDependent 66 66 -
trunk/VUT/GtpVisibilityPreprocessor/src/preprocessor.pro
r339 r340 13 13 14 14 # debuc config 15 CONFIG += console warn_off thread debug15 CONFIG += console warn_off thread release 16 16 17 17 # RELEASE CONFIG
Note: See TracChangeset
for help on using the changeset viewer.