Add additional model resources
3
.gitignore
vendored
|
|
@ -34,6 +34,9 @@
|
||||||
[Oo]bj/
|
[Oo]bj/
|
||||||
[Ll]og/
|
[Ll]og/
|
||||||
|
|
||||||
|
# Allow obj models to be included
|
||||||
|
!Examples/resources/models/obj/
|
||||||
|
|
||||||
# Visual Studio 2015 cache/options directory
|
# Visual Studio 2015 cache/options directory
|
||||||
.vs/
|
.vs/
|
||||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||||
|
|
|
||||||
|
|
@ -68,17 +68,20 @@ public class ModelLoading
|
||||||
|
|
||||||
if (IsFileDropped())
|
if (IsFileDropped())
|
||||||
{
|
{
|
||||||
string[] files = Raylib.GetDroppedFiles();
|
string[] droppedFiles = Raylib.GetDroppedFiles();
|
||||||
|
|
||||||
if (files.Length == 1)
|
if (droppedFiles.Length == 1)
|
||||||
{
|
{
|
||||||
if (IsFileExtension(files[0], ".obj") ||
|
if (IsFileExtension(droppedFiles[0], ".obj") ||
|
||||||
IsFileExtension(files[0], ".gltf") ||
|
IsFileExtension(droppedFiles[0], ".gltf") ||
|
||||||
IsFileExtension(files[0], ".iqm")
|
IsFileExtension(droppedFiles[0], ".glb") ||
|
||||||
|
IsFileExtension(droppedFiles[0], ".vox") ||
|
||||||
|
IsFileExtension(droppedFiles[0], ".iqm") ||
|
||||||
|
IsFileExtension(droppedFiles[0], ".m3d")
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UnloadModel(model);
|
UnloadModel(model);
|
||||||
model = LoadModel(files[0]);
|
model = LoadModel(droppedFiles[0]);
|
||||||
|
|
||||||
// Set current map diffuse texture
|
// Set current map diffuse texture
|
||||||
Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.Albedo, ref 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
|
// 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
|
// Unload model texture and load new one
|
||||||
UnloadTexture(texture);
|
UnloadTexture(texture);
|
||||||
texture = LoadTexture(files[0]);
|
texture = LoadTexture(droppedFiles[0]);
|
||||||
Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.Albedo, ref texture);
|
Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.Albedo, ref texture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,5 @@
|
||||||
robot.glb model by @Quaternius (https://www.patreon.com/quaternius)
|
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/)
|
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 |