Ignore:
Timestamp:
04/24/09 18:00:06 (15 years ago)
Author:
mattausch
Message:

cleaned up algorithm

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/Converter/PlyConverter.cpp

    r3361 r3362  
    4141                Face face = faces[i]; 
    4242 
     43                if (faces[i].indices.empty()) cout << "error!!" << endl; 
     44 
    4345                //cout << "size: " << face.indices.size() << endl; 
    44                 for (size_t j = 0; j < face.indices.size(); ++ j) 
     46                for (int j = (int)face.indices.size() - 1; j >= 0; -- j) 
    4547                { 
    46                         SimpleVec h = vertices[faces[i].indices[j]]; 
     48                        //cout << "h " << j << " " << face.indices.size() << endl; 
     49 
     50                        SimpleVec h = vertices[face.indices[j]]; 
    4751                        SimpleVec v; 
    4852                         
    49                         v.x = h.x * 14; 
     53                        v.x = -h.x * 14; 
    5054                        v.y = h.z * 14; 
    5155                        v.z = h.y * 14; 
     
    7680 
    7781                // no face normals? => create normals 
    78                 const SimpleTri tri(geom->mVertices[idx + 2], 
     82                const SimpleTri tri(geom->mVertices[idx + 0], 
    7983                                        geom->mVertices[idx + 1],  
    80                                                         geom->mVertices[idx + 0]); 
     84                                                        geom->mVertices[idx + 2]); 
    8185 
    8286                const SimpleVec n = tri.GetNormal(); 
Note: See TracChangeset for help on using the changeset viewer.