├── .gitignore ├── README.md ├── main.cpp ├── man ├── diffuse.png └── model.dae ├── simple └── model.dae └── utils.h /.gitignore: -------------------------------------------------------------------------------- 1 | Debug/ 2 | KHR/ 3 | packages.config 4 | stb_image.h 5 | glad.h 6 | glad.c 7 | dyna.vcxproj 8 | Dyna.vcxproj.filters 9 | Dyna.vcxproj.user 10 | 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OPENGL SKELETAL ANIMATION WITH ASSIMP 2 | 3 | this is a demo project that shows how to do skeletal or skin animation using assimp, glm, and opengl. Feel free to use this code if needed. 4 | 5 | 6 | ## NOTES 7 | - I have used stb_image.h library to load texture image 8 | - This demo assumes that the model has only one mesh and texture. But for more meshes the process is almost same. 9 | 10 | -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "glad.h" 8 | #include 9 | #define STB_IMAGE_IMPLEMENTATION 10 | #include "stb_image.h" 11 | 12 | 13 | /* 14 | opengl skeletal animation demo 15 | */ 16 | 17 | 18 | const char* vertexShaderSource = R"( 19 | #version 440 core 20 | layout (location = 0) in vec3 position; 21 | layout (location = 1) in vec3 normal; 22 | layout (location = 2) in vec2 uv; 23 | layout (location = 3) in vec4 boneIds; 24 | layout (location = 4) in vec4 boneWeights; 25 | 26 | out vec2 tex_cord; 27 | out vec3 v_normal; 28 | out vec3 v_pos; 29 | out vec4 bw; 30 | 31 | uniform mat4 bone_transforms[50]; 32 | uniform mat4 view_projection_matrix; 33 | uniform mat4 model_matrix; 34 | 35 | void main() 36 | { 37 | bw = vec4(0); 38 | if(int(boneIds.x) == 1) 39 | bw.z = boneIds.x; 40 | //boneWeights = normalize(boneWeights); 41 | mat4 boneTransform = mat4(0.0); 42 | boneTransform += bone_transforms[int(boneIds.x)] * boneWeights.x; 43 | boneTransform += bone_transforms[int(boneIds.y)] * boneWeights.y; 44 | boneTransform += bone_transforms[int(boneIds.z)] * boneWeights.z; 45 | boneTransform += bone_transforms[int(boneIds.w)] * boneWeights.w; 46 | vec4 pos =boneTransform * vec4(position, 1.0); 47 | gl_Position = view_projection_matrix * model_matrix * pos; 48 | v_pos = vec3(model_matrix * boneTransform * pos); 49 | tex_cord = uv; 50 | v_normal = mat3(transpose(inverse(model_matrix * boneTransform))) * normal; 51 | v_normal = normalize(v_normal); 52 | } 53 | 54 | )"; 55 | const char* fragmentShaderSource = R"( 56 | #version 440 core 57 | 58 | in vec2 tex_cord; 59 | in vec3 v_normal; 60 | in vec3 v_pos; 61 | in vec4 bw; 62 | out vec4 color; 63 | 64 | uniform sampler2D diff_texture; 65 | 66 | vec3 lightPos = vec3(0.2, 1.0, -3.0); 67 | 68 | void main() 69 | { 70 | vec3 lightDir = normalize(lightPos - v_pos); 71 | float diff = max(dot(v_normal, lightDir), 0.2); 72 | vec3 dCol = diff * texture(diff_texture, tex_cord).rgb; 73 | color = vec4(dCol, 1); 74 | } 75 | )"; 76 | 77 | 78 | // vertex of an animated model 79 | struct Vertex { 80 | glm::vec3 position; 81 | glm::vec3 normal; 82 | glm::vec2 uv; 83 | glm::vec4 boneIds = glm::vec4(0); 84 | glm::vec4 boneWeights = glm::vec4(0.0f); 85 | }; 86 | 87 | // structure to hold bone tree (skeleton) 88 | struct Bone { 89 | int id = 0; // position of the bone in final upload array 90 | std::string name = ""; 91 | glm::mat4 offset = glm::mat4(1.0f); 92 | std::vector children = {}; 93 | }; 94 | 95 | // sturction representing an animation track 96 | struct BoneTransformTrack { 97 | std::vector positionTimestamps = {}; 98 | std::vector rotationTimestamps = {}; 99 | std::vector scaleTimestamps = {}; 100 | 101 | std::vector positions = {}; 102 | std::vector rotations = {}; 103 | std::vector scales = {}; 104 | }; 105 | 106 | // structure containing animation information 107 | struct Animation { 108 | float duration = 0.0f; 109 | float ticksPerSecond = 1.0f; 110 | std::unordered_map boneTransforms = {}; 111 | }; 112 | 113 | 114 | 115 | // a recursive function to read all bones and form skeleton 116 | bool readSkeleton(Bone& boneOutput, aiNode* node, std::unordered_map>& boneInfoTable) { 117 | 118 | if (boneInfoTable.find(node->mName.C_Str()) != boneInfoTable.end()) { // if node is actually a bone 119 | boneOutput.name = node->mName.C_Str(); 120 | boneOutput.id = boneInfoTable[boneOutput.name].first; 121 | boneOutput.offset = boneInfoTable[boneOutput.name].second; 122 | 123 | for (int i = 0; i < node->mNumChildren; i++) { 124 | Bone child; 125 | readSkeleton(child, node->mChildren[i], boneInfoTable); 126 | boneOutput.children.push_back(child); 127 | } 128 | return true; 129 | } 130 | else { // find bones in children 131 | for (int i = 0; i < node->mNumChildren; i++) { 132 | if (readSkeleton(boneOutput, node->mChildren[i], boneInfoTable)) { 133 | return true; 134 | } 135 | 136 | } 137 | } 138 | return false; 139 | } 140 | 141 | void loadModel(const aiScene* scene, aiMesh* mesh, std::vector& verticesOutput, std::vector& indicesOutput, Bone& skeletonOutput, uint &nBoneCount) { 142 | 143 | verticesOutput = {}; 144 | indicesOutput = {}; 145 | //load position, normal, uv 146 | for (unsigned int i = 0; i < mesh->mNumVertices; i++) { 147 | //process position 148 | Vertex vertex; 149 | glm::vec3 vector; 150 | vector.x = mesh->mVertices[i].x; 151 | vector.y = mesh->mVertices[i].y; 152 | vector.z = mesh->mVertices[i].z; 153 | vertex.position = vector; 154 | //process normal 155 | vector.x = mesh->mNormals[i].x; 156 | vector.y = mesh->mNormals[i].y; 157 | vector.z = mesh->mNormals[i].z; 158 | vertex.normal = vector; 159 | //process uv 160 | glm::vec2 vec; 161 | vec.x = mesh->mTextureCoords[0][i].x; 162 | vec.y = mesh->mTextureCoords[0][i].y; 163 | vertex.uv = vec; 164 | 165 | vertex.boneIds = glm::ivec4(0); 166 | vertex.boneWeights = glm::vec4(0.0f); 167 | 168 | verticesOutput.push_back(vertex); 169 | } 170 | 171 | //load boneData to vertices 172 | std::unordered_map> boneInfo = {}; 173 | std::vector boneCounts; 174 | boneCounts.resize(verticesOutput.size(), 0); 175 | nBoneCount = mesh->mNumBones; 176 | 177 | //loop through each bone 178 | for (uint i = 0; i < nBoneCount; i++) { 179 | aiBone* bone = mesh->mBones[i]; 180 | glm::mat4 m = assimpToGlmMatrix(bone->mOffsetMatrix); 181 | boneInfo[bone->mName.C_Str()] = { i, m }; 182 | 183 | //loop through each vertex that have that bone 184 | for (int j = 0; j < bone->mNumWeights; j++) { 185 | uint id = bone->mWeights[j].mVertexId; 186 | float weight = bone->mWeights[j].mWeight; 187 | boneCounts[id]++; 188 | switch (boneCounts[id]) { 189 | case 1: 190 | verticesOutput[id].boneIds.x = i; 191 | verticesOutput[id].boneWeights.x = weight; 192 | break; 193 | case 2: 194 | verticesOutput[id].boneIds.y = i; 195 | verticesOutput[id].boneWeights.y = weight; 196 | break; 197 | case 3: 198 | verticesOutput[id].boneIds.z = i; 199 | verticesOutput[id].boneWeights.z = weight; 200 | break; 201 | case 4: 202 | verticesOutput[id].boneIds.w = i; 203 | verticesOutput[id].boneWeights.w = weight; 204 | break; 205 | default: 206 | //std::cout << "err: unable to allocate bone to vertex" << std::endl; 207 | break; 208 | 209 | } 210 | } 211 | } 212 | 213 | 214 | 215 | //normalize weights to make all weights sum 1 216 | for (int i = 0; i < verticesOutput.size(); i++) { 217 | glm::vec4 & boneWeights = verticesOutput[i].boneWeights; 218 | float totalWeight = boneWeights.x + boneWeights.y + boneWeights.z + boneWeights.w; 219 | if (totalWeight > 0.0f) { 220 | verticesOutput[i].boneWeights = glm::vec4( 221 | boneWeights.x / totalWeight, 222 | boneWeights.y / totalWeight, 223 | boneWeights.z / totalWeight, 224 | boneWeights.w / totalWeight 225 | ); 226 | } 227 | } 228 | 229 | 230 | //load indices 231 | for (int i = 0; i < mesh->mNumFaces; i++) { 232 | aiFace& face = mesh->mFaces[i]; 233 | for (unsigned int j = 0; j < face.mNumIndices; j++) 234 | indicesOutput.push_back(face.mIndices[j]); 235 | } 236 | 237 | // create bone hirerchy 238 | readSkeleton(skeletonOutput, scene->mRootNode, boneInfo); 239 | } 240 | 241 | void loadAnimation(const aiScene* scene, Animation& animation) { 242 | //loading first Animation 243 | aiAnimation* anim = scene->mAnimations[0]; 244 | 245 | if (anim->mTicksPerSecond != 0.0f) 246 | animation.ticksPerSecond = anim->mTicksPerSecond; 247 | else 248 | animation.ticksPerSecond = 1; 249 | 250 | 251 | animation.duration = anim->mDuration * anim->mTicksPerSecond; 252 | animation.boneTransforms = {}; 253 | 254 | //load positions rotations and scales for each bone 255 | // each channel represents each bone 256 | for (int i = 0; i < anim->mNumChannels; i++) { 257 | aiNodeAnim* channel = anim->mChannels[i]; 258 | BoneTransformTrack track; 259 | for (int j = 0; j < channel->mNumPositionKeys; j++) { 260 | track.positionTimestamps.push_back(channel->mPositionKeys[j].mTime); 261 | track.positions.push_back(assimpToGlmVec3(channel->mPositionKeys[j].mValue)); 262 | } 263 | for (int j = 0; j < channel->mNumRotationKeys; j++) { 264 | track.rotationTimestamps.push_back(channel->mRotationKeys[j].mTime); 265 | track.rotations.push_back(assimpToGlmQuat(channel->mRotationKeys[j].mValue)); 266 | 267 | } 268 | for (int j = 0; j < channel->mNumScalingKeys; j++) { 269 | track.scaleTimestamps.push_back(channel->mScalingKeys[j].mTime); 270 | track.scales.push_back(assimpToGlmVec3(channel->mScalingKeys[j].mValue)); 271 | 272 | } 273 | animation.boneTransforms[channel->mNodeName.C_Str()] = track; 274 | } 275 | } 276 | 277 | unsigned int createVertexArray(std::vector& vertices, std::vector indices) { 278 | uint 279 | vao = 0, 280 | vbo = 0, 281 | ebo = 0; 282 | 283 | glGenVertexArrays(1, &vao); 284 | glGenBuffers(1, &vbo); 285 | glGenBuffers(1, &ebo); 286 | 287 | glBindVertexArray(vao); 288 | glBindBuffer(GL_ARRAY_BUFFER, vbo); 289 | glBufferData(GL_ARRAY_BUFFER, sizeof(Vertex) * vertices.size(), &vertices[0], GL_STATIC_DRAW); 290 | glEnableVertexAttribArray(0); 291 | glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (GLvoid*)offsetof(Vertex, position)); 292 | glEnableVertexAttribArray(1); 293 | glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (GLvoid*)offsetof(Vertex, normal)); 294 | glEnableVertexAttribArray(2); 295 | glVertexAttribPointer(2, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex), (GLvoid*)offsetof(Vertex, uv)); 296 | glEnableVertexAttribArray(3); 297 | glVertexAttribPointer(3, 4, GL_FLOAT, GL_FALSE, sizeof(Vertex), (GLvoid*)offsetof(Vertex, boneIds)); 298 | glEnableVertexAttribArray(4); 299 | glVertexAttribPointer(4, 4, GL_FLOAT, GL_FALSE, sizeof(Vertex), (GLvoid*)offsetof(Vertex, boneWeights)); 300 | 301 | glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ebo); 302 | glBufferData(GL_ELEMENT_ARRAY_BUFFER, indices.size() * sizeof(uint), &indices[0], GL_STATIC_DRAW); 303 | glBindVertexArray(0); 304 | return vao; 305 | } 306 | 307 | uint createTexture(std::string filepath) { 308 | uint textureId = 0; 309 | int width, height, nrChannels; 310 | byte* data = stbi_load(filepath.c_str(), &width, &height, &nrChannels, 4); 311 | glGenTextures(1, &textureId); 312 | glBindTexture(GL_TEXTURE_2D, textureId); 313 | 314 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); 315 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); 316 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 317 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 318 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 3); 319 | 320 | glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data); 321 | 322 | stbi_image_free(data); 323 | glBindTexture(GL_TEXTURE_2D, 0); 324 | return textureId; 325 | } 326 | 327 | 328 | 329 | std::pair getTimeFraction(std::vector& times, float& dt) { 330 | uint segment = 0; 331 | while (dt > times[segment]) 332 | segment++; 333 | float start = times[segment - 1]; 334 | float end = times[segment]; 335 | float frac = (dt - start) / (end - start); 336 | return {segment, frac}; 337 | } 338 | 339 | 340 | 341 | void getPose(Animation& animation, Bone& skeletion, float dt, std::vector& output, glm::mat4 &parentTransform, glm::mat4& globalInverseTransform) { 342 | BoneTransformTrack& btt = animation.boneTransforms[skeletion.name]; 343 | dt = fmod(dt, animation.duration); 344 | std::pair fp; 345 | //calculate interpolated position 346 | fp = getTimeFraction(btt.positionTimestamps, dt); 347 | 348 | glm::vec3 position1 = btt.positions[fp.first - 1]; 349 | glm::vec3 position2 = btt.positions[fp.first]; 350 | 351 | glm::vec3 position = glm::mix( position1, position2, fp.second); 352 | 353 | //calculate interpolated rotation 354 | fp = getTimeFraction(btt.rotationTimestamps, dt); 355 | glm::quat rotation1 = btt.rotations[fp.first - 1]; 356 | glm::quat rotation2 = btt.rotations[fp.first]; 357 | 358 | glm::quat rotation = glm::slerp( rotation1, rotation2,fp.second); 359 | 360 | //calculate interpolated scale 361 | fp = getTimeFraction(btt.scaleTimestamps, dt); 362 | glm::vec3 scale1 = btt.scales[fp.first - 1]; 363 | glm::vec3 scale2 = btt.scales[fp.first]; 364 | 365 | glm::vec3 scale = glm::mix(scale1, scale2, fp.second); 366 | 367 | glm::mat4 positionMat = glm::mat4(1.0), 368 | scaleMat = glm::mat4(1.0); 369 | 370 | 371 | // calculate localTransform 372 | positionMat = glm::translate(positionMat, position); 373 | glm::mat4 rotationMat = glm::toMat4(rotation); 374 | scaleMat = glm::scale(scaleMat, scale); 375 | glm::mat4 localTransform = positionMat * rotationMat * scaleMat; 376 | glm::mat4 globalTransform = parentTransform * localTransform; 377 | 378 | output[skeletion.id] = globalInverseTransform * globalTransform * skeletion.offset; 379 | //update values for children bones 380 | for (Bone& child : skeletion.children) { 381 | getPose(animation, child, dt, output, globalTransform, globalInverseTransform); 382 | } 383 | //std::cout << dt << " => " << position.x << ":" << position.y << ":" << position.z << ":" << std::endl; 384 | } 385 | 386 | 387 | int main(int argc, char ** argv) { 388 | 389 | //init 390 | int windowWidth, windowHeight; 391 | SDL_Window* window = initWindow(windowWidth, windowHeight); 392 | bool isRunning = true; 393 | 394 | //load model file 395 | Assimp::Importer importer; 396 | const char* filePath = "man/model.dae"; 397 | const aiScene* scene = importer.ReadFile(filePath, aiProcess_Triangulate | aiProcess_FlipUVs | aiProcess_GenSmoothNormals); 398 | 399 | if (!scene || scene->mFlags & AI_SCENE_FLAGS_INCOMPLETE || !scene->mRootNode) { 400 | std::cout << "ERROR::ASSIMP::" << importer.GetErrorString() << std::endl; 401 | } 402 | aiMesh* mesh = scene->mMeshes[0]; 403 | 404 | std::vector vertices = {}; 405 | std::vector indices = {}; 406 | uint boneCount = 0; 407 | Animation animation; 408 | uint vao = 0; 409 | Bone skeleton; 410 | uint diffuseTexture; 411 | 412 | //as the name suggests just inverse the global transform 413 | glm::mat4 globalInverseTransform = assimpToGlmMatrix(scene->mRootNode->mTransformation); 414 | globalInverseTransform = glm::inverse(globalInverseTransform); 415 | 416 | 417 | loadModel(scene, mesh, vertices, indices, skeleton, boneCount); 418 | loadAnimation(scene, animation); 419 | 420 | vao = createVertexArray(vertices, indices); 421 | diffuseTexture = createTexture("man/diffuse.png"); 422 | 423 | glm::mat4 identity(1.0); 424 | 425 | //currentPose is held in this vector and uploaded to gpu as a matrix array uniform 426 | std::vector currentPose = {}; 427 | currentPose.resize(boneCount, identity); // use this for no animation 428 | 429 | uint shader = createShader(vertexShaderSource, fragmentShaderSource); 430 | 431 | //get all shader uniform locations 432 | uint viewProjectionMatrixLocation = glGetUniformLocation(shader, "view_projection_matrix"); 433 | uint modelMatrixLocation = glGetUniformLocation(shader, "model_matrix"); 434 | uint boneMatricesLocation = glGetUniformLocation(shader, "bone_transforms"); 435 | uint textureLocation = glGetUniformLocation(shader, "diff_texture"); 436 | 437 | 438 | 439 | // initialize projection view and model matrix 440 | glm::mat4 projectionMatrix = glm::perspective(75.0f, (float)windowWidth / windowHeight, 0.01f, 100.0f); 441 | 442 | glm::mat4 viewMatrix = glm::lookAt(glm::vec3(0.0f, 0.2f, -5.0f) 443 | , glm::vec3(0.0f, .0f, 0.0f), 444 | glm::vec3(0, 1, 0)); 445 | glm::mat4 viewProjectionMatrix = projectionMatrix * viewMatrix; 446 | 447 | glm::mat4 modelMatrix(1.0f); 448 | modelMatrix = glm::translate(modelMatrix, glm::vec3(0.0f, 1.0f, 0.0f)); 449 | modelMatrix = glm::scale(modelMatrix, glm::vec3(.2f, .2f, .2f)); 450 | 451 | 452 | //update loop 453 | while (isRunning) { 454 | SDL_Event ev; 455 | while (SDL_PollEvent(&ev)) { 456 | if (ev.type == SDL_QUIT) 457 | isRunning = false; 458 | } 459 | 460 | float elapsedTime = (float)SDL_GetTicks() / 1000; 461 | 462 | float dAngle = elapsedTime * 0.002; 463 | modelMatrix = glm::rotate(modelMatrix, dAngle, glm::vec3(0, 1, 0)); 464 | 465 | getPose(animation, skeleton, elapsedTime, currentPose, identity, globalInverseTransform); 466 | 467 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 468 | glUseProgram(shader); 469 | glUniformMatrix4fv(viewProjectionMatrixLocation, 1, GL_FALSE, glm::value_ptr(viewProjectionMatrix)); 470 | glUniformMatrix4fv(modelMatrixLocation, 1, GL_FALSE, glm::value_ptr(modelMatrix)); 471 | glUniformMatrix4fv(boneMatricesLocation,boneCount, GL_FALSE, glm::value_ptr(currentPose[0])); 472 | 473 | glBindVertexArray(vao); 474 | glActiveTexture(GL_TEXTURE0); 475 | glBindTexture(GL_TEXTURE_2D, diffuseTexture); 476 | glUniform1i(textureLocation, 0); 477 | 478 | glDrawElements(GL_TRIANGLES, indices.size(), GL_UNSIGNED_INT, 0); 479 | 480 | SDL_GL_SwapWindow(window); 481 | } 482 | 483 | //cleanup 484 | SDL_GLContext context = SDL_GL_GetCurrentContext(); 485 | SDL_GL_DeleteContext(context); 486 | SDL_DestroyWindow(window); 487 | SDL_Quit(); 488 | 489 | return 0; 490 | } -------------------------------------------------------------------------------- /man/diffuse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasinaxp/skeletal_animation-_assimp_opengl/a22ecd2405c52885fbfa9524d11e6a1f8ff62007/man/diffuse.png -------------------------------------------------------------------------------- /simple/model.dae: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Blender User 6 | Blender 2.81.16 commit date:2019-12-04, commit time:11:32, hash:f1aa4d18d49d 7 | 8 | 2020-06-07T20:58:14 9 | 2020-06-07T20:58:14 10 | 11 | Z_UP 12 | 13 | 14 | 15 | 16 | 17 | 18 | 39.59775 19 | 1.777778 20 | 0.1 21 | 100 22 | 23 | 24 | 25 | 26 | 27 | 0 28 | 0 29 | 10 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 1000 1000 1000 39 | 1 40 | 0 41 | 0.00111109 42 | 43 | 44 | 45 | 46 | 0 47 | 0 48 | 1 49 | 1 50 | 1 51 | 1 52 | 1 53 | 0 54 | 0 55 | 0 56 | 1000 57 | 29.99998 58 | 75 59 | 0.15 60 | 0 61 | 1 62 | 2 63 | 0.04999995 64 | 30.002 65 | 1 66 | 3 67 | 2880 68 | 3 69 | 1 70 | 1 71 | 0.1 72 | 0.1 73 | 1 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 0 0 0 1 85 | 86 | 87 | 0.8 0.8 0.8 1 88 | 89 | 90 | 1.45 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 1 1 1 1 1 -1 1 -1 1 1 -1 -1 -1 1 1 -1 1 -1 -1 -1 1 -1 -1 -1 1 1 2.585233 1 -1 2.585233 -1 1 2.585233 -1 -1 2.585233 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 0 -1 0 -1 0 0 0 0 -1 1 0 0 0 1 0 0 0 1 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 0.625 0.75 0.625 1 0.625 1 0.625 0.75 0.375 1 0.375 0.75 0.625 0 0.375 0.25 0.375 0 0.375 0.5 0.125 0.75 0.125 0.5 0.625 0.5 0.375 0.75 0.375 0.5 0.625 0.25 0.375 0.5 0.375 0.25 0.875 0.5 0.625 0.75 0.625 0.5 0.625 0 0.625 0.25 0.625 0.25 0.625 0.5 0.625 0.75 0.625 0.75 0.625 0.25 0.625 0.5 0.625 0.5 0.625 0.75 0.625 0.75 0.625 1 0.625 0.75 0.625 1 0.375 1 0.625 0 0.625 0.25 0.375 0.25 0.375 0.5 0.375 0.75 0.125 0.75 0.625 0.5 0.625 0.75 0.375 0.75 0.625 0.25 0.625 0.5 0.375 0.5 0.875 0.5 0.875 0.75 0.625 0.75 0.625 0 0.625 0 0.625 0.25 0.625 0.5 0.625 0.5 0.625 0.75 0.625 0.25 0.625 0.25 0.625 0.5 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 |

