summaryrefslogtreecommitdiffhomepage
path: root/examples/others/iqm_loader/models_iqm_animation.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/others/iqm_loader/models_iqm_animation.c')
-rw-r--r--examples/others/iqm_loader/models_iqm_animation.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/examples/others/iqm_loader/models_iqm_animation.c b/examples/others/iqm_loader/models_iqm_animation.c
index 418208a8..d384338c 100644
--- a/examples/others/iqm_loader/models_iqm_animation.c
+++ b/examples/others/iqm_loader/models_iqm_animation.c
@@ -12,6 +12,7 @@
#include "raylib.h"
#define RIQM_IMPLEMENTATION
+#define RAYMATH_IMPLEMENTATION
#include "riqm.h"
int main()
@@ -30,18 +31,18 @@ int main()
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
camera.fovy = 45.0f; // Camera field-of-view Y
camera.type = CAMERA_PERSPECTIVE; // Camera mode type
-
+
// Load the animated model mesh and basic data
AnimatedModel model = LoadAnimatedModel("resources/guy.iqm");
-
+printf("VER %i\n",rlGetVersion());
// Load model texture and set material
// NOTE: There is only 1 mesh and 1 material (both at index 0), thats what the 2 0's are
model = AnimatedModelAddTexture(model, "resources/guytex.png"); // REPLACE!
model = SetMeshMaterial(model, 0, 0); // REPLACE!
-
+
// Load animation data
Animation anim = LoadAnimationFromIQM("resources/guyanim.iqm");
-
+
int animFrameCounter = 0;
SetCameraMode(camera, CAMERA_FREE); // Set free camera mode
@@ -55,7 +56,7 @@ int main()
// Update
//----------------------------------------------------------------------------------
UpdateCamera(&camera);
-
+
// Play animation when spacebar is held down
if (IsKeyDown(KEY_SPACE))
{
@@ -67,17 +68,17 @@ int main()
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
-
+
ClearBackground(RAYWHITE);
BeginMode3D(camera);
DrawAnimatedModel(model, Vector3Zero(), 1.0f, WHITE); // Draw animated model
-
+
DrawGrid(10, 1.0f); // Draw a grid
EndMode3D();
-
+
DrawText("(c) Guy IQM 3D model by -------", screenWidth - 200, screenHeight - 20, 10, GRAY);
DrawFPS(10, 10);