Changeset 8576 in orxonox.OLD for branches/bsp_model
- Timestamp:
- Jun 18, 2006, 11:16:40 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/bsp_model/src/lib/graphics/importer/md3/md3_model.cc
r8574 r8576 90 90 { 91 91 //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]; 95 99 } 96 100 } … … 100 104 { 101 105 MD3Mesh* mesh = data->meshes[i]; 102 103 106 104 107 // get mesh frame, do interpolation if necessary 105 108 sVec3D* frame; 106 109 if( data->animationState.interpolationFraction != 0.0 && 107 data->animationState.currentFrame != data->animationState.nextFrame) { 110 data->animationState.currentFrame != data->animationState.nextFrame) 111 { 108 112 //interpolate mesh frame between the 2 current mesh frames 109 113 frame = this->interpolateMeshFrame( data->meshes[data->animationState.currentFrame]->meshFrames, 110 114 data->meshes[data->animationState.nextFrame]->meshFrames, 111 115 data->animationState.interpolationFraction, mesh, i); 112 113 else {114 //no interpolation needed, just draw current frame115 frame = &mesh->meshFrames[data->animationState.currentFrame];116 }117 118 this->drawMesh(mesh, frame);119 120 121 122 123 124 125 126 127 128 129 130 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 } 133 137 } 134 138 … … 333 337 //no normalization necessary, GL_NORMALIZE is enabled! 334 338 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); 350 354 351 355 … … 465 469 for( int t = 0; t < vertexNum * 3.0f; t++) 466 470 { 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 467 474 this->tmpMesh[i][t][0] = (1.0f - frac) * currMeshFrame[t][0] + frac * nextMeshFrame[t][0]; 468 475 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.