Changeset 1976 for GTP/trunk/Lib/Vis/Preprocessing
- Timestamp:
- 01/14/07 23:19:32 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
r1974 r1976 1311 1311 "1.5"); 1312 1312 1313 RegisterOption("GvsPreprocessor.perViewCell", 1314 optBool, 1315 "gvs_per_viewcell=", 1316 "false"); 1317 1313 1318 RegisterOption("GvsPreprocessor.stats", 1314 1319 optString, -
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
r1935 r1976 36 36 Environment::GetSingleton()->GetFloatValue("GvsPreprocessor.epsilon", mEps); 37 37 Environment::GetSingleton()->GetFloatValue("GvsPreprocessor.threshold", mThreshold); 38 Environment::GetSingleton()->GetBoolValue("GvsPreprocessor.UsePerViewCellSampling", mPerViewCell); 38 39 39 40 char gvsStatsLog[100]; -
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.h
r1934 r1976 199 199 GvsStatistics mGvsStats; 200 200 201 bool mPerViewCell; 201 202 bool mOnlyRandomSampling; 202 203 }; -
GTP/trunk/Lib/Vis/Preprocessing/src/ObjParser.cpp
r1973 r1976 3 3 #include <list> 4 4 #include <map> 5 #include <math.h> 6 5 7 using namespace std; 6 8 … … 22 24 #define ROTATE_SCENE 0 23 25 26 // hack: define this as in the intel ray tracer 27 #define FLT_EPSILON 1.192092896e-07f 28 24 29 // HACK 25 30 static void RotateMesh(Mesh *mesh) … … 188 193 bool TriangleValid(const Triangle3 &triangle) 189 194 { 190 /*int i; 191 int good_triangles = 0; 192 int ntriangles = tri.GetSize(); 193 194 for (i = 0; i < ntriangles; i++) { 195 int ti = tri[i]; 196 RTVec3f v[3]; 197 get_triangle(m_tree, v, tri[i]); 198 if ((v[0]-v[1]).Cross(v[0]-v[2]).LengthSquared() <= 0.000001*FLT_EPSILON*FLT_EPSILON) { 199 // v0, v1 & v2 lays on a line (area == 0) 200 tri[i] = -1; 201 continue; 202 } 203 good_triangles++; 204 }*/ 205 206 return false; 207 } 195 const Vector3 a = triangle.mVertices[0] - triangle.mVertices[1]; 196 const Vector3 b = triangle.mVertices[0] - triangle.mVertices[2]; 197 const Vector3 cross_a_b = CrossProd(a, b); 198 199 if (SqrMagnitude(cross_a_b) <= 0.000001 * FLT_EPSILON * FLT_EPSILON) 200 { 201 // v0, v1 & v2 lays on a line (area == 0) 202 return false; 203 } 204 205 return true; 206 } 207 208 208 209 209 bool ObjParser::ParseFile(const string filename, -
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp
r1974 r1976 732 732 // set this values for last contributingRays 733 733 int index = mBufferStart - 1; 734 int i;735 for (i =0; i < contributingRays; i++, index--) {734 735 for (int i=0; i < contributingRays; i++, index--) { 736 736 if (index < 0) 737 737 index = mRays.size()-1; … … 742 742 // compute cdf 743 743 mRays[0].mCdf = mRays[0].mImportance/(mRays[0].mSamples+1); 744 for (i =1; i < mRays.size(); i++)744 for (int i=1; i < mRays.size(); i++) 745 745 mRays[i].mCdf = mRays[i-1].mCdf + mRays[i].mImportance/(mRays[i].mSamples+1); 746 746
Note: See TracChangeset
for help on using the changeset viewer.