Changeset 6261 in orxonox.OLD for branches/height_map/src/lib/graphics/importer
- Timestamp:
- Dec 22, 2005, 5:39:18 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/height_map/src/lib/graphics/importer/vertex_array_model.cc
r6259 r6261 67 67 { 68 68 PRINTF(4)("drawing the 3D-VertexArrayModels\n"); 69 glDisable(GL_LIGHTING); 69 70 70 71 glEnableClientState(GL_VERTEX_ARRAY ); … … 79 80 glColorPointer(3, GL_FLOAT, 0, this->colors.getArray()); 80 81 81 // glDrawElements(GL_TRIANGLE_STRIP, this->indices.getCount(), GL_UNSIGNED_BYTE, this->indices.getArray());82 82 for (GLuint i = 1; i < this->stripes.size(); ++i) 83 83 { 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()); 90 91 } 92 glEnable(GL_LIGHTING); 91 93 } 92 94 … … 100 102 void VertexArrayModel::newStripe() 101 103 { 102 this->stripes.push_back(this-> vertices.getCount()-1);104 this->stripes.push_back(this->indices.getCount()); 103 105 } 104 106 … … 184 186 this->newStripe(); 185 187 188 for (int i = 0 ; i < this->stripes.size(); i++) 189 { 190 printf("== %d ==\n", stripes[i]); 191 192 } 193 186 194 /* 187 195 glEnableClientState(GL_VERTEX_ARRAY | … … 212 220 for (j = 0; j < sizeX; j++) 213 221 { 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); 215 223 this->addNormal((float)i/(float)sizeY, 1, (float)j/(float)sizeX); 216 224 this->addTexCoor((float)i/(float)sizeY, (float)j/(float)sizeY);
Note: See TracChangeset
for help on using the changeset viewer.