Changeset 534 for trunk/VUT/GtpVisibilityPreprocessor/src/RssTree.cpp
- Timestamp:
- 01/13/06 14:17:46 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/RssTree.cpp
r516 r534 2041 2041 2042 2042 int nrays = leaf->rays.size(); 2043 2044 2043 int startIndex = rays.size(); 2044 2045 2045 AxisAlignedBox3 box = GetBBox(leaf); 2046 2046 AxisAlignedBox3 dirBox = GetDirBBox(leaf); 2047 2047 2048 2048 2049 AxisAlignedBox3 sBox(box); 2050 AxisAlignedBox3 sDirBox(dirBox); 2051 const float smoothRange = 0.5f; 2052 sBox.Scale(1.0f + smoothRange); 2053 sDirBox.Scale(1.0f + smoothRange); 2054 int smoothRays = (int)numberOfRays*0.0f; 2055 2056 #if AVG_LEN 2057 float avgLength = 0.0f; 2058 2059 if (nrays) { 2060 const int numAvg = 5; 2061 2062 int step = (nrays-1)/10; 2063 if (step<1) 2064 step = 1; 2065 2066 int summed = 0; 2067 float sumLength = 0.0f; 2068 for (int i=0; i < nrays; i+=step) { 2069 sumLength += leaf->rays[i].mRay->GetSize(); 2070 summed++; 2071 } 2072 2073 avgLength = sumLength/summed; 2074 } 2075 #endif 2049 const float smoothRange = 0.0f; 2050 if (smoothRange != 0.0f) { 2051 box.Scale(1.0f + smoothRange); 2052 dirBox.Scale(1.0f + smoothRange); 2053 } 2054 2076 2055 2077 2056 Exporter *exporter = NULL; … … 2149 2128 leaf->halton.GetNumber(5), 2150 2129 0.0f); 2130 2151 2131 leaf->halton.GenerateNext(); 2152 2132 } else { … … 2160 2140 } 2161 2141 2162 if (i < smoothRays) { 2163 origin = sBox.GetPoint(pVector); 2164 dirVector = sDirBox.GetPoint(dVector); 2165 } else { 2166 origin = box.GetPoint(pVector); 2167 dirVector = dirBox.GetPoint(dVector); 2168 } 2142 origin = box.GetPoint(pVector); 2143 dirVector = dirBox.GetPoint(dVector); 2144 2169 2145 direction = Vector3(sin(dirVector.x), sin(dirVector.y), cos(dirVector.x)); 2170 2146 } … … 2216 2192 } 2217 2193 2194 2218 2195 // cout<<"desired="<<numberOfRays<<" tries="<<i<<endl; 2219 2196 // assign probabilitites to the generated rays 2197 for (i=startIndex; i < rays.size(); i++) 2198 rays[i].mProbability = 1.0f; 2199 2220 2200 if (exporter) { 2221 2201 exporter->ExportRays(selectedRays, RgbColor(1, 0, 0)); … … 2223 2203 CLEAR_CONTAINER(selectedRays); 2224 2204 } 2205 2206 2225 2207 } 2226 2208
Note: See TracChangeset
for help on using the changeset viewer.