Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6454 in orxonox.OLD


Ignore:
Timestamp:
Jan 9, 2006, 11:20:37 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: changing the height of the Grid should work

Location:
trunk/src/lib/graphics/importer
Files:
3 edited

Legend:

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

    r6446 r6454  
    2727Grid::Grid(float sizeX, float sizeY, unsigned int rows, unsigned int columns)
    2828{
    29 
    30   GLuint i, j;
    31   for (i = 0; i < rows; i++)
    32   {
    33     for (j = 0; j < columns; j++)
    34     {
    35       this->addVertex((float)i - (float)sizeY/2.0, 0.0, (float)j - (float)sizeX/2.0);
    36       this->addNormal(0.0, 1, 0.0);
    37       this->addTexCoor((float)i/(float)columns, (float)j/(float)rows);
    38       this->addColor((float)i/20.0, 0.0, (float)j/20.0);
    39     }
    40   }
    41 
    42   for (i = 0; i < rows-1; i++)
    43   {
    44     for (j = 0; j < columns; j++)
    45     {
    46       this->addIndice( rows*i + j );
    47       this->addIndice( rows*(i+1) + j );
    48     }
    49     this->newStripe();
    50   }
     29  this->planeModel(sizeX, sizeY, rows, columns);
    5130
    5231  this->_rows = rows;
  • trunk/src/lib/graphics/importer/grid.h

    r6446 r6454  
    2121  virtual ~Grid();
    2222
    23   void setSizeX(float sizeX) { this->_sizeX = sizeX; };
    24   void setSizeY(float sizeY) { this->_sizeY = sizeY; };
    25 
    2623  float sizeX() const { return this->_sizeX; };
    2724  float sizeY() const { return this->_sizeY; };
     
    2926  unsigned int columns() const { return this->_columns; };
    3027
    31   float& height(unsigned int row, unsigned int column);
     28  float& height(unsigned int row, unsigned int column) { return this->vertex(row*_columns + row).y;};
    3229
    3330private:
  • trunk/src/lib/graphics/importer/vertex_array_model.h

    r6453 r6454  
    5151  unsigned int indiceCount() const { return this->indices.size(); };
    5252
    53 //  float& vertex(unsigned int i) { return this->vertices[i]; };
    54 
     53  Vector& vertex(unsigned int i) { return this->vertices[i]; };
     54  Vector& normal(unsigned int i) { return this->normals[i]; };
     55  //Vector& texCoord(unsigned int i) { return this->texCoord[i]; };
     56  Vector& color(unsigned int i) { return this->colors[i]; };
     57  GLuint  index(unsigned int i) { return this->indices[i]; };
    5558  //
    5659  void planeModel(float sizeX, float sizeY, unsigned int resolutionX, unsigned int resolutionY);
Note: See TracChangeset for help on using the changeset viewer.