Changeset 6184 in orxonox.OLD for branches/christmas_branche/src/lib/graphics/importer/md2Model.cc
- Timestamp:
- Dec 20, 2005, 1:44:21 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/christmas_branche/src/lib/graphics/importer/md2Model.cc
r6181 r6184 92 92 this->scaleFactor = this->data->scaleFactor; 93 93 this->setAnim(STAND); 94 95 this->debug(); 94 96 } 95 97 … … 119 121 currVec = &this->data->pVertices[this->data->numVertices * this->animationState.currentFrame]; 120 122 nextVec = &this->data->pVertices[this->data->numVertices * this->animationState.nextFrame]; 123 PRINTF(0)("current frame nr %i, next frame nr %i\n", this->animationState.currentFrame, this->animationState.nextFrame); 124 121 125 122 126 for( int i = 0; i < this->data->numVertices; ++i) … … 177 181 { 178 182 glPushMatrix(); 179 //this->renderFrame();183 //this->renderFrame(); 180 184 renderFrameTriangles(); 181 185 glPopMatrix(); … … 231 235 void MD2Model::renderFrameTriangles() const 232 236 { 233 static sVec3D verticesList[MD2_MAX_VERTICES]; /* performance: created only once in a lifetime */237 //static sVec3D verticesList[MD2_MAX_VERTICES]; /* performance: created only once in a lifetime */ 234 238 int* pCommands = this->data->pGLCommands; 235 239 /* some face culling stuff */ … … 248 252 for( int i = 0, k = 0; i < this->data->numTriangles; ++i, k += 3) 249 253 { 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); 254 float* v = this->data->pVertices[this->data->pTriangles[i].indexToVertices[0]]; 255 256 printf("triangle: %i\n", i); 257 printf(" v0: (%f, %f, %f)\n", v[0], v[1], v[2]); 258 v = this->data->pVertices[this->data->pTriangles[i].indexToVertices[1]]; 259 printf(" v1: (%f, %f, %f)\n", v[0], v[1], v[2]); 260 v = this->data->pVertices[this->data->pTriangles[i].indexToVertices[2]]; 261 printf(" v2: (%f, %f, %f)\n", v[0], v[1], v[2]); 262 263 264 glNormal3f(anorms[i][0], anorms[i][1], anorms[i][2]); 255 265 glVertex3fv(this->data->pVertices[this->data->pTriangles[i].indexToVertices[0]]); 256 266 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); 267 glNormal3f(anorms[i][0], anorms[i][1], anorms[i][2]); 261 268 glVertex3fv(this->data->pVertices[this->data->pTriangles[i].indexToVertices[1]]); 262 269 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); 270 glNormal3f(anorms[i][0], anorms[i][1], anorms[i][2]); 266 271 glVertex3fv(this->data->pVertices[this->data->pTriangles[i].indexToVertices[2]]); 267 272 } … … 269 274 glEnd(); 270 275 } 271 272 273 274 275 276 277 278 279 280 276 281 277 … … 451 447 for(int i = 0; i < this->numFrames; ++i) 452 448 { 449 printf("==============vertex loading for frame %i/%i========\n", i, this->numFrames); 453 450 frame = (sFrame*)(buffer + this->header->frameSize * i); 454 451 pVertex = this->pVertices + this->numVertices * i; … … 462 459 pVertex[j][2] = (-1.0 * (frame->pVertices[j].v[1] * frame->scale[1] + frame->translate[1])) * this->scaleFactor; 463 460 461 printf("vertex %i/%i: (%f, %f, %f)\n", j, this->numVertices, pVertex[j][0], pVertex[j][1], pVertex[j][2]); 462 464 463 pNormals[j] = frame->pVertices[j].lightNormalIndex; 465 464 }
Note: See TracChangeset
for help on using the changeset viewer.