diff --git a/.gitignore b/.gitignore index d7f4623..d6cb5ae 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,9 @@ [Oo]bj/ [Ll]og/ +# Allow obj models to be included +!Examples/resources/models/obj/ + # Visual Studio 2015 cache/options directory .vs/ # Uncomment if you have tasks that create the project's static files in wwwroot diff --git a/Examples/Models/ModelLoading.cs b/Examples/Models/ModelLoading.cs index 51ffcba..b1b82bd 100644 --- a/Examples/Models/ModelLoading.cs +++ b/Examples/Models/ModelLoading.cs @@ -68,17 +68,20 @@ public class ModelLoading if (IsFileDropped()) { - string[] files = Raylib.GetDroppedFiles(); + string[] droppedFiles = Raylib.GetDroppedFiles(); - if (files.Length == 1) + if (droppedFiles.Length == 1) { - if (IsFileExtension(files[0], ".obj") || - IsFileExtension(files[0], ".gltf") || - IsFileExtension(files[0], ".iqm") + if (IsFileExtension(droppedFiles[0], ".obj") || + IsFileExtension(droppedFiles[0], ".gltf") || + IsFileExtension(droppedFiles[0], ".glb") || + IsFileExtension(droppedFiles[0], ".vox") || + IsFileExtension(droppedFiles[0], ".iqm") || + IsFileExtension(droppedFiles[0], ".m3d") ) { UnloadModel(model); - model = LoadModel(files[0]); + model = LoadModel(droppedFiles[0]); // Set current map diffuse texture Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.Albedo, ref texture); @@ -87,11 +90,11 @@ public class ModelLoading // TODO: Move camera position from target enough distance to visualize model properly } - else if (IsFileExtension(files[0], ".png")) + else if (IsFileExtension(droppedFiles[0], ".png")) { // Unload model texture and load new one UnloadTexture(texture); - texture = LoadTexture(files[0]); + texture = LoadTexture(droppedFiles[0]); Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.Albedo, ref texture); } } diff --git a/Examples/resources/models/gltf/LICENSE b/Examples/resources/models/gltf/LICENSE index 3c9a38d..e1d1d2e 100644 --- a/Examples/resources/models/gltf/LICENSE +++ b/Examples/resources/models/gltf/LICENSE @@ -1,2 +1,5 @@ robot.glb model by @Quaternius (https://www.patreon.com/quaternius) +Licensed under CC0 1.0 Universal (CC0 1.0) - Public Domain Dedication (https://creativecommons.org/publicdomain/zero/1.0/) + +greenman.glb, greenman_hat.glb, greenman_sword.glb, greenman_shield.glb models by @iP (https://github.com/ipzaur) Licensed under CC0 1.0 Universal (CC0 1.0) - Public Domain Dedication (https://creativecommons.org/publicdomain/zero/1.0/) \ No newline at end of file diff --git a/Examples/resources/models/gltf/greenman.glb b/Examples/resources/models/gltf/greenman.glb new file mode 100644 index 0000000..18edcaf Binary files /dev/null and b/Examples/resources/models/gltf/greenman.glb differ diff --git a/Examples/resources/models/gltf/greenman_hat.glb b/Examples/resources/models/gltf/greenman_hat.glb new file mode 100644 index 0000000..ee932ad Binary files /dev/null and b/Examples/resources/models/gltf/greenman_hat.glb differ diff --git a/Examples/resources/models/gltf/greenman_shield.glb b/Examples/resources/models/gltf/greenman_shield.glb new file mode 100644 index 0000000..69ef618 Binary files /dev/null and b/Examples/resources/models/gltf/greenman_shield.glb differ diff --git a/Examples/resources/models/gltf/greenman_sword.glb b/Examples/resources/models/gltf/greenman_sword.glb new file mode 100644 index 0000000..bb8e24b Binary files /dev/null and b/Examples/resources/models/gltf/greenman_sword.glb differ diff --git a/Examples/resources/models/gltf/old_car_new.glb b/Examples/resources/models/gltf/old_car_new.glb deleted file mode 100644 index 119995c..0000000 Binary files a/Examples/resources/models/gltf/old_car_new.glb and /dev/null differ diff --git a/Examples/resources/models/gltf/plane.glb b/Examples/resources/models/gltf/plane.glb deleted file mode 100644 index 452e1c5..0000000 Binary files a/Examples/resources/models/gltf/plane.glb and /dev/null differ diff --git a/Examples/resources/models/obj/bridge_diffuse.png b/Examples/resources/models/obj/bridge_diffuse.png new file mode 100644 index 0000000..45a86b5 Binary files /dev/null and b/Examples/resources/models/obj/bridge_diffuse.png differ diff --git a/Examples/resources/models/obj/castle_diffuse.png b/Examples/resources/models/obj/castle_diffuse.png new file mode 100644 index 0000000..c7085a3 Binary files /dev/null and b/Examples/resources/models/obj/castle_diffuse.png differ diff --git a/Examples/resources/models/obj/cube_diffuse.png b/Examples/resources/models/obj/cube_diffuse.png new file mode 100644 index 0000000..6becd47 Binary files /dev/null and b/Examples/resources/models/obj/cube_diffuse.png differ diff --git a/Examples/resources/models/obj/house_diffuse.png b/Examples/resources/models/obj/house_diffuse.png new file mode 100644 index 0000000..b36a58a Binary files /dev/null and b/Examples/resources/models/obj/house_diffuse.png differ diff --git a/Examples/resources/models/obj/market_diffuse.png b/Examples/resources/models/obj/market_diffuse.png new file mode 100644 index 0000000..3ad3046 Binary files /dev/null and b/Examples/resources/models/obj/market_diffuse.png differ diff --git a/Examples/resources/models/obj/plane_diffuse.png b/Examples/resources/models/obj/plane_diffuse.png new file mode 100644 index 0000000..07371c0 Binary files /dev/null and b/Examples/resources/models/obj/plane_diffuse.png differ diff --git a/Examples/resources/models/obj/turret_diffuse.png b/Examples/resources/models/obj/turret_diffuse.png new file mode 100644 index 0000000..33628e3 Binary files /dev/null and b/Examples/resources/models/obj/turret_diffuse.png differ diff --git a/Examples/resources/models/obj/well_diffuse.png b/Examples/resources/models/obj/well_diffuse.png new file mode 100644 index 0000000..f8f6686 Binary files /dev/null and b/Examples/resources/models/obj/well_diffuse.png differ diff --git a/Examples/resources/models/vox/fez.vox b/Examples/resources/models/vox/fez.vox new file mode 100644 index 0000000..e9fa726 Binary files /dev/null and b/Examples/resources/models/vox/fez.vox differ