Changeset 2720 for GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.cpp
- Timestamp:
- 05/27/08 21:24:34 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.cpp
r2691 r2720 8 8 #include "Triangle3.h" 9 9 #include "VssRay.h" 10 10 #include "IntersectableWrapper.h" 11 11 12 12 … … 2135 2135 face6->mVertices.push_back(Vector3(mMax.x, mMax.y, mMax.z)); 2136 2136 face6->mVertices.push_back(Vector3(mMin.x, mMax.y, mMax.z)); 2137 2137 } 2138 /* 2139 xxxxxx 2140 x xx 2141 x x x 2142 xxxxxx x 2143 x x x 2144 x xx 2145 xxxxxx 2146 */ 2147 2148 void AxisAlignedBox3::Triangulate(ObjectContainer &triangles) const 2149 { 2150 /*PolygonContainer polys; 2151 TriangleContainer tris; 2152 2153 ExtractPolys(polys); 2154 2155 for (size_t i = 0; i < polys.size(); ++ i) 2156 { 2157 Triangle tri; 2158 polys[i].Trianulage(tris); 2159 }*/ 2160 2161 TriangleIntersectable *triObj; 2162 Triangle3 tri; 2163 2164 tri.mVertices[0] = Vector3(mMin.x, mMin.y, mMax.z); 2165 tri.mVertices[1] = Vector3(mMin.x, mMax.y, mMax.z); 2166 tri.mVertices[2] = Vector3(mMin.x, mMax.y ,mMin.z); 2167 2168 triObj = new TriangleIntersectable(tri); 2169 triangles.push_back(triObj); 2170 2171 tri.mVertices[0] = Vector3(mMin.x, mMax.y ,mMin.z); 2172 tri.mVertices[1] = Vector3(mMin.x, mMin.y, mMin.z); 2173 tri.mVertices[2] = Vector3(mMin.x, mMin.y, mMax.z); 2174 2175 triObj = new TriangleIntersectable(tri); 2176 triangles.push_back(triObj); 2177 2178 tri.mVertices[0] = Vector3(mMax.x, mMin.y, mMin.z); 2179 tri.mVertices[1] = Vector3(mMax.x, mMax.y, mMin.z); 2180 tri.mVertices[2] = Vector3(mMax.x, mMax.y, mMax.z); 2181 2182 triObj = new TriangleIntersectable(tri); 2183 triangles.push_back(triObj); 2184 2185 tri.mVertices[0] = Vector3(mMax.x, mMax.y, mMax.z); 2186 tri.mVertices[1] = Vector3(mMax.x, mMin.y, mMax.z); 2187 tri.mVertices[2] = Vector3(mMax.x, mMin.y, mMin.z); 2188 2189 triObj = new TriangleIntersectable(tri); 2190 triangles.push_back(triObj); 2191 2192 tri.mVertices[0] = Vector3(mMax.x, mMin.y ,mMin.z); 2193 tri.mVertices[1] = Vector3(mMax.x, mMin.y, mMax.z); 2194 tri.mVertices[2] = Vector3(mMin.x, mMin.y, mMax.z); 2195 2196 triObj = new TriangleIntersectable(tri); 2197 triangles.push_back(triObj); 2198 2199 tri.mVertices[0] = Vector3(mMin.x, mMin.y, mMax.z); 2200 tri.mVertices[1] = Vector3(mMin.x, mMin.y, mMin.z); 2201 tri.mVertices[2] = Vector3(mMax.x, mMin.y ,mMin.z); 2202 2203 2204 triObj = new TriangleIntersectable(tri); 2205 triangles.push_back(triObj); 2206 2207 tri.mVertices[0] = Vector3(mMin.x, mMax.y, mMin.z); 2208 tri.mVertices[1] = Vector3(mMin.x, mMax.y, mMax.z); 2209 tri.mVertices[2] = Vector3(mMax.x, mMax.y, mMax.z); 2210 2211 triObj = new TriangleIntersectable(tri); 2212 triangles.push_back(triObj); 2213 2214 tri.mVertices[0] = Vector3(mMax.x, mMax.y, mMax.z); 2215 tri.mVertices[1] = Vector3(mMax.x, mMax.y, mMin.z); 2216 tri.mVertices[2] = Vector3(mMin.x, mMax.y, mMin.z); 2217 2218 triObj = new TriangleIntersectable(tri); 2219 triangles.push_back(triObj); 2220 2221 tri.mVertices[0] = Vector3(mMin.x, mMax.y, mMin.z); 2222 tri.mVertices[1] = Vector3(mMax.x, mMax.y, mMin.z); 2223 tri.mVertices[2] = Vector3(mMax.x, mMin.y, mMin.z); 2224 2225 2226 triObj = new TriangleIntersectable(tri); 2227 triangles.push_back(triObj); 2228 2229 tri.mVertices[0] = Vector3(mMax.x, mMin.y, mMin.z); 2230 tri.mVertices[1] = Vector3(mMin.x, mMin.y, mMin.z); 2231 tri.mVertices[2] = Vector3(mMin.x, mMax.y, mMin.z); 2232 2233 triObj = new TriangleIntersectable(tri); 2234 triangles.push_back(triObj); 2235 2236 tri.mVertices[0] = Vector3(mMin.x, mMin.y, mMax.z); 2237 tri.mVertices[1] = Vector3(mMax.x, mMin.y, mMax.z); 2238 tri.mVertices[2] = Vector3(mMax.x, mMax.y, mMax.z); 2239 2240 2241 triObj = new TriangleIntersectable(tri); 2242 triangles.push_back(triObj); 2243 2244 tri.mVertices[0] = Vector3(mMax.x, mMax.y, mMax.z); 2245 tri.mVertices[1] = Vector3(mMin.x, mMax.y, mMax.z); 2246 tri.mVertices[2] = Vector3(mMin.x, mMin.y, mMax.z); 2247 2248 triObj = new TriangleIntersectable(tri); 2249 triangles.push_back(triObj); 2138 2250 } 2139 2251
Note: See TracChangeset
for help on using the changeset viewer.