Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4235 in orxonox.OLD


Ignore:
Timestamp:
May 20, 2005, 1:58:07 AM (19 years ago)
Author:
patrick
Message:

orxonox/branches/md2_model: solved the orientation problems, translating coordinates into the right space now.

Location:
orxonox/branches/md2_loader/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/md2_loader/src/lib/graphics/importer/md2Model.cc

    r4234 r4235  
    562562  this->pVertices = new sVec3D[this->numVertices * this->numFrames];
    563563  this->pGLCommands = new int[this->numGLCommands];
    564   //this->pGLCommands2 = new int[this->numGLCommands];
    565564  this->pLightNormals = new int[this->numVertices * this->numFrames];
    566565  buffer = new char[this->numFrames * this->header->frameSize];
     
    572571  fseek(pFile, this->header->offsetGlCommands, SEEK_SET);
    573572  fread(this->pGLCommands, sizeof(int), this->numGLCommands, pFile);
    574   //fread(this->pGLCommands2, sizeof(glCommandVertex), this->numGLCommands, pFile);
    575573
    576574  for(int i = 0; i < this->numFrames; ++i)
     
    590588          /* SPEEDUP: *(pVerts + i + 0) = (*(frame->pVertices + i + 0)...  */
    591589          pVertex[j][0] = (frame->pVertices[j].v[0] * frame->scale[0]) + frame->translate[0];
    592           pVertex[j][1] = (frame->pVertices[j].v[1] * frame->scale[1]) + frame->translate[1];
    593           pVertex[j][2] = (frame->pVertices[j].v[2] * frame->scale[2]) + frame->translate[2];
     590          pVertex[j][1] = (frame->pVertices[j].v[2] * frame->scale[2]) + frame->translate[2];
     591          pVertex[j][2] = -(frame->pVertices[j].v[1] * frame->scale[1]) + frame->translate[1];
    594592         
    595593          //printf("pVertex %f, %f, %f\n", pVertex[j][0], pVertex[j][1], pVertex[j][2]);
     
    627625  nextVec = &this->pVertices[this->numVertices * this->animationState.nextFrame];
    628626
    629   //printf("currVec: %f, %f, %f\n", currVec[0][0], currVec[0][1], currVec[0][2]);
    630   //printf("nextVec: %f, %f, %f\n", nextVec[0][0], nextVec[1][1], nextVec[2][2]);
    631  
    632   //printf("numFrames: %i\n", this->numFrames);
    633   //printf("currentFrame: %i\n", this->animationState.currentFrame);
    634  
    635     //for(int i = 0; i < this->numFrames; ++i)
    636     for(int i = 0; i < this->numVertices; ++i)
     627    for(int i = 0; i < this->numFrames; ++i)
     628      //for(int i = 0; i < this->numVertices; ++i)
    637629      {
    638630        /*
     
    646638        verticesList[i][1] = (currVec[i][1] + this->animationState.interpolationState * (nextVec[i][1] - currVec[i][1])) * this->scaleFactor;
    647639        verticesList[i][2] = (currVec[i][2] + this->animationState.interpolationState * (nextVec[i][2] - currVec[i][2])) * this->scaleFactor;
    648 
    649 
    650         //printf("  pVertices %f, %f, %f\n", pVertices[i][0], pVertices[i][1], pVertices[i][2]);
    651         //printf("  list:     %f, %f, %f \n", verticesList[i][0], verticesList[i][1], verticesList[i][2]);     
    652640      }
    653641}
     
    715703  /* rotate because id software uses another orientation then the openGL default */
    716704  /* \todo: rotate the axis already when loading... easy :) */
    717   glRotatef(-90.0, 1.0, 0.0, 0.0);
    718   glRotatef(-90.0, 0.0, 0.0, 1.0);
     705  //glRotatef(-90.0, 1.0, 0.0, 0.0);
     706  //glRotatef(-90.0, 0.0, 0.0, 1.0);
    719707
    720708  this->renderFrame();
  • orxonox/branches/md2_loader/src/story_entities/world.cc

    r4215 r4235  
    488488
    489489  WorldEntity* testEntity = new TestEntity();
    490   testEntity->setRelCoor(Vector(570, 10, -15));
     490  //testEntity->setRelCoor(Vector(570, 10, -15));
     491  testEntity->setRelCoor(Vector(25, -10, -20));
    491492  testEntity->setRelDir(Quaternion(M_PI, Vector(0, 1, 0)));
    492493  this->spawn(testEntity);
    493   //this->localPlayer->addChild(testEntity);
     494  this->localPlayer->addChild(testEntity);
    494495
    495496}
Note: See TracChangeset for help on using the changeset viewer.