瀏覽代碼

Update models_loading_gltf.c

pull/2853/head
Ray 2 年之前
父節點
當前提交
39f9045703
共有 1 個檔案被更改,包括 7 行新增7 行删除
  1. +7
    -7
      examples/models/models_loading_gltf.c

+ 7
- 7
examples/models/models_loading_gltf.c 查看文件

@ -56,21 +56,21 @@ int main(void)
SetTargetFPS(60); // Set our game to run at 60 frames-per-second SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//-------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------
// Main game loop // Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key while (!WindowShouldClose()) // Detect window close button or ESC key
{ {
// Update // Update
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
ModelAnimation anim = modelAnimations[animIndex]; // Select current animation
if (IsKeyPressed(KEY_UP)) animIndex = (animIndex + 1)%animsCount; if (IsKeyPressed(KEY_UP)) animIndex = (animIndex + 1)%animsCount;
else if (IsKeyPressed(KEY_DOWN)) animIndex = (animIndex + animsCount - 1)%animsCount; else if (IsKeyPressed(KEY_DOWN)) animIndex = (animIndex + animsCount - 1)%animsCount;
// Update model animation
ModelAnimation anim = modelAnimations[animIndex];
animCurrentFrame = (animCurrentFrame + 1)%anim.frameCount; animCurrentFrame = (animCurrentFrame + 1)%anim.frameCount;
UpdateModelAnimation(model, anim, animCurrentFrame); UpdateModelAnimation(model, anim, animCurrentFrame);
// Update camera
UpdateCamera(&camera); UpdateCamera(&camera);
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
@ -82,8 +82,8 @@ int main(void)
BeginMode3D(camera); BeginMode3D(camera);
DrawModel(model, position, 1.0f, WHITE); DrawModel(model, position, 1.0f, WHITE); // Draw animated model
DrawGrid(10, 1.0f); // Draw a grid DrawGrid(10, 1.0f);
EndMode3D(); EndMode3D();

||||||
x
 
000:0
Loading…
取消
儲存