Changeset 3079 in orxonox.OLD for orxonox/trunk/importer
- Timestamp:
- Dec 4, 2004, 10:13:45 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/importer/object.cc
r3078 r3079 767 767 } 768 768 769 769 /** 770 \brief A routine that is able to create normals. 771 The algorithm does the following: 772 1. It calculates creates Vectors for each normale, and sets them to zero. 773 2. It then Walks through a) all the Groups b) all the Faces c) all the FaceElements 774 3. It searches for a points two neighbours per Face, takes Vecotrs to them calculates FaceNormals and adds it to the Points Normal. 775 4. It goes through all the normale-Points and calculates the VertexNormale and includes it in the normals-Array. 776 */ 770 777 bool Object::buildVertexNormals () 771 778 { 779 if (verbose >=2) 780 printf("Normals are being calculated.\n"); 772 781 773 782 Vector* normArray = new Vector [vertices->getCount()/3]; 774 for (int i=0; i< =vertices->getCount()/3;i++)783 for (int i=0; i<vertices->getCount()/3;i++) 775 784 normArray[i] = Vector(.0,.0,.0); 776 785 … … 823 832 { 824 833 normArray[i].normalize(); 825 // printf("%f, %f, %f.\n",normArray[i].x, normArray[i].y, normArray[i].z ); 834 if (verbose >=3) 835 printf ("Found Normale number %d: (%f; %f, %f).\n", i, normArray[i].x, normArray[i].y, normArray[i].z); 836 826 837 normals->addEntry(normArray[i].x, normArray[i].y, normArray[i].z); 827 838 828 839 } 829 delete [] 840 delete []normArray; 830 841 } 831 842
Note: See TracChangeset
for help on using the changeset viewer.