Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8576 in orxonox.OLD for branches


Ignore:
Timestamp:
Jun 18, 2006, 11:16:40 PM (18 years ago)
Author:
patrick
Message:

bsp: md3 found one bug, working on it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/bsp_model/src/lib/graphics/importer/md3/md3_model.cc

    r8574 r8576  
    9090      {
    9191        //interpolate bone frame
    92         this->interpolateBoneFrame(data->boneFrames[data->animationState.currentFrame],
    93                                    data->boneFrames[data->animationState.nextFrame],
    94                                    data->animationState.interpolationFraction);
     92        this->tmpBoneFrame = this->interpolateBoneFrame(data->boneFrames[data->animationState.currentFrame],
     93                                                        data->boneFrames[data->animationState.nextFrame],
     94                                                        data->animationState.interpolationFraction);
     95      }
     96      else
     97      {
     98        this->tmpBoneFrame = data->boneFrames[data->animationState.currentFrame];
    9599      }
    96100    }
     
    100104    {
    101105      MD3Mesh* mesh = data->meshes[i];
    102 
    103106
    104107      // get mesh frame, do interpolation if necessary
    105108      sVec3D* frame;
    106109      if( data->animationState.interpolationFraction != 0.0 &&
    107           data->animationState.currentFrame != data->animationState.nextFrame) {
     110          data->animationState.currentFrame != data->animationState.nextFrame)
     111      {
    108112        //interpolate mesh frame between the 2 current mesh frames
    109113        frame = this->interpolateMeshFrame( data->meshes[data->animationState.currentFrame]->meshFrames,
    110114                                            data->meshes[data->animationState.nextFrame]->meshFrames,
    111115                                            data->animationState.interpolationFraction, mesh, i);
    112           }
    113           else {
    114             //no interpolation needed, just draw current frame
    115             frame = &mesh->meshFrames[data->animationState.currentFrame];
    116           }
    117 
    118           this->drawMesh(mesh, frame);
    119 
    120           // draw vertex normals if needed
    121           if( this->bDrawNormals)
    122           {
    123             // get vertex normals, interpolate if necessary
    124             if( data->animationState.interpolationFraction != 0.0 &&
    125                 data->animationState.currentFrame != data->animationState.nextFrame)
    126             {
    127               //interpolate vertex normals
    128               this->interpolateVertexNormals(&mesh->normals[data->animationState.currentFrame],
    129                                               &mesh->normals[data->animationState.nextFrame],
    130                                               data->animationState.interpolationFraction, mesh, i);
    131              }
    132           }
     116      }
     117      else
     118      {
     119        //no interpolation needed, just draw current frame
     120        frame = &mesh->meshFrames[data->animationState.currentFrame];
     121      }
     122      this->tmpMesh = &frame;
     123
     124      // draw vertex normals if needed
     125      if( this->bDrawNormals)
     126      {
     127        // get vertex normals, interpolate if necessary
     128        if( data->animationState.interpolationFraction != 0.0 &&
     129            data->animationState.currentFrame != data->animationState.nextFrame)
     130        {
     131          //interpolate vertex normals
     132          this->interpolateVertexNormals(&mesh->normals[data->animationState.currentFrame],
     133                                         &mesh->normals[data->animationState.nextFrame],
     134                                         data->animationState.interpolationFraction, mesh, i);
     135        }
     136      }
    133137    }
    134138
     
    333337      //no normalization necessary, GL_NORMALIZE is enabled!
    334338
    335       PRINTF(0)("drawing vertex: %f, %f, %f, normal: %f, %f\n",
    336       frame[mesh->triangles[t].vertexOffset[0]][0],
    337       frame[mesh->triangles[t].vertexOffset[0]][1],
    338       frame[mesh->triangles[t].vertexOffset[0]][2],
    339                normal.x, normal.y, normal.z);
    340       PRINTF(0)("drawing vertex: %f, %f, %f, normal: %f, %f\n",
    341       frame[mesh->triangles[t].vertexOffset[1]][0],
    342       frame[mesh->triangles[t].vertexOffset[1]][1],
    343       frame[mesh->triangles[t].vertexOffset[1]][2],
    344       normal.x, normal.y, normal.z);
    345       PRINTF(0)("drawing vertex: %f, %f, %f, normal: %f, %f\n",
    346       frame[mesh->triangles[t].vertexOffset[2]][0],
    347       frame[mesh->triangles[t].vertexOffset[2]][1],
    348       frame[mesh->triangles[t].vertexOffset[2]][2],
    349       normal.x, normal.y, normal.z);
     339//       PRINTF(0)("drawing vertex: %f, %f, %f, normal: %f, %f\n",
     340//       frame[mesh->triangles[t].vertexOffset[0]][0],
     341//       frame[mesh->triangles[t].vertexOffset[0]][1],
     342//       frame[mesh->triangles[t].vertexOffset[0]][2],
     343//                normal.x, normal.y, normal.z);
     344//       PRINTF(0)("drawing vertex: %f, %f, %f, normal: %f, %f\n",
     345//       frame[mesh->triangles[t].vertexOffset[1]][0],
     346//       frame[mesh->triangles[t].vertexOffset[1]][1],
     347//       frame[mesh->triangles[t].vertexOffset[1]][2],
     348//       normal.x, normal.y, normal.z);
     349//       PRINTF(0)("drawing vertex: %f, %f, %f, normal: %f, %f\n",
     350//       frame[mesh->triangles[t].vertexOffset[2]][0],
     351//       frame[mesh->triangles[t].vertexOffset[2]][1],
     352//       frame[mesh->triangles[t].vertexOffset[2]][2],
     353//       normal.x, normal.y, normal.z);
    350354
    351355
     
    465469    for( int t = 0; t < vertexNum * 3.0f; t++)
    466470    {
     471
     472//       PRINTF(0)("tmp mesh: %f, %f, %f\n", this->tmpMesh[i][t][0], this->tmpMesh[i][t][1], this->tmpMesh[i][t][2]);
     473
    467474      this->tmpMesh[i][t][0]  = (1.0f - frac)   * currMeshFrame[t][0]  + frac * nextMeshFrame[t][0];
    468475      this->tmpMesh[i][t][1]  = (1.0f - frac)   * currMeshFrame[t][1]  + frac * nextMeshFrame[t][1];
Note: See TracChangeset for help on using the changeset viewer.