fixed so it breaks
This commit is contained in:
parent
311d8b92f5
commit
b129ba09a6
3 changed files with 130 additions and 112 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue