Add additional model resources
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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/)
|
||||
BIN
Examples/resources/models/gltf/greenman.glb
Normal file
BIN
Examples/resources/models/gltf/greenman_hat.glb
Normal file
BIN
Examples/resources/models/gltf/greenman_shield.glb
Normal file
BIN
Examples/resources/models/gltf/greenman_sword.glb
Normal file
BIN
Examples/resources/models/obj/bridge_diffuse.png
Normal file
|
After Width: | Height: | Size: 311 KiB |
BIN
Examples/resources/models/obj/castle_diffuse.png
Normal file
|
After Width: | Height: | Size: 434 KiB |
BIN
Examples/resources/models/obj/cube_diffuse.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
Examples/resources/models/obj/house_diffuse.png
Normal file
|
After Width: | Height: | Size: 383 KiB |
BIN
Examples/resources/models/obj/market_diffuse.png
Normal file
|
After Width: | Height: | Size: 380 KiB |
BIN
Examples/resources/models/obj/plane_diffuse.png
Normal file
|
After Width: | Height: | Size: 804 KiB |
BIN
Examples/resources/models/obj/turret_diffuse.png
Normal file
|
After Width: | Height: | Size: 371 KiB |
BIN
Examples/resources/models/obj/well_diffuse.png
Normal file
|
After Width: | Height: | Size: 334 KiB |