2 0 0 11 0 1 6 0 2 2 0 3 7 0 4 3 0 5 6 1 6 5 1 7 7 1 8 1 2 9 7 2 10 5 2 11 0 3 12 3 3 13 1 3 14 4 4 15 1 4 16 5 4 17 10 5 18 9 5 19 8 5 20 6 1 21 10 1 22 4 1 23 0 3 24 9 3 25 2 3 26 4 4 27 8 4 28 0 4 29 2 0 30 9 0 31 11 0 32 2 0 33 6 0 34 7 0 35 6 1 36 4 1 37 5 1 38 1 2 39 3 2 40 7 2 41 0 3 42 2 3 43 3 3 44 4 4 45 0 4 46 1 4 47 10 5 48 11 5 49 9 5 50 6 1 51 11 1 52 10 1 53 0 3 54 8 3 55 9 3 56 4 4 57 10 4 58 8 4 59

143 |
144 |
145 |
146 |
147 | 148 | 149 | 150 | 0.7164916 0 0 0 0 0.7164916 0 0 0 0 1.224277 0.2961319 0 0 0 1 151 | 152 | Bone Bone_001 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 0.7164916 0 0 0 0 0 0.7164916 0.2961319 0 -0.7164916 0 0 0 0 0 1 0.7164916 0 0 0 0 0 0.7164916 -0.9177411 0 -0.7164916 0 0 0 0 0 1 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 0.0312317 0.9687683 0.8890074 0.1109926 0.03140813 0.9685919 0.891797 0.1082031 0.03140813 0.9685919 0.891797 0.1082031 0.0312317 0.9687683 0.8890074 0.1109926 1 1 1 1 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 2 2 2 2 2 2 2 2 1 1 1 1 183 | 0 0 1 1 0 2 1 3 0 4 1 5 0 6 1 7 0 8 1 9 0 10 1 11 0 12 1 13 0 14 1 15 1 16 1 17 1 18 1 19 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 0 0.04166662 0.08333331 0.125 0.1666666 0.2083333 0.25 0.2916666 0.3333333 0.375 0.4166666 0.4583333 0.5 0.5416667 0.5833333 0.625 0.6666667 0.7083333 0.75 0.7916667 0.8333333 0.875 0.9166667 0.9583333 1 1.041667 1.083333 1.125 1.166667 1.208333 1.25 1.291667 1.333333 1.375 1.416667 1.458333 1.5 1.541667 1.583333 1.625 1.666667 1.708333 1.75 1.791667 1.833333 1.875 1.916667 1.958333 2 2.041667 2.083333 2.125 2.166667 2.208333 2.25 2.291667 2.333333 2.375 2.416667 2.458333 2.5 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 0.9999691 -0.007864385 -1.05665e-9 0 -1.05665e-9 4.15503e-12 -1 0 0.007864385 0.9999691 -4.15503e-12 0 0 0 0 1 0.9999691 -0.007864385 -1.05665e-9 0 -1.05665e-9 4.15503e-12 -1 0 0.007864385 0.9999691 -4.15503e-12 0 0 0 0 1 0.9999849 -0.005507062 -1.05666e-9 0 -1.05666e-9 2.90958e-12 -1 0 0.005507062 0.9999849 -2.90958e-12 0 0 0 0 1 0.9999992 0.001239995 -1.05668e-9 0 -1.05668e-9 -6.55141e-13 -1 0 -0.001239995 0.9999992 6.55141e-13 0 0 0 0 1 0.9999293 0.01188906 -1.05668e-9 0 -1.05668e-9 -6.28168e-12 -1 0 -0.01188906 0.9999293 6.28168e-12 0 0 0 0 1 0.9996632 0.02595041 -1.0566e-9 0 -1.0566e-9 -1.37119e-11 -1 0 -0.02595041 0.9996632 1.37119e-11 0 0 0 0 1 0.999078 0.04293046 -1.05639e-9 0 -1.05639e-9 -2.26862e-11 -1 0 -0.04293046 0.999078 2.26862e-11 0 0 0 0 1 0.9980556 0.06233075 -1.056e-9 0 -1.056e-9 -3.29428e-11 -1 0 -0.06233075 0.9980556 3.29428e-11 0 0 0 0 1 0.9964954 0.083648 -1.05539e-9 0 -1.05539e-9 -4.42182e-11 -1 0 -0.083648 0.9964954 4.42182e-11 0 0 0 0 1 0.994326 0.1063756 -1.05453e-9 0 -1.05453e-9 -5.62476e-11 -1 0 -0.1063756 0.994326 5.62476e-11 0 0 0 0 1 0.9915131 0.1300064 -1.0534e-9 0 -1.0534e-9 -6.87663e-11 -1 0 -0.1300064 0.9915131 6.87663e-11 0 0 0 0 1 0.9880652 0.154036 -1.05203e-9 0 -1.05203e-9 -8.15116e-11 -1 0 -0.154036 0.9880652 8.15116e-11 0 0 0 0 1 0.9840364 0.1779672 -1.05045e-9 0 -1.05045e-9 -9.42247e-11 -1 0 -0.1779672 0.9840364 9.42247e-11 0 0 0 0 1 0.9795269 0.2013133 -1.04872e-9 0 -1.04872e-9 -1.06652e-10 -1 0 -0.2013133 0.9795269 1.06652e-10 0 0 0 0 1 0.9746805 0.2236019 -1.04693e-9 0 -1.04693e-9 -1.18549e-10 -1 0 -0.2236019 0.9746805 1.18549e-10 0 0 0 0 1 0.9696804 0.2443766 -1.04519e-9 0 -1.04519e-9 -1.29676e-10 -1 0 -0.2443766 0.9696804 1.29676e-10 0 0 0 0 1 0.9647422 0.2631968 -1.04362e-9 0 -1.04362e-9 -1.39803e-10 -1 0 -0.2631968 0.9647422 1.39803e-10 0 0 0 0 1 0.9601059 0.2796366 -1.04235e-9 0 -1.04235e-9 -1.48706e-10 -1 0 -0.2796366 0.9601059 1.48706e-10 0 0 0 0 1 0.9560266 0.2932798 -1.04153e-9 0 -1.04153e-9 -1.56164e-10 -1 0 -0.2932798 0.9560266 1.56164e-10 0 0 0 0 1 0.9527631 0.3037145 -1.04132e-9 0 -1.04132e-9 -1.61957e-10 -1 0 -0.3037145 0.9527631 1.61957e-10 0 0 0 0 1 0.9505657 0.3105236 -1.04186e-9 0 -1.04186e-9 -1.6586e-10 -1 0 -0.3105236 0.9505657 1.6586e-10 0 0 0 0 1 0.9496625 0.3132749 4.20912e-8 0 4.20912e-8 6.76329e-9 -1 0 -0.3132749 0.9496625 -6.76329e-9 0 0 0 0 1 0.9520934 0.3058075 4.2238e-8 0 4.2238e-8 6.61685e-9 -1 0 -0.3058075 0.9520934 -6.61685e-9 0 0 0 0 1 0.9590688 0.283173 4.25082e-8 0 4.25082e-8 6.14433e-9 -1 0 -0.283173 0.9590688 -6.14433e-9 0 0 0 0 1 0.9691285 0.2465559 4.28681e-8 0 4.28681e-8 5.36754e-9 -1 0 -0.2465559 0.9691285 -5.36754e-9 0 0 0 0 1 0.9803891 0.197072 4.32745e-8 0 4.32745e-8 4.30632e-9 -1 0 -0.197072 0.9803891 -4.30632e-9 0 0 0 0 1 0.9907112 0.135983 4.36781e-8 0 4.36781e-8 2.9836e-9 -1 0 -0.135983 0.9907112 -2.9836e-9 0 0 0 0 1 0.9978931 0.0648798 4.40272e-8 0 4.40272e-8 1.42974e-9 -1 0 -0.0648798 0.9978931 -1.42974e-9 0 0 0 0 1 0.9998991 -0.01420242 4.42727e-8 0 4.42727e-8 -3.14405e-10 -1 0 0.01420242 0.9998991 3.14405e-10 0 0 0 0 1 0.9951108 -0.09876496 4.43737e-8 0 4.43737e-8 -2.19665e-9 -1 0 0.09876496 0.9951108 2.19665e-9 0 0 0 0 1 0.9825609 -0.1859411 4.43029e-8 0 4.43029e-8 -4.15509e-9 -1 0 0.1859411 0.9825609 4.15509e-9 0 0 0 0 1 0.9621006 -0.272695 4.4051e-8 0 4.4051e-8 -6.12226e-9 -1 0 0.272695 0.9621006 6.12226e-9 0 0 0 0 1 0.9344547 -0.3560819 4.36283e-8 0 4.36283e-8 -8.03082e-9 -1 0 0.3560819 0.9344547 8.03082e-9 0 0 0 0 1 0.9011499 -0.4335076 4.30636e-8 0 4.30636e-8 -9.81953e-9 -1 0 0.4335076 0.9011499 9.81953e-9 0 0 0 0 1 0.8643331 -0.5029197 4.24007e-8 0 4.24007e-8 -1.1438e-8 -1 0 0.5029197 0.8643331 1.1438e-8 0 0 0 0 1 0.8265296 -0.5628932 4.16934e-8 0 4.16934e-8 -1.28489e-8 -1 0 0.5628932 0.8265296 1.28489e-8 0 0 0 0 1 0.7903998 -0.6125913 4.09994e-8 0 4.09994e-8 -1.40281e-8 -1 0 0.6125913 0.7903998 1.40281e-8 0 0 0 0 1 0.7585381 -0.6516287 4.03761e-8 0 4.03761e-8 -1.49614e-8 -1 0 0.6516287 0.7585381 1.49614e-8 0 0 0 0 1 0.733339 -0.6798632 3.98768e-8 0 3.98768e-8 -1.56408e-8 -1 0 0.6798632 0.733339 1.56408e-8 0 0 0 0 1 0.7169242 -0.6971511 3.95489e-8 0 3.95489e-8 -1.60587e-8 -1 0 0.6971511 0.7169242 1.60587e-8 0 0 0 0 1 0.7111062 -0.7030846 -9.44656e-8 0 -9.44656e-8 3.88154e-8 -1 0 0.7030846 0.7111062 -3.88154e-8 0 0 0 0 1 0.7150341 -0.6990896 -9.46268e-8 0 -9.46268e-8 3.85722e-8 -1 0 0.6990896 0.7150341 -3.85722e-8 0 0 0 0 1 0.7261753 -0.6875095 -9.50816e-8 0 -9.50816e-8 3.78696e-8 -1 0 0.6875095 0.7261753 -3.78696e-8 0 0 0 0 1 0.743443 -0.6687993 -9.57789e-8 0 -9.57789e-8 3.67416e-8 -1 0 0.6687993 0.743443 -3.67416e-8 0 0 0 0 1 0.7656191 -0.6432942 -9.66598e-8 0 -9.66598e-8 3.52175e-8 -1 0 0.6432942 0.7656191 -3.52175e-8 0 0 0 0 1 0.7913893 -0.6113126 -9.76602e-8 0 -9.76602e-8 3.33266e-8 -1 0 0.6113126 0.7913893 -3.33266e-8 0 0 0 0 1 0.8193833 -0.5732459 -9.8714e-8 0 -9.8714e-8 3.11025e-8 -1 0 0.5732459 0.8193833 -3.11025e-8 0 0 0 0 1 0.8482277 -0.5296317 -9.97562e-8 0 -9.97562e-8 2.85863e-8 -1 0 0.5296317 0.8482277 -2.85863e-8 0 0 0 0 1 0.8766088 -0.4812036 -1.00727e-7 0 -1.00727e-7 2.58286e-8 -1 0 0.4812036 0.8766088 -2.58286e-8 0 0 0 0 1 0.9033445 -0.4289157 -1.01575e-7 0 -1.01575e-7 2.28898e-8 -1 0 0.4289157 0.9033445 -2.28898e-8 0 0 0 0 1 0.9274551 -0.3739346 -1.02263e-7 0 -1.02263e-7 1.98394e-8 -1 0 0.3739346 0.9274551 -1.98394e-8 0 0 0 0 1 0.9482228 -0.3176058 -1.02766e-7 0 -1.02766e-7 1.67532e-8 -1 0 0.3176058 0.9482228 -1.67532e-8 0 0 0 0 1 0.9652317 -0.261396 -1.03078e-7 0 -1.03078e-7 1.37104e-8 -1 0 0.261396 0.9652317 -1.37104e-8 0 0 0 0 1 0.9783779 -0.2068254 -1.03209e-7 0 -1.03209e-7 1.07898e-8 -1 0 0.2068254 0.9783779 -1.07897e-8 0 0 0 0 1 0.9878514 -0.1554012 -1.03183e-7 0 -1.03183e-7 8.06639e-9 -1 0 0.1554012 0.9878514 -8.06638e-9 0 0 0 0 1 0.9940895 -0.1085631 -1.03037e-7 0 -1.03037e-7 5.60962e-9 -1 0 0.1085631 0.9940895 -5.60961e-9 0 0 0 0 1 0.9977091 -0.06765063 -1.02817e-7 0 -1.02817e-7 3.4818e-9 -1 0 0.06765063 0.9977091 -3.48179e-9 0 0 0 0 1 0.9994254 -0.03389641 -1.0257e-7 0 -1.0257e-7 1.73887e-9 -1 0 0.03389641 0.9994254 -1.73887e-9 0 0 0 0 1 0.9999644 -0.008441333 -1.02345e-7 0 -1.02345e-7 4.31974e-10 -1 0 0.008441333 0.9999644 -4.31967e-10 0 0 0 0 1 0.9999709 0.007627638 -1.02186e-7 0 -1.02186e-7 -3.89719e-10 -1 0 -0.007627638 0.9999709 3.89727e-10 0 0 0 0 1 0.9999125 0.01323004 1.77759e-9 0 1.77759e-9 1.17593e-11 -1 0 -0.01323004 0.9999125 -1.17593e-11 0 0 0 0 1 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 0 0.04166662 0.08333331 0.125 0.1666666 0.2083333 0.25 0.2916666 0.3333333 0.375 0.4166666 0.4583333 0.5 0.5416667 0.5833333 0.625 0.6666667 0.7083333 0.75 0.7916667 0.8333333 0.875 0.9166667 0.9583333 1 1.041667 1.083333 1.125 1.166667 1.208333 1.25 1.291667 1.333333 1.375 1.416667 1.458333 1.5 1.541667 1.583333 1.625 1.666667 1.708333 1.75 1.791667 1.833333 1.875 1.916667 1.958333 2 2.041667 2.083333 2.125 2.166667 2.208333 2.25 2.291667 2.333333 2.375 2.416667 2.458333 2.5 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 0.9998612 0.01666339 2.23886e-9 0 -0.01666339 0.9998612 -1.86601e-11 1.213873 -2.23886e-9 -1.86494e-11 1 0 0 0 0 1 0.9998612 0.01666339 2.23886e-9 0 -0.01666339 0.9998612 -1.86601e-11 1.213873 -2.23886e-9 -1.86494e-11 1 0 0 0 0 1 0.9997854 0.02071825 2.23946e-9 0 -0.02071825 0.9997854 -2.32066e-11 1.213873 -2.23946e-9 -2.3196e-11 1 0 0 0 0 1 0.999477 0.03233412 2.24108e-9 0 -0.03233412 0.999477 -3.62464e-11 1.213873 -2.24108e-9 -3.62357e-11 1 0 0 0 0 1 0.9987143 0.0506948 2.24333e-9 -9.31323e-10 -0.0506948 0.9987143 -5.69044e-11 1.213873 -2.24333e-9 -5.68937e-11 1 0 0 0 0 1 0.9971851 0.07497917 2.24572e-9 -3.72529e-9 -0.07497917 0.9971851 -8.43152e-11 1.213873 -2.24572e-9 -8.43045e-11 1 0 0 0 0 1 0.9945412 0.1043448 2.24773e-9 3.72529e-9 -0.1043448 0.9945412 -1.17596e-10 1.213873 -2.24773e-9 -1.17585e-10 1 0 0 0 0 1 0.990444 0.1379159 2.24882e-9 -7.45058e-9 -0.1379159 0.990444 -1.55824e-10 1.213873 -2.24882e-9 -1.55813e-10 1 0 0 0 0 1 0.9846076 0.1747795 2.24853e-9 0 -0.1747795 0.9846076 -1.98027e-10 1.213873 -2.24853e-9 -1.98017e-10 1 0 0 0 0 1 0.9768362 0.2139889 2.24646e-9 0 -0.2139889 0.9768362 -2.43181e-10 1.213873 -2.24646e-9 -2.4317e-10 1 0 0 0 0 1 0.9670526 0.2545768 2.24238e-9 0 -0.2545768 0.9670526 -2.90216e-10 1.213873 -2.24239e-9 -2.90205e-10 1 0 0 0 0 1 0.9553198 0.2955742 2.2362e-9 -1.49012e-8 -0.2955742 0.9553198 -3.38038e-10 1.213873 -2.2362e-9 -3.38027e-10 1 0 0 0 0 1 0.9418498 0.3360343 2.22797e-9 0 -0.3360343 0.9418498 -3.85553e-10 1.213873 -2.22797e-9 -3.85542e-10 1 0 0 0 0 1 0.9270024 0.3750554 2.21797e-9 0 -0.3750554 0.9270024 -4.31692e-10 1.213873 -2.21797e-9 -4.31681e-10 1 0 0 0 0 1 0.9112731 0.4118027 2.20659e-9 0 -0.4118027 0.9112731 -4.75437e-10 1.213873 -2.20659e-9 -4.75427e-10 1 0 0 0 0 1 0.8952715 0.4455211 2.1944e-9 0 -0.4455211 0.8952715 -5.15842e-10 1.213873 -2.1944e-9 -5.15832e-10 1 0 0 0 0 1 0.8796939 0.4755402 2.18205e-9 0 -0.4755402 0.8796939 -5.52039e-10 1.213873 -2.18206e-9 -5.52029e-10 1 0 0 0 0 1 0.8652921 0.5012681 2.1703e-9 0 -0.5012681 0.8652921 -5.8324e-10 1.213873 -2.1703e-9 -5.83229e-10 1 0 0 0 0 1 0.8528398 0.5221729 2.15991e-9 0 -0.5221729 0.8528398 -6.08718e-10 1.213873 -2.15991e-9 -6.08708e-10 1 0 0 0 0 1 0.8431005 0.5377563 2.15165e-9 2.98023e-8 -0.5377563 0.8431005 -6.27788e-10 1.213873 -2.15166e-9 -6.27777e-10 1 0 0 0 0 1 0.8367949 0.5475166 2.14625e-9 0 -0.5475166 0.8367949 -6.39767e-10 1.213873 -2.14626e-9 -6.39756e-10 1 0 0 0 0 1 0.8345675 0.5509057 7.4019e-8 2.98023e-8 -0.5509057 0.8345675 -2.22273e-8 1.213873 -7.4019e-8 -2.22273e-8 1 8.88178e-16 0 0 0 1 0.8386366 0.5446916 7.41748e-8 2.98023e-8 -0.5446916 0.8386366 -2.19741e-8 1.213873 -7.41748e-8 -2.19741e-8 1 0 0 0 0 1 0.8500403 0.5267177 7.46101e-8 -2.98023e-8 -0.5267177 0.8500403 -2.1242e-8 1.213873 -7.46101e-8 -2.1242e-8 1 -8.88178e-16 0 0 0 1 0.8673187 0.4977532 7.52668e-8 0 -0.4977532 0.8673187 -2.00631e-8 1.213873 -7.52668e-8 -2.00631e-8 1 4.44089e-16 0 0 0 1 0.8887385 0.4584147 7.60754e-8 0 -0.4584147 0.8887385 -1.84642e-8 1.213873 -7.60754e-8 -1.84642e-8 1 8.88178e-16 0 0 0 1 0.9123759 0.4093534 7.69588e-8 1.49012e-8 -0.4093534 0.9123759 -1.64734e-8 1.213873 -7.69588e-8 -1.64734e-8 1 4.44089e-16 0 0 0 1 0.9362175 0.3514211 7.78367e-8 0 -0.3514211 0.9362175 -1.41273e-8 1.213873 -7.78366e-8 -1.41273e-8 1 0 0 0 0 1 0.9582905 0.2857963 7.86305e-8 -1.86265e-9 -0.2857963 0.9582905 -1.14755e-8 1.213873 -7.86305e-8 -1.14755e-8 1 0 0 0 0 1 0.9768223 0.2140519 7.92704e-8 0 -0.2140519 0.9768223 -8.58346e-9 1.213873 -7.92704e-8 -8.58346e-9 1 -4.44089e-16 0 0 0 1 0.9904112 0.1381507 7.97018e-8 1.49012e-8 -0.1381507 0.9904112 -5.53195e-9 1.213873 -7.97018e-8 -5.53195e-9 1 8.88178e-16 0 0 0 1 0.9981765 0.06036355 7.98914e-8 -2.98023e-8 -0.06036355 0.9981765 -2.41346e-9 1.213873 -7.98914e-8 -2.41346e-9 1 4.44089e-16 0 0 0 1 0.9998577 -0.01687309 7.98309e-8 0 0.01687309 0.9998577 6.73548e-10 1.213873 -7.98309e-8 6.73547e-10 1 0 0 0 0 1 0.9958389 -0.09113184 7.95383e-8 0 0.09113184 0.9958389 3.63179e-9 1.213873 -7.95383e-8 3.63179e-9 1 0 0 0 0 1 0.9870912 -0.1601593 7.90544e-8 0 0.1601593 0.9870912 6.37177e-9 1.213873 -7.90544e-8 6.37177e-9 1 -8.88178e-16 0 0 0 1 0.9750473 -0.2219968 7.84383e-8 0 0.2219968 0.9750473 8.81652e-9 1.213873 -7.84383e-8 8.81652e-9 1 -8.88178e-16 0 0 0 1 0.9614358 -0.2750296 7.77605e-8 5.96046e-8 0.2750296 0.9614358 1.09035e-8 1.213873 -7.77605e-8 1.09035e-8 1 2.66454e-15 0 0 0 1 0.9481031 -0.317963 7.70956e-8 0 0.317963 0.9481031 1.25833e-8 1.213873 -7.70956e-8 1.25833e-8 1 8.88178e-16 0 0 0 1 0.9368508 -0.3497295 7.65158e-8 0 0.3497295 0.9368508 1.38161e-8 1.213873 -7.65158e-8 1.38161e-8 1 -8.88178e-16 0 0 0 1 0.9292898 -0.3693511 7.60852e-8 5.96046e-8 0.3693511 0.9292898 1.45661e-8 1.213873 -7.60852e-8 1.45661e-8 1 0 0 0 0 1 0.9267113 -0.3757742 -5.04886e-8 0 0.3757742 0.9267113 -9.84698e-9 1.213873 5.04886e-8 -9.84702e-9 1 -3.55271e-15 0 0 0 1 0.9279115 -0.3728007 -5.04373e-8 0 0.3728007 0.9279115 -9.75304e-9 1.213873 5.04373e-8 -9.75309e-9 1 0 0 0 0 1 0.9308648 -0.365364 -5.04347e-8 0 0.365364 0.9308648 -9.54339e-9 1.213873 5.04347e-8 -9.54341e-9 1 1.42109e-14 0 0 0 1 0.9352736 -0.3539253 -5.0473e-8 0 0.3539253 0.9352736 -9.23054e-9 1.213873 5.0473e-8 -9.23059e-9 1 -3.55271e-15 0 0 0 1 0.9408128 -0.3389269 -5.05436e-8 0 0.3389269 0.9408128 -8.82649e-9 1.213873 5.05436e-8 -8.82653e-9 1 -3.55271e-15 0 0 0 1 0.947145 -0.3208061 -5.06379e-8 -5.96046e-8 0.3208061 0.947145 -8.34295e-9 1.213873 5.06379e-8 -8.34299e-9 1 0 0 0 0 1 0.9539368 -0.3000081 -5.07473e-8 -5.96046e-8 0.3000081 0.9539368 -7.79173e-9 1.213873 5.07473e-8 -7.79176e-9 1 3.55271e-15 0 0 0 1 0.9608722 -0.2769924 -5.08636e-8 5.96046e-8 0.2769924 0.9608722 -7.18497e-9 1.213873 5.08636e-8 -7.18501e-9 1 -3.55271e-15 0 0 0 1 0.9676646 -0.2522408 -5.09797e-8 0 0.2522408 0.9676646 -6.53522e-9 1.213873 5.09797e-8 -6.53526e-9 1 5.32907e-15 0 0 0 1 0.9740672 -0.2262587 -5.10893e-8 2.98023e-8 0.2262587 0.9740672 -5.85561e-9 1.213873 5.10893e-8 -5.85565e-9 1 -5.32907e-15 0 0 0 1 0.9798827 -0.1995741 -5.11875e-8 -2.98023e-8 0.1995741 0.9798827 -5.15973e-9 1.213873 5.11875e-8 -5.15977e-9 1 1.77636e-15 0 0 0 1 0.9849682 -0.1727355 -5.12709e-8 0 0.1727355 0.9849682 -4.46166e-9 1.213873 5.12709e-8 -4.46171e-9 1 -1.77636e-15 0 0 0 1 0.9892393 -0.1463065 -5.13375e-8 0 0.1463065 0.9892393 -3.7758e-9 1.213873 5.13374e-8 -3.77584e-9 1 1.77636e-15 0 0 0 1 0.9926694 -0.1208609 -5.13868e-8 -1.49012e-8 0.1208609 0.9926694 -3.11673e-9 1.213873 5.13868e-8 -3.11677e-9 1 1.77636e-15 0 0 0 1 0.9952868 -0.096976 -5.14197e-8 1.49012e-8 0.096976 0.9952868 -2.49911e-9 1.213873 5.14198e-8 -2.49915e-9 1 -1.77636e-15 0 0 0 1 0.9971665 -0.0752276 -5.14386e-8 0 0.0752276 0.9971665 -1.93752e-9 1.213873 5.14386e-8 -1.93756e-9 1 0 0 0 0 1 0.9984204 -0.0561865 -5.14463e-8 -7.45058e-9 0.0561865 0.9984204 -1.44641e-9 1.213873 5.14462e-8 -1.44646e-9 1 4.44089e-16 0 0 0 1 0.999183 -0.04041608 -5.14465e-8 3.72529e-9 0.04041608 0.999183 -1.04004e-9 1.213873 5.14465e-8 -1.04008e-9 1 0 0 0 0 1 0.9995946 -0.02847232 -5.14431e-8 0 0.02847232 0.9995946 -7.32479e-10 1.213873 5.1443e-8 -7.32521e-10 1 0 0 0 0 1 0.9997815 -0.02090508 -5.14393e-8 0 0.02090508 0.9997815 -5.37709e-10 1.213873 5.14393e-8 -5.37751e-10 1 0 0 0 0 1 0.9998332 -0.01826121 -2.45357e-9 1.86265e-9 0.01826121 0.9998332 -2.23876e-11 1.213873 2.45357e-9 -2.24213e-11 1 0 0 0 0 1 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 1.39569 0 0 0 0 1.39569 0 0 0 0 1.39569 -0.4133083 0 0 0 1 260 | 261 | 1 0 0 0 0 0 -1 0 0 1 0 0 0 0 0 1 262 | 263 | 1 0 0 0 0 1 0 1.213873 0 0 1 0 0 0 0 1 264 | 265 | 266 | 1 267 | 0 268 | 0 269 | 0 270 | 1.48066 271 | 272 | 273 | 274 | 275 | 276 | 0 277 | 278 | 279 | 280 | 281 | 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 282 | 283 | #Armature_Bone 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 0.6859207 -0.3240135 0.6515582 7.358891 0.7276763 0.3054208 -0.6141704 -6.925791 0 0.8953956 0.4452714 4.958309 0 0 0 1 296 | 297 | 298 | 299 | -0.2908646 -0.7711008 0.5663932 4.076245 0.9551712 -0.1998834 0.2183912 1.005454 -0.05518906 0.6045247 0.7946723 5.903862 0 0 0 1 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 |
-------------------------------------------------------------------------------- /utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "glad.h" 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | typedef unsigned int uint; 14 | typedef unsigned char byte; 15 | 16 | inline glm::mat4 assimpToGlmMatrix(aiMatrix4x4 mat) { 17 | glm::mat4 m; 18 | for (int y = 0; y < 4; y++) 19 | { 20 | for (int x = 0; x < 4; x++) 21 | { 22 | m[x][y] = mat[y][x]; 23 | } 24 | } 25 | return m; 26 | } 27 | inline glm::vec3 assimpToGlmVec3(aiVector3D vec) { 28 | return glm::vec3(vec.x, vec.y, vec.z); 29 | } 30 | 31 | inline glm::quat assimpToGlmQuat(aiQuaternion quat) { 32 | glm::quat q; 33 | q.x = quat.x; 34 | q.y = quat.y; 35 | q.z = quat.z; 36 | q.w = quat.w; 37 | 38 | return q; 39 | } 40 | 41 | 42 | 43 | inline unsigned int createShader(const char* vertexStr, const char* fragmentStr) { 44 | int success; 45 | char info_log[512]; 46 | uint 47 | program = glCreateProgram(), 48 | vShader = glCreateShader(GL_VERTEX_SHADER), 49 | fShader = glCreateShader(GL_FRAGMENT_SHADER); 50 | 51 | glShaderSource(vShader, 1, &vertexStr, 0); 52 | glCompileShader(vShader); 53 | glGetShaderiv(vShader, GL_COMPILE_STATUS, &success); 54 | if (!success) 55 | { 56 | glGetShaderInfoLog(vShader, 512, 0, info_log); 57 | std::cout << "vertex shader compilation failed!\n" << info_log << std::endl; 58 | } 59 | glShaderSource(fShader, 1, &fragmentStr, 0); 60 | glCompileShader(fShader); 61 | glGetShaderiv(fShader, GL_COMPILE_STATUS, &success); 62 | if (!success) 63 | { 64 | glGetShaderInfoLog(fShader, 512, 0, info_log); 65 | std::cout << "fragment shader compilation failed!\n" << info_log << std::endl; 66 | } 67 | 68 | glAttachShader(program, vShader); 69 | glAttachShader(program, fShader); 70 | glLinkProgram(program); 71 | glGetProgramiv(program, GL_LINK_STATUS, &success); 72 | if (!success) 73 | { 74 | glGetProgramInfoLog(program, 512, 0, info_log); 75 | std::cout << "program linking failed!\n" << info_log << std::endl; 76 | } 77 | glDetachShader(program, vShader); 78 | glDeleteShader(vShader); 79 | glDetachShader(program, fShader); 80 | glDeleteShader(fShader); 81 | 82 | return program; 83 | } 84 | 85 | inline SDL_Window* initWindow(int &windowWidth,int &windowHeight) { 86 | SDL_Init(SDL_INIT_EVERYTHING); 87 | SDL_GL_LoadLibrary(NULL); 88 | 89 | //window 90 | SDL_Window* window = SDL_CreateWindow("skin Animation", 91 | SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 92 | 640, 480, 93 | SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE); 94 | 95 | 96 | SDL_GLContext context = SDL_GL_CreateContext(window); 97 | 98 | SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1); 99 | SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4); 100 | SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 4); 101 | SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); 102 | SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); 103 | SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8); 104 | SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8); 105 | SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); 106 | SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8); 107 | SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); 108 | SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8); 109 | 110 | 111 | gladLoadGLLoader((GLADloadproc)SDL_GL_GetProcAddress); 112 | 113 | SDL_GetWindowSize(window, &windowWidth, &windowHeight); 114 | glViewport(0, 0, windowWidth, windowHeight); 115 | glClearColor(1.0, 0.0, 0.4, 1.0); 116 | glEnable(GL_DEPTH_TEST); 117 | SDL_ShowWindow(window); 118 | SDL_GL_SetSwapInterval(1); 119 | return window; 120 | } --------------------------------------------------------------------------------