Add missing model resources (#251)
This commit is contained in:
parent
5cfb0f3b5b
commit
39b6302733
26 changed files with 40370 additions and 8 deletions
3
.gitignore
vendored
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/)
|
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.glb
Normal file
Binary file not shown.
BIN
Examples/resources/models/gltf/greenman_hat.glb
Normal file
BIN
Examples/resources/models/gltf/greenman_hat.glb
Normal file
Binary file not shown.
BIN
Examples/resources/models/gltf/greenman_shield.glb
Normal file
BIN
Examples/resources/models/gltf/greenman_shield.glb
Normal file
Binary file not shown.
BIN
Examples/resources/models/gltf/greenman_sword.glb
Normal file
BIN
Examples/resources/models/gltf/greenman_sword.glb
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
1725
Examples/resources/models/obj/bridge.obj
Normal file
1725
Examples/resources/models/obj/bridge.obj
Normal file
File diff suppressed because it is too large
Load diff
BIN
Examples/resources/models/obj/bridge_diffuse.png
Normal file
BIN
Examples/resources/models/obj/bridge_diffuse.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 311 KiB |
12919
Examples/resources/models/obj/castle.obj
Normal file
12919
Examples/resources/models/obj/castle.obj
Normal file
File diff suppressed because it is too large
Load diff
BIN
Examples/resources/models/obj/castle_diffuse.png
Normal file
BIN
Examples/resources/models/obj/castle_diffuse.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 434 KiB |
68
Examples/resources/models/obj/cube.obj
Normal file
68
Examples/resources/models/obj/cube.obj
Normal file
|
|
@ -0,0 +1,68 @@
|
||||||
|
# reference material
|
||||||
|
#mtllib cube.mtl
|
||||||
|
|
||||||
|
# object box
|
||||||
|
|
||||||
|
# vertex (XZY)
|
||||||
|
v 5.5 0 1.5
|
||||||
|
v 8.5 0 1.5
|
||||||
|
v 5.5 0 -1.5
|
||||||
|
v 8.5 0 -1.5
|
||||||
|
v 5.5 3 1.5
|
||||||
|
v 8.5 3 1.5
|
||||||
|
v 5.5 3 -1.5
|
||||||
|
v 8.5 3 -1.5
|
||||||
|
|
||||||
|
# normals (XYZ)
|
||||||
|
vn 0 -1 0
|
||||||
|
vn 0 1 0
|
||||||
|
vn 0 0 1
|
||||||
|
vn 1 0 0
|
||||||
|
vn 0 0 -1
|
||||||
|
vn -1 0 0
|
||||||
|
|
||||||
|
# UVs (XY)
|
||||||
|
vt 0.5 0 0
|
||||||
|
vt 1 0 0
|
||||||
|
vt 1 0.5 0
|
||||||
|
vt 0.5 0.5 0
|
||||||
|
vt 0.5 0.5 0
|
||||||
|
vt 1 0.5 0
|
||||||
|
vt 0.5 1 0
|
||||||
|
vt 1 1 0
|
||||||
|
vt 0 0.5 0
|
||||||
|
vt 1 0.5 0
|
||||||
|
vt 1 0 0
|
||||||
|
vt 0 0 0
|
||||||
|
vt 0 0.5 0
|
||||||
|
vt 1 0.5 0
|
||||||
|
vt 1 1 0
|
||||||
|
vt 0 1 0
|
||||||
|
vt 0.5 0 0
|
||||||
|
vt 0 0 0
|
||||||
|
vt 0 0.5 0
|
||||||
|
vt 0.5 0.5 0
|
||||||
|
vt 0 0.5 0
|
||||||
|
vt 0.5 0.5 0
|
||||||
|
vt 0.5 1 0
|
||||||
|
vt 0 1 0
|
||||||
|
|
||||||
|
# merger
|
||||||
|
g box
|
||||||
|
|
||||||
|
# reference material
|
||||||
|
#usemtl mat01
|
||||||
|
|
||||||
|
# faces
|
||||||
|
f 1/9/1 3/10/1 4/11/1
|
||||||
|
f 4/11/1 2/12/1 1/9/1
|
||||||
|
f 5/13/2 6/14/2 8/15/2
|
||||||
|
f 8/15/2 7/16/2 5/13/2
|
||||||
|
f 1/17/6 2/18/6 6/19/6
|
||||||
|
f 6/19/6 5/20/6 1/17/6
|
||||||
|
f 2/6/1 4/5/1 8/7/1
|
||||||
|
f 8/7/1 6/8/1 2/6/1
|
||||||
|
f 4/2/3 3/1/3 7/4/3
|
||||||
|
f 7/4/3 8/3/3 4/2/3
|
||||||
|
f 3/22/5 1/21/5 5/24/5
|
||||||
|
f 5/24/5 7/23/5 3/22/5
|
||||||
BIN
Examples/resources/models/obj/cube_diffuse.png
Normal file
BIN
Examples/resources/models/obj/cube_diffuse.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
4564
Examples/resources/models/obj/house.obj
Normal file
4564
Examples/resources/models/obj/house.obj
Normal file
File diff suppressed because it is too large
Load diff
BIN
Examples/resources/models/obj/house_diffuse.png
Normal file
BIN
Examples/resources/models/obj/house_diffuse.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 383 KiB |
7301
Examples/resources/models/obj/market.obj
Normal file
7301
Examples/resources/models/obj/market.obj
Normal file
File diff suppressed because it is too large
Load diff
BIN
Examples/resources/models/obj/market_diffuse.png
Normal file
BIN
Examples/resources/models/obj/market_diffuse.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 380 KiB |
10858
Examples/resources/models/obj/plane.obj
Normal file
10858
Examples/resources/models/obj/plane.obj
Normal file
File diff suppressed because it is too large
Load diff
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue