summaryrefslogtreecommitdiffhomepage
path: root/examples/models/models_obj_viewer.c
diff options
context:
space:
mode:
authorRay <[email protected]>2019-03-29 20:22:50 +0100
committerRay <[email protected]>2019-03-29 20:22:50 +0100
commitbe6d237b9ebbe245de4384c17b84e75dab0f4981 (patch)
treedf451509352e1c197c28dc94e9211468a1124540 /examples/models/models_obj_viewer.c
parenta197f40bb4bd5a644ad54bef756d7f435977df9d (diff)
downloadraylib-be6d237b9ebbe245de4384c17b84e75dab0f4981.tar.gz
raylib-be6d237b9ebbe245de4384c17b84e75dab0f4981.zip
Review models examples
Diffstat (limited to 'examples/models/models_obj_viewer.c')
-rw-r--r--examples/models/models_obj_viewer.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/examples/models/models_obj_viewer.c b/examples/models/models_obj_viewer.c
index 15f79549..ffa609e0 100644
--- a/examples/models/models_obj_viewer.c
+++ b/examples/models/models_obj_viewer.c
@@ -27,13 +27,13 @@ int main()
Model model = LoadModel("resources/models/turret.obj"); // Load default model obj
Texture2D texture = LoadTexture("resources/models/turret_diffuse.png"); // Load default model texture
- model.material.maps[MAP_DIFFUSE].texture = texture; // Bind texture to model
+ model.materials[0].maps[MAP_DIFFUSE].texture = texture; // Bind texture to model
- Vector3 position = { 0.0, 0.0, 0.0 }; // Set model position
- BoundingBox bounds = MeshBoundingBox(model.mesh); // Set model bounds
- bool selected = false; // Selected object flag
+ Vector3 position = { 0.0, 0.0, 0.0 }; // Set model position
+ BoundingBox bounds = MeshBoundingBox(model.meshes[0]); // Set model bounds
+ bool selected = false; // Selected object flag
- SetCameraMode(camera, CAMERA_FREE); // Set a free camera mode
+ SetCameraMode(camera, CAMERA_FREE); // Set a free camera mode
char objFilename[64] = "turret.obj";
@@ -54,15 +54,15 @@ int main()
{
if (IsFileExtension(droppedFiles[0], ".obj"))
{
- UnloadMesh(&model.mesh);
- model.mesh = LoadMesh(droppedFiles[0]);
- bounds = MeshBoundingBox(model.mesh);
+ UnloadMesh(&model.meshes[0]);
+ model.meshes[0] = LoadMesh(droppedFiles[0]);
+ bounds = MeshBoundingBox(model.meshes[0]);
}
else if (IsFileExtension(droppedFiles[0], ".png"))
{
UnloadTexture(texture);
texture = LoadTexture(droppedFiles[0]);
- model.material.maps[MAP_DIFFUSE].texture = texture;
+ model.materials[0].maps[MAP_DIFFUSE].texture = texture;
}
strcpy(objFilename, GetFileName(droppedFiles[0]));