Changeset 6181 in orxonox.OLD for branches/christmas_branche/src/lib/graphics/importer
- Timestamp:
- Dec 20, 2005, 3:45:53 AM (19 years ago)
- Location:
- branches/christmas_branche/src/lib/graphics/importer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/christmas_branche/src/lib/graphics/importer/md2Model.cc
r6180 r6181 177 177 { 178 178 glPushMatrix(); 179 this->renderFrame(); 179 // this->renderFrame(); 180 renderFrameTriangles(); 180 181 glPopMatrix(); 181 182 } … … 223 224 glPopAttrib(); 224 225 } 226 227 228 229 230 231 void MD2Model::renderFrameTriangles() const 232 { 233 static sVec3D verticesList[MD2_MAX_VERTICES]; /* performance: created only once in a lifetime */ 234 int* pCommands = this->data->pGLCommands; 235 /* some face culling stuff */ 236 // glPushAttrib(GL_POLYGON_BIT); 237 // glFrontFace(GL_CW); 238 // glEnable(GL_CULL_FACE); 239 // glCullFace(GL_BACK); 240 241 // this->processLighting(); 242 // this->interpolate(/*verticesList*/); 243 this->data->material->select(); 244 245 /* draw the triangles */ 246 glBegin(GL_TRIANGLES); 247 248 for( int i = 0, k = 0; i < this->data->numTriangles; ++i, k += 3) 249 { 250 //printf("%i: (%f, %f)\n", i, (float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[2]].s, (float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[2]].t); 251 252 glTexCoord2f((float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[0]].s, 253 (float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[0]].t); 254 //glNormal3f(Md2Model.normal[i].x, Md2Model.normal[i].y, Md2Model.normal[i].z); 255 glVertex3fv(this->data->pVertices[this->data->pTriangles[i].indexToVertices[0]]); 256 257 glTexCoord2f((float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[1]].s, 258 (float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[1]].t); 259 260 // glNormal3f(Md2Model.normal[i].x, Md2Model.normal[i].y, Md2Model.normal[i].z); 261 glVertex3fv(this->data->pVertices[this->data->pTriangles[i].indexToVertices[1]]); 262 263 glTexCoord2f((float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[2]].s, 264 (float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[2]].t); 265 // glNormal3f(Md2Model.normal[i].x, Md2Model.normal[i].y, Md2Model.normal[i].z); 266 glVertex3fv(this->data->pVertices[this->data->pTriangles[i].indexToVertices[2]]); 267 } 268 269 glEnd(); 270 } 271 272 273 274 275 276 277 278 279 280 281 225 282 226 283 -
branches/christmas_branche/src/lib/graphics/importer/md2Model.h
r6180 r6181 214 214 215 215 virtual void draw() const; 216 void renderFrameTriangles() const; 217 216 218 217 219 void setAnim(int type);
Note: See TracChangeset
for help on using the changeset viewer.