Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4800 in orxonox.OLD


Ignore:
Timestamp:
Jul 6, 2005, 3:59:44 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: found the problem, got the offsets wrong in the triangle vertices indexes. there are still some unfilled triangles, will work in this one now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/graphics/importer/model.cc

    r4799 r4800  
    236236  */
    237237
    238   if(unlikely(this->triangles == NULL))
    239     return;
    240 
    241238  const GLfloat* pVertices = NULL;
    242239
     
    253250    glVertex3f(pVertices[0], pVertices[1], pVertices[2]);
    254251
    255 
    256 //     glVertex3fv(&this->vertices->getArray()[this->triangles[i].indexToVertices[1]]);
    257 //     glVertex3fv(&this->vertices->getArray()[this->triangles[i].indexToVertices[2]]);
    258252  }
    259253  glEnd();
     
    921915        for( int j = 0; j < 3; ++j)
    922916        {
    923           this->triangles[index].indexToVertices[j] = (unsigned int)tmpElem->vertexNumber;
    924           this->triangles[index].indexToTexCoor[j] = (unsigned int)tmpElem->texCoordNumber;
     917          this->triangles[index].indexToVertices[j] = (unsigned int)tmpElem->vertexNumber * 3;
     918          this->triangles[index].indexToTexCoor[j] = (unsigned int)tmpElem->texCoordNumber * 3;
    925919          tmpElem = tmpElem->next;
    926920        }
     
    930924      {
    931925
    932         this->triangles[index].indexToVertices[0] = (unsigned int)tmpElem->vertexNumber;
    933         this->triangles[index].indexToTexCoor[0] = (unsigned int)tmpElem->texCoordNumber;
    934 
    935         this->triangles[index + 1].indexToVertices[0] = (unsigned int)tmpElem->vertexNumber;
    936         this->triangles[index + 1].indexToTexCoor[0] = (unsigned int)tmpElem->texCoordNumber;
     926        this->triangles[index].indexToVertices[0] = (unsigned int)tmpElem->vertexNumber * 3;
     927        this->triangles[index].indexToTexCoor[0] = (unsigned int)tmpElem->texCoordNumber * 3;
     928
     929        this->triangles[index + 1].indexToVertices[0] = (unsigned int)tmpElem->vertexNumber * 3;
     930        this->triangles[index + 1].indexToTexCoor[0] = (unsigned int)tmpElem->texCoordNumber * 3;
    937931        tmpElem = tmpElem->next;
    938932
    939         this->triangles[index].indexToVertices[1] = (unsigned int)tmpElem->vertexNumber;
    940         this->triangles[index].indexToTexCoor[1] = (unsigned int)tmpElem->texCoordNumber;
    941 
    942         this->triangles[index + 1].indexToVertices[1] = (unsigned int)tmpElem->vertexNumber;
    943         this->triangles[index + 1].indexToTexCoor[1] = (unsigned int)tmpElem->texCoordNumber;
     933        this->triangles[index].indexToVertices[1] = (unsigned int)tmpElem->vertexNumber * 3;
     934        this->triangles[index].indexToTexCoor[1] = (unsigned int)tmpElem->texCoordNumber * 3;
     935
     936        this->triangles[index + 1].indexToVertices[1] = (unsigned int)tmpElem->vertexNumber * 3;
     937        this->triangles[index + 1].indexToTexCoor[1] = (unsigned int)tmpElem->texCoordNumber * 3;
    944938        tmpElem = tmpElem->next;
    945939
    946         this->triangles[index].indexToVertices[2] = (unsigned int)tmpElem->vertexNumber;
    947         this->triangles[index].indexToTexCoor[2] = (unsigned int)tmpElem->texCoordNumber;
     940        this->triangles[index].indexToVertices[2] = (unsigned int)tmpElem->vertexNumber * 3;
     941        this->triangles[index].indexToTexCoor[2] = (unsigned int)tmpElem->texCoordNumber * 3;
    948942        tmpElem = tmpElem->next;
    949943
    950         this->triangles[index + 1].indexToVertices[2] = (unsigned int)tmpElem->vertexNumber;
    951         this->triangles[index + 1].indexToTexCoor[2] = (unsigned int)tmpElem->texCoordNumber;
     944        this->triangles[index + 1].indexToVertices[2] = (unsigned int)tmpElem->vertexNumber * 3;
     945        this->triangles[index + 1].indexToTexCoor[2] = (unsigned int)tmpElem->texCoordNumber * 3;
    952946
    953947        index += 2;
Note: See TracChangeset for help on using the changeset viewer.