Changeset 3082 in orxonox.OLD for orxonox/trunk/importer
- Timestamp:
- Dec 4, 2004, 11:24:34 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/importer/object.cc
r3081 r3082 800 800 { 801 801 FaceElement* firstElem = tmpFace->firstElem; 802 FaceElement* prevElem = firstElem; 803 FaceElement* curElem = prevElem->next; 802 FaceElement* prevElem; 803 FaceElement* curElem = firstElem; 804 FaceElement* nextElem; 804 805 FaceElement* lastElem; 805 // closethe 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. 806 807 while (curElem) 807 808 { … … 810 811 } 811 812 lastElem = prevElem; 812 prevElem->next = firstElem;813 813 814 814 curElem = firstElem; 815 815 for (int j=0; j<tmpFace->vertexCount; j++) 816 816 { 817 if (!(nextElem = curElem->next)) 818 nextElem = firstElem; 817 819 curElem->normalNumber = curElem->vertexNumber; 818 820 819 821 curV = Vector (vertices->getArray()[curElem->vertexNumber*3], vertices->getArray()[curElem->vertexNumber*3+1], vertices->getArray()[curElem->vertexNumber*3+2]); 820 822 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; 822 824 normArray[curElem->vertexNumber] = normArray[curElem->vertexNumber] + nextV.cross(prevV); 823 825 824 if (curElem == firstElem )825 printf ("schnitt, %d\n", j);826 826 prevElem = curElem; 827 827 curElem = curElem->next; 828 828 } 829 // reopening the Chain again.830 lastElem->next = NULL;831 829 } 832 830 tmpFace = tmpFace->next;
Note: See TracChangeset
for help on using the changeset viewer.