Merge branch 'master' into gltf-animation

This commit is contained in:
Snowminx 2020-05-16 01:52:17 -07:00 • committed by GitHub
commit 7b20e00596
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,18 +2,17 @@
*
* raylib [models] example - Load 3d model with animations and play them
*
* This example has been created using raylib 2.5 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
* Example contributed by Culacant (@culacant) and reviewed by Ramon Santamaria (@raysan5)
*
* Copyright (c) 2019 Culacant (@culacant) and Ramon Santamaria (@raysan5)
*
********************************************************************************************
******************************************************************************
*
* To export a model from blender, make sure it is not posed, the vertices need to be in the
* same position as they would be in edit mode.
* and that the scale of your models is set to 0. Scaling can be done from the export menu.
* This example has been created using raylib 3.0 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
* Example contributed by Snowminx (@gamerfiend) and reviewed by Ramon Santamaria (@raysan5)
*
* Copyright (c) 2020 Snowminx (@gamerfiend) and Ramon Santamaria (@raysan5)
*
********************************************************************************************/
@ -30,7 +29,7 @@ int main(void)
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [models] example - model animation");
InitWindow(screenWidth, screenHeight, "raylib [models] example - model animation gltf");
// Define the camera to look into our 3d world
Camera camera = { 0 };
@ -51,6 +50,7 @@ int main(void)
if (!isValid) {
printf("\n\n\n\nModel Bone Count: %i, Animation Bone Count: %i, Animation Count: %i\n\n\n\n", model2.boneCount, anims[2].boneCount, animsCount);
}
SetCameraMode(camera, CAMERA_FREE); // Set free camera mode
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
@ -79,7 +79,6 @@ int main(void)
ClearBackground(RAYWHITE);
BeginMode3D(camera);
DrawModelEx(model2, position, (Vector3){ 1.0f, 0.0f, 0.0f }, -90.0f, (Vector3){ 1.0f, 1.0f, 1.0f }, WHITE);
//Draw debug
@ -93,10 +92,10 @@ int main(void)
}
DrawGrid(10, 1.0f); // Draw a grid
EndMode3D();
DrawText("PRESS SPACE to PLAY GLTF MODEL ANIMATION", 10, 10, 20, MAROON);
EndDrawing();