Changeset 6454 in orxonox.OLD for trunk/src/lib
- Timestamp:
- Jan 9, 2006, 11:20:37 PM (19 years ago)
- Location:
- trunk/src/lib/graphics/importer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/grid.cc
r6446 r6454 27 27 Grid::Grid(float sizeX, float sizeY, unsigned int rows, unsigned int columns) 28 28 { 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); 51 30 52 31 this->_rows = rows; -
trunk/src/lib/graphics/importer/grid.h
r6446 r6454 21 21 virtual ~Grid(); 22 22 23 void setSizeX(float sizeX) { this->_sizeX = sizeX; };24 void setSizeY(float sizeY) { this->_sizeY = sizeY; };25 26 23 float sizeX() const { return this->_sizeX; }; 27 24 float sizeY() const { return this->_sizeY; }; … … 29 26 unsigned int columns() const { return this->_columns; }; 30 27 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;}; 32 29 33 30 private: -
trunk/src/lib/graphics/importer/vertex_array_model.h
r6453 r6454 51 51 unsigned int indiceCount() const { return this->indices.size(); }; 52 52 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]; }; 55 58 // 56 59 void planeModel(float sizeX, float sizeY, unsigned int resolutionX, unsigned int resolutionY);
Note: See TracChangeset
for help on using the changeset viewer.