Reviewed models examples paths

This commit is contained in:
raysan5 2021-10-12 21:01:49 +02:00
parent 007e840be1
commit f1659d78d3
5 changed files with 23 additions and 23 deletions

View file

@ -37,17 +37,17 @@ int main(void)
camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target) 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.fovy = 45.0f; // Camera field-of-view Y
camera.projection = CAMERA_PERSPECTIVE; // Camera mode type camera.projection = CAMERA_PERSPECTIVE; // Camera mode type
Model model = LoadModel("resources/guy/guy.iqm"); // Load the animated model mesh and basic data Model model = LoadModel("resources/models/iqm/guy.iqm"); // Load the animated model mesh and basic data
Texture2D texture = LoadTexture("resources/guy/guytex.png"); // Load model texture and set material Texture2D texture = LoadTexture("resources/models/iqm/guytex.png"); // Load model texture and set material
SetMaterialTexture(&model.materials[0], MATERIAL_MAP_DIFFUSE, texture); // Set model material map texture SetMaterialTexture(&model.materials[0], MATERIAL_MAP_DIFFUSE, texture); // Set model material map texture
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
// Load animation data // Load animation data
int animsCount = 0; int animsCount = 0;
ModelAnimation *anims = LoadModelAnimations("resources/guy/guyanim.iqm", &animsCount); ModelAnimation *anims = LoadModelAnimations("resources/models/iqm/guyanim.iqm", &animsCount);
int animFrameCounter = 0; int animFrameCounter = 0;
SetCameraMode(camera, CAMERA_FREE); // Set free camera mode SetCameraMode(camera, CAMERA_FREE); // Set free camera mode

View file

@ -42,14 +42,14 @@ int main(void)
Model model[MAX_MODELS] = { 0 }; Model model[MAX_MODELS] = { 0 };
model[0] = LoadModel("resources/gltf/raylib_32x32.glb"); model[0] = LoadModel("resources/models/gltf/raylib_32x32.glb");
model[1] = LoadModel("resources/gltf/rigged_figure.glb"); model[1] = LoadModel("resources/models/gltf/rigged_figure.glb");
model[2] = LoadModel("resources/gltf/GearboxAssy.glb"); model[2] = LoadModel("resources/models/gltf/GearboxAssy.glb");
model[3] = LoadModel("resources/gltf/BoxAnimated.glb"); model[3] = LoadModel("resources/models/gltf/BoxAnimated.glb");
model[4] = LoadModel("resources/gltf/AnimatedTriangle.gltf"); model[4] = LoadModel("resources/models/gltf/AnimatedTriangle.gltf");
model[5] = LoadModel("resources/gltf/AnimatedMorphCube.glb"); model[5] = LoadModel("resources/models/gltf/AnimatedMorphCube.glb");
model[6] = LoadModel("resources/gltf/vertex_colored_object.glb"); model[6] = LoadModel("resources/models/gltf/vertex_colored_object.glb");
model[7] = LoadModel("resources/gltf/girl.glb"); model[7] = LoadModel("resources/models/gltf/girl.glb");
int currentModel = 0; int currentModel = 0;

View file

@ -5,9 +5,9 @@
* This example has been created using raylib 3.8 (www.raylib.com) * This example has been created using raylib 3.8 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* *
* Example contributed by Johann Nadalutti * Example contributed by Johann Nadalutti (@procfxgen)
* *
* Copyright (c) 2021 Johann Nadalutti * Copyright (c) 2021 Johann Nadalutti (@procfxgen)
* *
********************************************************************************************/ ********************************************************************************************/

View file

@ -31,16 +31,16 @@ int main(void)
camera.target = (Vector3){ 0.0f, 8.0f, 0.0f }; // Camera looking at point camera.target = (Vector3){ 0.0f, 8.0f, 0.0f }; // Camera looking at point
camera.up = (Vector3){ 0.0f, 1.6f, 0.0f }; // Camera up vector (rotation towards target) camera.up = (Vector3){ 0.0f, 1.6f, 0.0f }; // Camera up vector (rotation towards target)
camera.fovy = 45.0f; // Camera field-of-view Y camera.fovy = 45.0f; // Camera field-of-view Y
camera.projection = CAMERA_PERSPECTIVE; // Camera mode type camera.projection = CAMERA_PERSPECTIVE; // Camera mode type
Ray ray = { 0 }; // Picking ray Ray ray = { 0 }; // Picking ray
Model tower = LoadModel("resources/models/turret.obj"); // Load OBJ model Model tower = LoadModel("resources/models/obj/turret.obj"); // Load OBJ model
Texture2D texture = LoadTexture("resources/models/turret_diffuse.png"); // Load model texture Texture2D texture = LoadTexture("resources/models/obj/turret_diffuse.png"); // Load model texture
tower.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture; // Set model diffuse texture tower.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture; // Set model diffuse texture
Vector3 towerPos = { 0.0f, 0.0f, 0.0f }; // Set model position Vector3 towerPos = { 0.0f, 0.0f, 0.0f }; // Set model position
BoundingBox towerBBox = GetMeshBoundingBox(tower.meshes[0]); // Get mesh bounding box BoundingBox towerBBox = GetMeshBoundingBox(tower.meshes[0]); // Get mesh bounding box
// Ground quad // Ground quad
Vector3 g0 = (Vector3){ -50.0f, 0.0f, -50.0f }; Vector3 g0 = (Vector3){ -50.0f, 0.0f, -50.0f };

View file

@ -4289,8 +4289,8 @@ static Model LoadIQM(const char *fileName)
// Load IQM animation data // Load IQM animation data
static ModelAnimation* LoadIQMModelAnimations(const char *fileName, unsigned int *animCount) static ModelAnimation* LoadIQMModelAnimations(const char *fileName, unsigned int *animCount)
{ {
#define IQM_MAGIC "INTERQUAKEMODEL" // IQM file magic number #define IQM_MAGIC "INTERQUAKEMODEL" // IQM file magic number
#define IQM_VERSION 2 // only IQM version 2 supported #define IQM_VERSION 2 // only IQM version 2 supported
unsigned int fileSize = 0; unsigned int fileSize = 0;
unsigned char *fileData = LoadFileData(fileName, &fileSize); unsigned char *fileData = LoadFileData(fileName, &fileSize);