Changeset 4802 in orxonox.OLD for orxonox/trunk/src/lib/graphics
- Timestamp:
- Jul 6, 2005, 4:28:52 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib/graphics/importer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/importer/abstract_model.h
r4794 r4802 77 77 { 78 78 unsigned int indexToVertices[3]; //!< index to the verteces of the triangle 79 unsigned int indexToNormals[3]; //!< index to the normals of the triangle 79 80 unsigned int indexToTexCoor[3]; //!< index to the texture coordinates 80 81 } sTriangleExt; -
orxonox/trunk/src/lib/graphics/importer/model.cc
r4801 r4802 237 237 238 238 const GLfloat* pVertices = NULL; 239 const GLfloat* pNorm = NULL; 239 240 240 241 glBegin(GL_TRIANGLES); 241 242 for( int i = 0; i < this->triangleCount; ++i) 242 243 { 244 //printf("int i = %i\n", i); 245 pNorm = &this->normals->getArray()[this->triangles[i].indexToNormals[0]]; 243 246 pVertices = &this->vertices->getArray()[this->triangles[i].indexToVertices[0]]; 247 glNormal3f(pNorm[0], pNorm[1], pNorm[2]); 244 248 glVertex3f(pVertices[0], pVertices[1], pVertices[2]); 245 249 250 pNorm = &this->normals->getArray()[this->triangles[i].indexToNormals[1]]; 246 251 pVertices = &this->vertices->getArray()[this->triangles[i].indexToVertices[1]]; 252 glNormal3f(pNorm[0], pNorm[1], pNorm[2]); 247 253 glVertex3f(pVertices[0], pVertices[1], pVertices[2]); 248 254 255 pNorm = &this->normals->getArray()[this->triangles[i].indexToNormals[2]]; 249 256 pVertices = &this->vertices->getArray()[this->triangles[i].indexToVertices[2]]; 257 glNormal3f(pNorm[0], pNorm[1], pNorm[2]); 250 258 glVertex3f(pVertices[0], pVertices[1], pVertices[2]); 251 259 … … 916 924 { 917 925 this->triangles[index].indexToVertices[j] = (unsigned int)tmpElem->vertexNumber * 3; 926 this->triangles[index].indexToNormals[j] = (unsigned int)tmpElem->normalNumber * 3; 918 927 this->triangles[index].indexToTexCoor[j] = (unsigned int)tmpElem->texCoordNumber * 3; 919 928 tmpElem = tmpElem->next; … … 925 934 926 935 this->triangles[index].indexToVertices[0] = (unsigned int)tmpElem->vertexNumber * 3; 936 this->triangles[index].indexToNormals[0] = (unsigned int)tmpElem->normalNumber * 3; 927 937 this->triangles[index].indexToTexCoor[0] = (unsigned int)tmpElem->texCoordNumber * 3; 928 938 929 939 this->triangles[index + 1].indexToVertices[0] = (unsigned int)tmpElem->vertexNumber * 3; 940 this->triangles[index + 1].indexToNormals[0] = (unsigned int)tmpElem->normalNumber * 3; 930 941 this->triangles[index + 1].indexToTexCoor[0] = (unsigned int)tmpElem->texCoordNumber * 3; 931 942 tmpElem = tmpElem->next; 932 943 933 944 this->triangles[index].indexToVertices[1] = (unsigned int)tmpElem->vertexNumber * 3; 945 this->triangles[index].indexToNormals[1] = (unsigned int)tmpElem->normalNumber * 3; 934 946 this->triangles[index].indexToTexCoor[1] = (unsigned int)tmpElem->texCoordNumber * 3; 935 947 tmpElem = tmpElem->next; 936 948 937 949 this->triangles[index].indexToVertices[2] = (unsigned int)tmpElem->vertexNumber * 3; 950 this->triangles[index].indexToNormals[2] = (unsigned int)tmpElem->normalNumber * 3; 938 951 this->triangles[index].indexToTexCoor[2] = (unsigned int)tmpElem->texCoordNumber * 3; 939 952 940 953 this->triangles[index + 1].indexToVertices[2] = (unsigned int)tmpElem->vertexNumber * 3; 954 this->triangles[index + 1].indexToNormals[2] = (unsigned int)tmpElem->normalNumber * 3; 941 955 this->triangles[index + 1].indexToTexCoor[2] = (unsigned int)tmpElem->texCoordNumber * 3; 942 956 tmpElem = tmpElem->next; 943 957 944 958 this->triangles[index + 1].indexToVertices[1] = (unsigned int)tmpElem->vertexNumber * 3; 959 this->triangles[index + 1].indexToNormals[1] = (unsigned int)tmpElem->normalNumber * 3; 945 960 this->triangles[index + 1].indexToTexCoor[1] = (unsigned int)tmpElem->texCoordNumber * 3; 946 961
Note: See TracChangeset
for help on using the changeset viewer.