Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 22, 2005, 5:39:18 PM (19 years ago)
Author:
bensch
Message:

heightmap: better stipes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/height_map/src/lib/graphics/importer/vertex_array_model.cc

    r6259 r6261  
    6767{
    6868  PRINTF(4)("drawing the 3D-VertexArrayModels\n");
     69  glDisable(GL_LIGHTING);
    6970
    7071  glEnableClientState(GL_VERTEX_ARRAY );
     
    7980  glColorPointer(3, GL_FLOAT, 0, this->colors.getArray());
    8081
    81 //      glDrawElements(GL_TRIANGLE_STRIP, this->indices.getCount(), GL_UNSIGNED_BYTE, this->indices.getArray());
    8282  for (GLuint i = 1; i < this->stripes.size(); ++i)
    8383    {
    84       glDrawRangeElements(GL_TRIANGLE_STRIP,
    85                           this->stripes[i-1],
    86                           this->stripes[i],
    87                           this->indices.getCount(),
    88                           GL_UNSIGNED_BYTE,
    89                           this->indices.getArray());
     84      glDrawElements(GL_TRIANGLE_STRIP, this->stripes[i] - this->stripes[i-1], GL_UNSIGNED_BYTE, this->indices.getArray()+this->stripes[i-1]);
     85//       glDrawRangeElements(GL_TRIANGLE_STRIP,
     86//                        this->stripes[i-1],
     87//                        this->stripes[i],
     88//                        this->indices.getCount(),
     89//                        GL_UNSIGNED_BYTE,
     90//                        this->indices.getArray());
    9091    }
     92    glEnable(GL_LIGHTING);
    9193}
    9294
     
    100102void VertexArrayModel::newStripe()
    101103{
    102   this->stripes.push_back(this->vertices.getCount()-1);
     104  this->stripes.push_back(this->indices.getCount());
    103105}
    104106
     
    184186  this->newStripe();
    185187
     188  for (int i = 0 ; i < this->stripes.size(); i++)
     189  {
     190    printf("== %d ==\n", stripes[i]);
     191
     192  }
     193
    186194  /*
    187195    glEnableClientState(GL_VERTEX_ARRAY |
     
    212220      for (j = 0; j < sizeX; j++)
    213221        {
    214           this->addVertex((float)i - sizeY/2.0, -(float)i * (float)j/(float)sizeY/(float)sizeX * 10.0 , (float)(j) - sizeX/2.0);
     222          this->addVertex((float)i - sizeY/2.0, sin(-(float)i/(float)sizeY*5.0) * cos((float)j/(float)sizeX*5.0) * 10.0 , (float)(j) - sizeX/2.0);
    215223          this->addNormal((float)i/(float)sizeY, 1, (float)j/(float)sizeX);
    216224          this->addTexCoor((float)i/(float)sizeY, (float)j/(float)sizeY);
Note: See TracChangeset for help on using the changeset viewer.