Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3082 in orxonox.OLD for orxonox/trunk/importer


Ignore:
Timestamp:
Dec 4, 2004, 11:24:34 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk/importer: FaceElements-Chain does not have to be changed anymore in the normal-Process

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/importer/object.cc

    r3081 r3082  
    800800            {
    801801              FaceElement* firstElem = tmpFace->firstElem;
    802               FaceElement* prevElem = firstElem;
    803               FaceElement* curElem = prevElem->next;
     802              FaceElement* prevElem;
     803              FaceElement* curElem = firstElem;
     804              FaceElement* nextElem;
    804805              FaceElement* lastElem;
    805               // close the Chain. !! IMPORTANT:the last Element of the Chain must point to NULL, or it will resolv into an infinity-loop.
     806              // find last Element of the Chain. !! IMPORTANT:the last Element of the Chain must point to NULL, or it will resolv into an infinity-loop.
    806807              while (curElem)
    807808                {
     
    810811                }
    811812              lastElem = prevElem;
    812               prevElem->next = firstElem;
    813813             
    814814              curElem = firstElem;
    815815              for (int j=0; j<tmpFace->vertexCount; j++)
    816816                {
     817                  if (!(nextElem = curElem->next))
     818                    nextElem = firstElem;
    817819                  curElem->normalNumber = curElem->vertexNumber;
    818820                 
    819821                  curV = Vector (vertices->getArray()[curElem->vertexNumber*3], vertices->getArray()[curElem->vertexNumber*3+1], vertices->getArray()[curElem->vertexNumber*3+2]);
    820822                  prevV = Vector (vertices->getArray()[prevElem->vertexNumber*3], vertices->getArray()[prevElem->vertexNumber*3+1], vertices->getArray()[prevElem->vertexNumber*3+2]) - curV;
    821                   nextV = Vector (vertices->getArray()[curElem->next->vertexNumber*3], vertices->getArray()[curElem->next->vertexNumber*3+1], vertices->getArray()[curElem->next->vertexNumber*3+2]) - curV;
     823                  nextV = Vector (vertices->getArray()[nextElem->vertexNumber*3], vertices->getArray()[nextElem->vertexNumber*3+1], vertices->getArray()[nextElem->vertexNumber*3+2]) - curV;
    822824                  normArray[curElem->vertexNumber] = normArray[curElem->vertexNumber] + nextV.cross(prevV);
    823825
    824                   if (curElem == firstElem )
    825                     printf ("schnitt, %d\n", j);
    826826                  prevElem = curElem;
    827827                  curElem = curElem->next;
    828828                }
    829               // reopening the Chain again.
    830               lastElem->next = NULL;
    831829            }
    832830          tmpFace = tmpFace->next;
Note: See TracChangeset for help on using the changeset viewer.