Changeset 4238 in orxonox.OLD for orxonox/branches/md2_loader
- Timestamp:
- May 20, 2005, 2:16:21 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/md2_loader/src/lib/graphics/importer/md2Model.cc
r4237 r4238 574 574 for(int i = 0; i < this->numFrames; ++i) 575 575 { 576 /*577 faster but evt. buggy578 576 frame = (sFrame*)(buffer + this->header->frameSize * i); 579 577 pVertex = this->pVertices + this->numVertices * i; 580 578 pNormals = this->pLightNormals + this->numVertices * i; 581 */582 frame = (sFrame *)&buffer[this->header->frameSize * i];583 pVertex = &this->pVertices[this->numVertices * i];584 pNormals = &this->pLightNormals[this->numVertices * i];585 579 586 580 for(int j = 0; j < this->numVertices; ++j) … … 591 585 pVertex[j][2] = -1.0 * (frame->pVertices[j].v[1] * frame->scale[1]) + frame->translate[1]; 592 586 593 //printf("pVertex %f, %f, %f\n", pVertex[j][0], pVertex[j][1], pVertex[j][2]);594 595 587 pNormals[j] = frame->pVertices[j].lightNormalIndex; 596 588 } … … 625 617 nextVec = &this->pVertices[this->numVertices * this->animationState.nextFrame]; 626 618 627 for(int i = 0; i < this->numFrames; ++i) 628 //for(int i = 0; i < this->numVertices; ++i) 629 { 630 /* 631 verticesList[i][0] = this->pVertices[i + (this->numFrames * this->animationState.currentFrame)][0] * this->scaleFactor; 632 verticesList[i][1] = this->pVertices[i + (this->numFrames * this->animationState.currentFrame)][1] * this->scaleFactor; 633 verticesList[i][2] = this->pVertices[i + (this->numFrames * this->animationState.currentFrame)][2] * this->scaleFactor; 634 */ 635 636 637 verticesList[i][0] = (currVec[i][0] + this->animationState.interpolationState * (nextVec[i][0] - currVec[i][0])) * this->scaleFactor; 638 verticesList[i][1] = (currVec[i][1] + this->animationState.interpolationState * (nextVec[i][1] - currVec[i][1])) * this->scaleFactor; 639 verticesList[i][2] = (currVec[i][2] + this->animationState.interpolationState * (nextVec[i][2] - currVec[i][2])) * this->scaleFactor; 640 } 619 for(int i = 0; i < this->numFrames; ++i) 620 { 621 verticesList[i][0] = (currVec[i][0] + this->animationState.interpolationState * (nextVec[i][0] - currVec[i][0])) * this->scaleFactor; 622 verticesList[i][1] = (currVec[i][1] + this->animationState.interpolationState * (nextVec[i][1] - currVec[i][1])) * this->scaleFactor; 623 verticesList[i][2] = (currVec[i][2] + this->animationState.interpolationState * (nextVec[i][2] - currVec[i][2])) * this->scaleFactor; 624 } 641 625 } 642 626 … … 738 722 for(; i > 0; i--, pCommands += 3) /* down counting for loop, next 3 gl commands */ 739 723 { 740 /* for quake2 lighting */741 //float l = shadeDots[this->pLightNormals[pCommands[2]]];742 //glColor3f(l * lcolor[0], l * lcolor[1], l * lcolor[2]);743 744 724 glNormal3fv(anorms[this->pLightNormals[pCommands[2]]]); 745 725 glTexCoord2f( ((float *)pCommands)[0], 1.0-((float *)pCommands)[1] ); 746 //printf("pCommands %f, %f\n", ((float *)pCommands)[0], ((float *)pCommands)[1]);747 726 glVertex3fv(verticesList[pCommands[2]]); 748 749 //printf("draw vert: %f, %f, %f\n", verticesLit[pCommands[2]][0], verticesList[pCommands[2]][1], verticesList[pCommands[2]][2] );750 727 } 751 728 glEnd();
Note: See TracChangeset
for help on using the changeset viewer.