Changeset 4795 in orxonox.OLD for orxonox/trunk/src/lib/graphics/importer
- Timestamp:
- Jul 6, 2005, 1:39:33 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/importer/model.cc
r4794 r4795 833 833 834 834 int i = 0; //!< the counter for the triangle array 835 ModelFaceElement* tmpElem; //!< the temporary face element 835 ModelFaceElement* tmpElem; //!< the temporary faceelement reference 836 ModelFace* tmpFace; //!< the temporary face referece 836 837 837 838 /* now iterate through all groups and build up the triangle list */ … … 840 841 { 841 842 // Putting Faces to GL 842 ModelFace*tmpFace = this->currentGroup->firstFace;843 while (tmpFace != NULL)843 tmpFace = this->currentGroup->firstFace; 844 while( tmpFace != NULL) 844 845 { 845 846 tmpElem = tmpFace->firstElem; 846 847 847 848 /* if its a triangle just add it to the list */ 848 if (tmpFace->vertexCount == 3)849 if( tmpFace->vertexCount == 3) 849 850 { 850 for( int j = 0; j < 3; ++j)851 for( int j = 0; j < 3; ++j) 851 852 { 852 853 this->triangles[i].indexToVertices[j] = (unsigned int)tmpElem->vertexNumber; … … 854 855 tmpElem = tmpElem->next; 855 856 } 857 ++i; 858 } /* if the polygon is a quad */ 859 else if( tmpFace->vertexCount == 4) 860 { 861 862 this->triangles[i].indexToVertices[0] = (unsigned int)tmpElem->vertexNumber; 863 this->triangles[i].indexToTexCoor[0] = (unsigned int)tmpElem->texCoordNumber; 864 tmpElem = tmpElem->next; 865 866 this->triangles[i].indexToVertices[1] = (unsigned int)tmpElem->vertexNumber; 867 this->triangles[i].indexToTexCoor[1] = (unsigned int)tmpElem->texCoordNumber; 868 tmpElem = tmpElem->next; 869 870 this->triangles[i].indexToVertices[2] = (unsigned int)tmpElem->vertexNumber; 871 this->triangles[i].indexToTexCoor[2] = (unsigned int)tmpElem->texCoordNumber; 872 ++i; 873 874 this->triangles[i].indexToVertices[0] = (unsigned int)tmpElem->vertexNumber; 875 this->triangles[i].indexToTexCoor[0] = (unsigned int)tmpElem->texCoordNumber; 876 tmpElem = tmpElem->next; 877 878 this->triangles[i].indexToVertices[1] = (unsigned int)tmpElem->vertexNumber; 879 this->triangles[i].indexToTexCoor[1] = (unsigned int)tmpElem->texCoordNumber; 880 tmpElem = tmpElem->next; 881 882 this->triangles[i].indexToVertices[2] = (unsigned int)tmpElem->vertexNumber; 883 this->triangles[i].indexToTexCoor[2] = (unsigned int)tmpElem->texCoordNumber; 884 ++i; 856 885 } 857 858 ModelFaceElement* tmpElem = tmpFace->firstElem; 859 while (tmpElem != NULL) 860 { 861 // PRINTF(2)("%s\n", tmpElem->value); 862 this->addGLElement(tmpElem); 863 tmpElem = tmpElem->next; 864 } 865 tmpFace = tmpFace->next; 866 } 867 glEnd(); 868 glEndList(); 869 886 } 870 887 this->currentGroup = this->currentGroup->next; 871 888 }
Note: See TracChangeset
for help on using the changeset viewer.