Remove replace obj with glb files, don't import materials (Not favoring that solution anymore, sensible defaults applied to keep demoes consistent)
This commit is contained in:
parent
d658d7a300
commit
44e8f784f5
@ -35,7 +35,10 @@ Texture Texture::FromFile(const char *filename) {
|
||||
Material::Material() {
|
||||
usesTex = false;
|
||||
|
||||
shininess = 8;
|
||||
ambient = Color(0.7, 0.7, 0.7);
|
||||
diffuse = Color(1.0, 1.0, 1.0);
|
||||
specular = Color(0.2, 0.2, 0.2);
|
||||
shininess = 1;
|
||||
|
||||
alphaScissor = 0.0f;
|
||||
unshaded = false;
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include <assimp/postprocess.h>
|
||||
|
||||
|
||||
SubMesh *aiMesh2SubMesh(aiMesh *mesh, aiMaterial *material);
|
||||
SubMesh *aiMesh2SubMesh(aiMesh *mesh);
|
||||
Color aiColor3D2Color(aiColor3D aicolor);
|
||||
|
||||
|
||||
@ -130,7 +130,7 @@ Mesh* Mesh::FromFile(const char *filename) {
|
||||
Mesh *my_mesh = new Mesh();
|
||||
for (int i = 0; i < root->mNumMeshes; i++) {
|
||||
aiMesh *mesh_to_import = scene->mMeshes[root->mMeshes[i]];
|
||||
my_mesh->submeshes.push_back(aiMesh2SubMesh(mesh_to_import, scene->mMaterials[mesh_to_import->mMaterialIndex]));
|
||||
my_mesh->submeshes.push_back(aiMesh2SubMesh(mesh_to_import));
|
||||
}
|
||||
|
||||
my_mesh->SetupMesh();
|
||||
@ -173,7 +173,7 @@ void Mesh::SetupMesh() {
|
||||
}
|
||||
|
||||
|
||||
SubMesh *aiMesh2SubMesh(aiMesh *aimesh, aiMaterial* material){
|
||||
SubMesh *aiMesh2SubMesh(aiMesh *aimesh){
|
||||
SubMesh *sub = new SubMesh();
|
||||
for (int i = 0; i < aimesh->mNumVertices; i++) {
|
||||
aiVector3D aiPosition = aimesh->mVertices[i];
|
||||
@ -190,24 +190,7 @@ SubMesh *aiMesh2SubMesh(aiMesh *aimesh, aiMaterial* material){
|
||||
Index index(face[0], face[1], face[2]);
|
||||
sub->indices.push_back(index);
|
||||
}
|
||||
|
||||
// Get material properties
|
||||
aiColor3D ambient;
|
||||
if (AI_SUCCESS == material->Get(AI_MATKEY_COLOR_AMBIENT, ambient))
|
||||
sub->material.ambient = aiColor3D2Color(ambient);
|
||||
|
||||
aiColor3D diffuse;
|
||||
if (AI_SUCCESS == material->Get(AI_MATKEY_COLOR_DIFFUSE, diffuse))
|
||||
sub->material.diffuse = aiColor3D2Color(diffuse);
|
||||
|
||||
aiColor3D specular;
|
||||
if (AI_SUCCESS == material->Get(AI_MATKEY_COLOR_SPECULAR, specular))
|
||||
sub->material.specular = aiColor3D2Color(specular);
|
||||
|
||||
float shininess;
|
||||
if(AI_SUCCESS == material->Get(AI_MATKEY_SHININESS, shininess))
|
||||
sub->material.shininess = (int) shininess;
|
||||
|
||||
|
||||
return sub;
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ function init()
|
||||
couch.Node.GetRoot():AddChild(skybox:Instance())
|
||||
|
||||
local physics_ball_prefab = couch.Rigidbody()
|
||||
local physics_ball_mesh = couch.Mesh.FromFile("../resources/ball.obj")
|
||||
local physics_ball_mesh = couch.Mesh.FromFile("../resources/ball.glb")
|
||||
material = physics_ball_mesh:GetMaterial(0)
|
||||
material.ambient = BLUE
|
||||
material.diffuse = BLUE
|
||||
@ -62,7 +62,7 @@ function init()
|
||||
|
||||
make_ground()
|
||||
|
||||
local character_prefab = couch.Mesh.FromFile("../resources/capsule.obj")
|
||||
local character_prefab = couch.Mesh.FromFile("../resources/capsule.glb")
|
||||
material = character_prefab:GetMaterial(0)
|
||||
material.ambient = BLUE
|
||||
material.diffuse = BLUE
|
||||
@ -77,12 +77,12 @@ function init()
|
||||
character = character_body:Instance()
|
||||
couch.Node.GetRoot():AddChild(character)
|
||||
|
||||
local cube_prefab = couch.Mesh.FromFile("../resources/cube.obj")
|
||||
local cube_prefab = couch.Mesh.FromFile("../resources/cube.glb")
|
||||
material = cube_prefab:GetMaterial(0)
|
||||
material.ambient = RED
|
||||
material.diffuse = RED
|
||||
cube_prefab:SetMaterial(0, material)
|
||||
local orbiter = couch.Mesh.FromFile("../resources/ball.obj")
|
||||
local orbiter = couch.Mesh.FromFile("../resources/ball.glb")
|
||||
orbiter:UniformScale(0.25);
|
||||
orbiter:Translate(couch.Vector3(1.0, 0.0, 0.0))
|
||||
cube_prefab:AddChild(orbiter)
|
||||
@ -92,7 +92,7 @@ function init()
|
||||
couch.Node.GetRoot():AddChild(die_cube)
|
||||
die_cube:Translate(couch.Vector3(0.0, 0.0, 3.0))
|
||||
|
||||
local ball_prefab = couch.Mesh.FromFile("../resources/ball.obj")
|
||||
local ball_prefab = couch.Mesh.FromFile("../resources/ball.glb")
|
||||
material = ball_prefab:GetMaterial(0)
|
||||
ball_prefab:SetMaterial(0, material)
|
||||
ball = ball_prefab:Instance()
|
||||
@ -100,12 +100,12 @@ function init()
|
||||
|
||||
ball:Translate(couch.Vector3(0.0, 3.0, 0.0))
|
||||
|
||||
local trough_prefab = couch.TexturedMesh("../resources/trough.obj", "../resources/wood_lowres.png")
|
||||
local trough_prefab = couch.TexturedMesh("../resources/trough.glb", "../resources/wood_lowres.png")
|
||||
trough = trough_prefab:Instance()
|
||||
couch.Node.GetRoot():AddChild(trough)
|
||||
trough:Translate(couch.Vector3(10.0, 0.0, 0.0))
|
||||
|
||||
local scaffold_prefab = couch.TexturedMesh("../resources/scaffold.obj", "../resources/grate_floor_lowres.png", "../resources/railing.png")
|
||||
local scaffold_prefab = couch.TexturedMesh("../resources/scaffold.glb", "../resources/grate_floor_lowres.png", "../resources/railing.png")
|
||||
local scaffold = scaffold_prefab:Instance()
|
||||
material = scaffold:GetMaterial(0)
|
||||
material.alphaScissor = 0.9
|
||||
@ -119,7 +119,7 @@ function init()
|
||||
couch.Node.GetRoot():AddChild(scaffold)
|
||||
scaffold:Translate(couch.Vector3(-3.0, 3.0, 0.0))
|
||||
|
||||
local barn_prefab = couch.TexturedMesh("../resources/barn.obj", "../resources/paintedwood.jpg", "../resources/barnroof_lowres.png", "../resources/wood_lowres.png")
|
||||
local barn_prefab = couch.TexturedMesh("../resources/barn.glb", "../resources/paintedwood.jpg", "../resources/barnroof_lowres.png", "../resources/wood_lowres.png")
|
||||
material = barn_prefab:GetMaterial(0)
|
||||
material.cullBack = false
|
||||
barn_prefab:SetMaterial(0, material)
|
||||
@ -169,7 +169,7 @@ function init_point_lights()
|
||||
pointLight:SetAmbient(0.2)
|
||||
pointLight:SetDiffuse(1.0)
|
||||
pointLight:SetSpecular(0.1)
|
||||
local lightBox = couch.Mesh.FromFile("../resources/cube.obj")
|
||||
local lightBox = couch.Mesh.FromFile("../resources/cube.glb")
|
||||
lightBox:UniformScale(0.5);
|
||||
local material = lightBox:GetMaterial(0)
|
||||
material.ambient = color
|
||||
@ -206,7 +206,7 @@ function onmousemotion(_, _, relx, rely)
|
||||
end
|
||||
|
||||
function make_ground()
|
||||
local ground_prefab = couch.TexturedMesh("../resources/ground.obj", "../resources/grass_lowres.png")
|
||||
local ground_prefab = couch.TexturedMesh("../resources/ground.glb", "../resources/grass_lowres.png")
|
||||
|
||||
local ground_prefab_transform = ground_prefab:GetTransform()
|
||||
ground_prefab_transform.position = couch.Vector3(0.0, -2.0, 0.0)
|
||||
|
@ -14,10 +14,10 @@ function init()
|
||||
light:SetSpecular(0.1)
|
||||
couch.Node.GetRoot():AddChild(light:Instance())
|
||||
|
||||
local ibox = couch.TexturedMesh("../resources/inverted_cube.obj", "../resources/paintedwood.jpg")
|
||||
local ibox = couch.TexturedMesh("../resources/inverted_cube.glb", "../resources/paintedwood.jpg")
|
||||
couch.Node.GetRoot():AddChild(ibox:Instance())
|
||||
|
||||
local box = couch.Mesh.FromFile("../resources/cube.obj")
|
||||
local box = couch.Mesh.FromFile("../resources/cube.glb")
|
||||
material = box:GetMaterial(0)
|
||||
material.ambient = Vector3(1.0, 0.0, 0.0)
|
||||
material.diffuse = Vector3(1.0, 0.0, 0.0)
|
||||
|
BIN
demo/resources/ball.glb
Normal file
BIN
demo/resources/ball.glb
Normal file
Binary file not shown.
@ -1,12 +0,0 @@
|
||||
# Blender MTL File: 'None'
|
||||
# Material Count: 1
|
||||
|
||||
newmtl Material.001
|
||||
Ns 225.000000
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.800000 0.800000 0.800000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.450000
|
||||
d 1.000000
|
||||
illum 2
|
File diff suppressed because it is too large
Load Diff
BIN
demo/resources/barn.glb
Normal file
BIN
demo/resources/barn.glb
Normal file
Binary file not shown.
@ -1,32 +0,0 @@
|
||||
# Blender MTL File: 'barn.blend'
|
||||
# Material Count: 3
|
||||
|
||||
newmtl post
|
||||
Ns 323.999994
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.800000 0.800000 0.800000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
|
||||
newmtl roofing
|
||||
Ns 323.999994
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.800000 0.800000 0.800000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
|
||||
newmtl wood
|
||||
Ns 323.999994
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.800000 0.800000 0.800000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
@ -1,221 +0,0 @@
|
||||
# Blender v2.91.0 OBJ File: 'barn.blend'
|
||||
# www.blender.org
|
||||
mtllib barn.mtl
|
||||
o Cylinder
|
||||
v 0.000000 12.002157 -6.000000
|
||||
v 0.000000 12.002157 6.000000
|
||||
v 4.242640 10.244799 -6.000000
|
||||
v 4.242640 10.244799 6.000000
|
||||
v 5.973321 6.006279 -5.973321
|
||||
v 5.973321 6.006278 5.959068
|
||||
v -5.987575 6.006279 -5.973321
|
||||
v -5.983434 6.007652 5.945425
|
||||
v -4.242641 10.244797 -6.000000
|
||||
v -4.242641 10.244797 6.000000
|
||||
v -5.975150 -0.010399 5.918136
|
||||
v 5.946643 -0.010399 5.918136
|
||||
v -5.975150 -0.010399 5.918136
|
||||
v -5.975150 -0.010400 -5.946643
|
||||
v 5.946643 -0.010400 -5.946643
|
||||
v -2.252070 -0.010399 5.918136
|
||||
v 2.289558 -0.010399 5.918136
|
||||
v -2.252071 3.065055 5.932081
|
||||
v 2.289565 3.065055 5.934867
|
||||
v -5.987575 6.006279 -5.973321
|
||||
v -5.983434 6.007652 5.945425
|
||||
v -9.987576 5.006279 -5.973321
|
||||
v -9.983434 5.007652 5.945424
|
||||
v -8.386020 0.003052 4.737424
|
||||
v -8.386020 5.409821 4.737424
|
||||
v -8.386020 0.003052 4.248708
|
||||
v -8.386020 5.409821 4.248708
|
||||
v -7.897304 0.003052 4.737424
|
||||
v -7.897304 5.547104 4.737424
|
||||
v -7.897304 0.003052 4.248708
|
||||
v -7.897304 5.547104 4.248708
|
||||
v -8.386020 0.003052 -4.206997
|
||||
v -8.386020 5.409820 -4.206997
|
||||
v -8.386020 0.003052 -4.695714
|
||||
v -8.386020 5.409820 -4.695714
|
||||
v -7.897304 0.003052 -4.206997
|
||||
v -7.897304 5.547104 -4.206997
|
||||
v -7.897304 0.003052 -4.695714
|
||||
v -7.897304 5.547104 -4.695713
|
||||
v 0.382683 10.013505 5.984599
|
||||
v -0.000000 10.089625 5.984768
|
||||
v -1.000000 9.089624 5.975662
|
||||
v -0.707107 8.382519 5.970365
|
||||
v 0.707107 8.382519 5.971980
|
||||
v -0.382683 8.165746 5.969009
|
||||
v -0.923880 8.706942 5.972701
|
||||
v 0.382683 8.165746 5.969883
|
||||
v 1.000000 9.089625 5.977946
|
||||
v -0.707107 9.796732 5.981628
|
||||
v 0.923879 8.706942 5.974811
|
||||
v 0.923879 9.472309 5.980907
|
||||
v 0.707107 9.796732 5.983243
|
||||
v -0.382683 10.013505 5.983725
|
||||
v -0.923880 9.472309 5.978797
|
||||
v 0.000000 8.089625 5.968840
|
||||
v 4.242640 10.244799 4.159337
|
||||
v 4.242640 10.244799 1.416625
|
||||
v 0.000000 12.002157 2.181214
|
||||
v -4.242641 10.244797 -1.747424
|
||||
v -4.242641 10.244797 -5.036804
|
||||
v -2.149303 11.111887 -3.947335
|
||||
v -2.107151 11.129346 -1.846688
|
||||
vt 0.448689 0.656606
|
||||
vt 0.277979 0.465403
|
||||
vt 0.273972 0.402066
|
||||
vt 0.262560 0.348372
|
||||
vt 0.245481 0.312495
|
||||
vt 0.225334 0.299896
|
||||
vt 0.205188 0.312494
|
||||
vt 0.188108 0.348371
|
||||
vt 0.176697 0.402065
|
||||
vt 0.172689 0.465401
|
||||
vt 0.001980 0.656614
|
||||
vt -0.089664 -0.044686
|
||||
vt 0.539796 -0.044902
|
||||
vt 0.248827 0.952721
|
||||
vt 0.035076 0.675010
|
||||
vt -0.052257 0.004118
|
||||
vt 0.550151 0.002625
|
||||
vt 0.462437 0.673949
|
||||
vt 1.470035 0.007503
|
||||
vt 1.483796 0.997562
|
||||
vt 0.743820 0.999395
|
||||
vt 0.732478 0.009331
|
||||
vt 0.005632 0.980645
|
||||
vt -0.001528 -0.009313
|
||||
vt 0.644990 -0.007871
|
||||
vt 0.646348 0.955236
|
||||
vt 0.037541 0.955445
|
||||
vt 0.037963 -0.007871
|
||||
vt 0.227533 -0.007871
|
||||
vt 0.227533 0.484420
|
||||
vt 0.458781 0.484422
|
||||
vt 0.458781 -0.007871
|
||||
vt 2.204045 -0.009312
|
||||
vt 2.221146 0.980935
|
||||
vt 0.239229 0.748702
|
||||
vt 0.269849 0.748702
|
||||
vt 0.269849 0.779322
|
||||
vt 0.239229 0.779322
|
||||
vt 0.918917 0.574529
|
||||
vt 0.918917 0.430918
|
||||
vt 0.999913 0.430918
|
||||
vt 0.999913 0.574529
|
||||
vt 0.176697 0.528738
|
||||
vt 0.188109 0.582432
|
||||
vt 0.205188 0.618309
|
||||
vt 0.225334 0.630908
|
||||
vt 0.245481 0.618310
|
||||
vt 0.262560 0.582433
|
||||
vt 0.273972 0.528739
|
||||
vt 0.225335 0.947443
|
||||
vt 0.634041 0.520028
|
||||
vt -0.232038 0.520028
|
||||
vt -0.151097 1.381976
|
||||
vt 0.634041 1.381976
|
||||
vt -0.441446 1.381977
|
||||
vt -0.636302 1.381977
|
||||
vt -0.631969 2.241306
|
||||
vt 0.631216 2.241305
|
||||
vt 0.631217 -1.202265
|
||||
vt -0.630524 -1.201730
|
||||
vt -0.636302 -0.341921
|
||||
vt 0.183855 -0.341921
|
||||
vt 0.532075 -0.341921
|
||||
vt 0.634041 -0.341921
|
||||
vt 0.416742 0.083369
|
||||
vt 0.194363 0.091932
|
||||
vt -0.636302 0.520028
|
||||
vt 0.742673 -1.662150
|
||||
vt -0.859941 -1.661471
|
||||
vt -0.860192 -1.711059
|
||||
vt 0.742429 -1.711738
|
||||
vt 1.073623 -1.241022
|
||||
vt 1.073623 1.008689
|
||||
vt 0.634689 1.008404
|
||||
vt 0.634688 -1.241306
|
||||
vt 1.305423 -1.711738
|
||||
vt 1.374063 -1.711738
|
||||
vt 1.374063 -1.594569
|
||||
vt 1.305423 -1.594569
|
||||
vt 0.000087 0.723871
|
||||
vt 0.000087 0.574703
|
||||
vt 0.081083 0.574703
|
||||
vt 0.081083 0.723872
|
||||
vt -0.619781 1.620252
|
||||
vt -0.353799 0.525439
|
||||
vt -0.867279 0.525439
|
||||
vt -0.867279 1.620252
|
||||
vt -1.073724 0.142970
|
||||
vt 1.612726 0.148805
|
||||
vt 1.612429 0.493274
|
||||
vt -1.074021 0.487440
|
||||
vt 1.680344 0.837889
|
||||
vt -1.074318 0.831910
|
||||
vt 1.680046 1.182359
|
||||
vt -1.074616 1.176377
|
||||
vt 1.611537 1.526681
|
||||
vt -1.074913 1.520847
|
||||
vt -1.546928 0.762659
|
||||
vt 2.365793 0.812032
|
||||
vt 2.363954 1.313756
|
||||
vt -1.548768 1.264385
|
||||
vt -1.541410 -0.742515
|
||||
vt 2.371313 -0.693142
|
||||
vt 2.468821 -0.190165
|
||||
vt -1.543249 -0.240789
|
||||
vt 2.466981 0.311560
|
||||
vt -1.545088 0.260933
|
||||
vn -0.0007 -0.0099 1.0000
|
||||
vn 0.0000 -0.0054 -1.0000
|
||||
vn 0.0000 -0.0044 -1.0000
|
||||
vn 1.0000 -0.0044 -0.0000
|
||||
vn -0.0006 -0.0058 1.0000
|
||||
vn -1.0000 -0.0017 0.0002
|
||||
vn 0.0000 -1.0000 -0.0000
|
||||
vn 0.0000 -0.0091 1.0000
|
||||
vn 0.3827 0.9239 0.0000
|
||||
vn 0.9258 0.3780 0.0000
|
||||
vn -0.9248 0.3804 0.0001
|
||||
vn -0.3827 0.9239 0.0000
|
||||
vn 0.0000 0.0000 1.0000
|
||||
vn 0.2425 -0.9701 0.0000
|
||||
vn -0.2704 0.9627 0.0000
|
||||
vn -1.0000 0.0000 0.0000
|
||||
vn 0.0000 0.0000 -1.0000
|
||||
vn 1.0000 0.0000 0.0000
|
||||
usemtl wood
|
||||
s off
|
||||
f 4/1/1 48/2/1 50/3/1 44/4/1 47/5/1 55/6/1 45/7/1 43/8/1 46/9/1 42/10/1 10/11/1 8/12/1 6/13/1
|
||||
f 1/14/2 3/15/2 5/16/2 7/17/2 9/18/2
|
||||
f 14/19/3 7/20/3 5/21/3 15/22/3
|
||||
f 15/22/4 5/21/4 6/23/4 12/24/4
|
||||
f 12/25/5 6/26/5 8/27/5 11/28/5 16/29/5 18/30/5 19/31/5 17/32/5
|
||||
f 13/33/6 8/34/6 7/20/6 14/19/6
|
||||
f 26/35/7 30/36/7 28/37/7 24/38/7
|
||||
f 34/39/7 38/40/7 36/41/7 32/42/7
|
||||
f 10/11/8 42/10/8 54/43/8 49/44/8 53/45/8 41/46/8 40/47/8 52/48/8 51/49/8 48/2/8 4/1/8 2/50/8
|
||||
usemtl roofing
|
||||
f 1/51/9 58/52/9 57/53/9 3/54/9
|
||||
f 3/54/10 57/53/10 56/55/10 4/56/10 6/57/10 5/58/10
|
||||
f 7/59/11 8/60/11 10/61/11 59/62/11 60/63/11 9/64/11
|
||||
f 9/64/12 60/63/12 61/65/12 62/66/12 59/62/12 10/61/12 2/67/12 58/52/12 1/51/12
|
||||
f 7/68/13 8/69/13 21/70/13 20/71/13
|
||||
f 20/72/14 21/73/14 23/74/14 22/75/14
|
||||
f 31/76/15 27/77/15 25/78/15 29/79/15
|
||||
f 39/80/15 35/81/15 33/82/15 37/83/15
|
||||
f 56/84/9 58/85/9 2/86/9 4/87/9
|
||||
usemtl post
|
||||
f 24/88/16 25/89/16 27/90/16 26/91/16
|
||||
f 26/91/17 27/90/17 31/92/17 30/93/17
|
||||
f 30/93/18 31/92/18 29/94/18 28/95/18
|
||||
f 28/95/13 29/94/13 25/96/13 24/97/13
|
||||
f 32/98/16 33/99/16 35/100/16 34/101/16
|
||||
f 34/102/17 35/103/17 39/104/17 38/105/17
|
||||
f 38/105/18 39/104/18 37/106/18 36/107/18
|
||||
f 36/107/13 37/106/13 33/99/13 32/98/13
|
BIN
demo/resources/capsule.glb
Normal file
BIN
demo/resources/capsule.glb
Normal file
Binary file not shown.
@ -1,10 +0,0 @@
|
||||
# Blender MTL File: 'None'
|
||||
# Material Count: 1
|
||||
|
||||
newmtl None
|
||||
Ns 500
|
||||
Ka 0.8 0.8 0.8
|
||||
Kd 0.8 0.8 0.8
|
||||
Ks 0.8 0.8 0.8
|
||||
d 1
|
||||
illum 2
|
File diff suppressed because it is too large
Load Diff
BIN
demo/resources/cube.glb
Normal file
BIN
demo/resources/cube.glb
Normal file
Binary file not shown.
@ -1,10 +0,0 @@
|
||||
# Blender MTL File: 'None'
|
||||
# Material Count: 1
|
||||
|
||||
newmtl None
|
||||
Ns 500
|
||||
Ka 0.8 0.8 0.8
|
||||
Kd 0.8 0.8 0.8
|
||||
Ks 0.8 0.8 0.8
|
||||
d 1
|
||||
illum 2
|
@ -1,40 +0,0 @@
|
||||
# Blender v2.91.0 OBJ File: ''
|
||||
# www.blender.org
|
||||
mtllib cube.mtl
|
||||
o Cube_Cube.001
|
||||
v -1.000000 -1.000000 1.000000
|
||||
v -1.000000 1.000000 1.000000
|
||||
v -1.000000 -1.000000 -1.000000
|
||||
v -1.000000 1.000000 -1.000000
|
||||
v 1.000000 -1.000000 1.000000
|
||||
v 1.000000 1.000000 1.000000
|
||||
v 1.000000 -1.000000 -1.000000
|
||||
v 1.000000 1.000000 -1.000000
|
||||
vt 0.375000 0.000000
|
||||
vt 0.625000 0.000000
|
||||
vt 0.625000 0.250000
|
||||
vt 0.375000 0.250000
|
||||
vt 0.625000 0.500000
|
||||
vt 0.375000 0.500000
|
||||
vt 0.625000 0.750000
|
||||
vt 0.375000 0.750000
|
||||
vt 0.625000 1.000000
|
||||
vt 0.375000 1.000000
|
||||
vt 0.125000 0.500000
|
||||
vt 0.125000 0.750000
|
||||
vt 0.875000 0.500000
|
||||
vt 0.875000 0.750000
|
||||
vn -1.0000 0.0000 0.0000
|
||||
vn 0.0000 0.0000 -1.0000
|
||||
vn 1.0000 0.0000 0.0000
|
||||
vn 0.0000 0.0000 1.0000
|
||||
vn 0.0000 -1.0000 0.0000
|
||||
vn 0.0000 1.0000 0.0000
|
||||
usemtl None
|
||||
s off
|
||||
f 1/1/1 2/2/1 4/3/1 3/4/1
|
||||
f 3/4/2 4/3/2 8/5/2 7/6/2
|
||||
f 7/6/3 8/5/3 6/7/3 5/8/3
|
||||
f 5/8/4 6/7/4 2/9/4 1/10/4
|
||||
f 3/11/5 7/6/5 5/8/5 1/12/5
|
||||
f 8/5/6 4/13/6 2/14/6 6/7/6
|
BIN
demo/resources/ground.glb
Normal file
BIN
demo/resources/ground.glb
Normal file
Binary file not shown.
@ -1,13 +0,0 @@
|
||||
# Blender MTL File: 'None'
|
||||
# Material Count: 1
|
||||
|
||||
newmtl Material.001
|
||||
Ns 20.935559
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.800000 0.800000 0.800000
|
||||
Ks 0.000000 0.000000 0.000000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.450000
|
||||
d 1.000000
|
||||
illum 1
|
||||
map_Kd /home/dane/dev/games/trough/godot/environment/raw/grass_lowres.png
|
@ -1,16 +0,0 @@
|
||||
# Blender v2.91.0 OBJ File: ''
|
||||
# www.blender.org
|
||||
mtllib ground.mtl
|
||||
o Plane
|
||||
v -1.000000 0.000000 1.000000
|
||||
v 1.000000 0.000000 1.000000
|
||||
v -1.000000 0.000000 -1.000000
|
||||
v 1.000000 0.000000 -1.000000
|
||||
vt 0.000000 0.000000
|
||||
vt 1.000000 0.000000
|
||||
vt 1.000000 1.000000
|
||||
vt 0.000000 1.000000
|
||||
vn 0.0000 1.0000 0.0000
|
||||
usemtl Material.001
|
||||
s off
|
||||
f 1/1/1 2/2/1 4/3/1 3/4/1
|
BIN
demo/resources/inverted_cube.glb
Normal file
BIN
demo/resources/inverted_cube.glb
Normal file
Binary file not shown.
@ -1,12 +0,0 @@
|
||||
# Blender MTL File: 'None'
|
||||
# Material Count: 1
|
||||
|
||||
newmtl Material
|
||||
Ns 323.999994
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.800000 0.800000 0.800000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.450000
|
||||
d 1.000000
|
||||
illum 2
|
File diff suppressed because it is too large
Load Diff
BIN
demo/resources/scaffold.glb
Normal file
BIN
demo/resources/scaffold.glb
Normal file
Binary file not shown.
@ -1,22 +0,0 @@
|
||||
# Blender MTL File: 'scaffold.blend'
|
||||
# Material Count: 2
|
||||
|
||||
newmtl grate
|
||||
Ns 323.999994
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.800000 0.800000 0.800000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
|
||||
newmtl railing
|
||||
Ns 323.999994
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.800000 0.800000 0.800000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
@ -1,52 +0,0 @@
|
||||
# Blender v2.91.0 OBJ File: 'scaffold.blend'
|
||||
# www.blender.org
|
||||
mtllib scaffold.mtl
|
||||
o Cube
|
||||
v 1.934654 0.106465 -3.000000
|
||||
v 1.934654 0.010658 -3.000000
|
||||
v 1.934654 0.106465 3.000000
|
||||
v 1.934654 0.010658 3.000000
|
||||
v -1.956436 0.106465 -3.000000
|
||||
v -1.956436 0.010658 -3.000000
|
||||
v -1.956436 0.106465 3.000000
|
||||
v -1.956436 0.010658 3.000000
|
||||
v 1.934654 2.092319 -3.000000
|
||||
v 1.934654 2.092319 3.000000
|
||||
vt 0.003780 1.006212
|
||||
vt 0.003780 0.005796
|
||||
vt 0.994847 0.005796
|
||||
vt 0.994847 1.006212
|
||||
vt 0.426341 0.196745
|
||||
vt 0.393727 0.196745
|
||||
vt 0.393727 0.000079
|
||||
vt 0.426341 0.000079
|
||||
vt 0.426341 0.999921
|
||||
vt 0.393727 0.999921
|
||||
vt 0.393727 0.696666
|
||||
vt 0.426341 0.696666
|
||||
vt 1.986373 0.005796
|
||||
vt 1.986373 1.006211
|
||||
vt 0.995306 1.006212
|
||||
vt 0.995306 0.005796
|
||||
vt 0.426341 0.500001
|
||||
vt 0.393727 0.500001
|
||||
vt 0.000072 0.000073
|
||||
vt 0.999928 0.000072
|
||||
vt 0.999928 0.998269
|
||||
vt 0.000072 0.998269
|
||||
vn 0.0000 1.0000 0.0000
|
||||
vn 0.0000 0.0000 1.0000
|
||||
vn -1.0000 0.0000 0.0000
|
||||
vn 0.0000 -1.0000 0.0000
|
||||
vn 1.0000 0.0000 0.0000
|
||||
vn 0.0000 0.0000 -1.0000
|
||||
usemtl grate
|
||||
s off
|
||||
f 1/1/1 5/2/1 7/3/1 3/4/1
|
||||
f 4/5/2 3/6/2 7/7/2 8/8/2
|
||||
f 8/9/3 7/10/3 5/11/3 6/12/3
|
||||
f 6/13/4 2/14/4 4/15/4 8/16/4
|
||||
f 2/17/5 1/18/5 3/6/5 4/5/5
|
||||
f 6/12/6 5/11/6 1/18/6 2/17/6
|
||||
usemtl railing
|
||||
f 3/19/5 1/20/5 9/21/5 10/22/5
|
BIN
demo/resources/trough.glb
Normal file
BIN
demo/resources/trough.glb
Normal file
Binary file not shown.
@ -1,12 +0,0 @@
|
||||
# Blender MTL File: 'trough.blend'
|
||||
# Material Count: 1
|
||||
|
||||
newmtl Material
|
||||
Ns 323.999994
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.800000 0.800000 0.800000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
@ -1,80 +0,0 @@
|
||||
# Blender v2.91.0 OBJ File: 'trough.blend'
|
||||
# www.blender.org
|
||||
mtllib trough.mtl
|
||||
o Cube
|
||||
v 0.559649 0.176655 1.457162
|
||||
v 0.559649 0.176655 -1.457162
|
||||
v -0.559649 0.176655 1.457162
|
||||
v -0.559649 0.176655 -1.457162
|
||||
v 0.768938 1.259425 2.002092
|
||||
v 0.615018 0.029390 1.601327
|
||||
v 0.768938 1.259425 -2.002092
|
||||
v 0.615018 0.029390 -1.601327
|
||||
v -0.768938 1.259425 2.002092
|
||||
v -0.615018 0.029390 1.601327
|
||||
v -0.768938 1.259425 -2.002092
|
||||
v -0.615018 0.029390 -1.601327
|
||||
v 0.695141 1.259425 -1.809946
|
||||
v 0.695141 1.259425 1.809946
|
||||
v -0.695141 1.259425 -1.809946
|
||||
v -0.695141 1.259425 1.809946
|
||||
vt 0.686031 0.303372
|
||||
vt 0.701491 0.673315
|
||||
vt 0.962419 0.711595
|
||||
vt 0.971650 0.340317
|
||||
vt -0.300445 0.304089
|
||||
vt -0.298284 0.709022
|
||||
vt 0.099821 0.696156
|
||||
vt 0.134610 0.334567
|
||||
vt 0.599830 0.530280
|
||||
vt 0.599830 0.643491
|
||||
vt 0.894598 0.643491
|
||||
vt 0.894598 0.530280
|
||||
vt 0.272975 0.302381
|
||||
vt 0.272886 0.674376
|
||||
vt 0.599830 0.000171
|
||||
vt 0.607295 0.019606
|
||||
vt 0.747924 0.019606
|
||||
vt 0.747925 0.385756
|
||||
vt 0.755388 0.405188
|
||||
vt 0.755388 0.000170
|
||||
vt -0.066641 0.235731
|
||||
vt -0.225881 0.232306
|
||||
vt -0.204799 0.717963
|
||||
vt -0.061225 0.757944
|
||||
vt 1.229174 0.237805
|
||||
vt 0.663827 0.254265
|
||||
vt 0.728179 0.721933
|
||||
vt 1.245199 0.723908
|
||||
vt 0.923761 0.405529
|
||||
vt 0.599830 0.405529
|
||||
vt 0.599830 0.529940
|
||||
vt 0.923761 0.529940
|
||||
vt 0.471728 0.284766
|
||||
vt 0.491305 0.770590
|
||||
vt 0.599832 0.405188
|
||||
vt 0.607295 0.385755
|
||||
vn 0.0000 0.3098 0.9508
|
||||
vn 0.9923 0.1242 0.0000
|
||||
vn 0.0000 1.0000 0.0000
|
||||
vn -0.9923 0.1242 0.0000
|
||||
vn 0.0000 0.3098 -0.9508
|
||||
vn 0.0000 -0.3098 -0.9508
|
||||
vn -0.9923 -0.1242 0.0000
|
||||
vn 0.0000 -1.0000 0.0000
|
||||
vn 0.9923 -0.1242 0.0000
|
||||
vn 0.0000 -0.3098 0.9508
|
||||
usemtl Material
|
||||
s off
|
||||
f 2/1/1 13/2/1 15/3/1 4/4/1
|
||||
f 4/5/2 15/6/2 16/7/2 3/8/2
|
||||
f 3/9/3 1/10/3 2/11/3 4/12/3
|
||||
f 1/13/4 14/14/4 13/2/4 2/1/4
|
||||
f 3/8/5 16/7/5 14/14/5 1/13/5
|
||||
f 5/15/3 14/16/3 16/17/3 15/18/3 11/19/3 9/20/3
|
||||
f 8/21/6 12/22/6 11/23/6 7/24/6
|
||||
f 12/25/7 10/26/7 9/27/7 11/28/7
|
||||
f 10/29/8 12/30/8 8/31/8 6/32/8
|
||||
f 6/33/9 8/21/9 7/24/9 5/34/9
|
||||
f 10/26/10 6/33/10 5/34/10 9/27/10
|
||||
f 14/16/3 5/15/3 7/35/3 11/19/3 15/18/3 13/36/3
|
@ -13,7 +13,7 @@ function init()
|
||||
light:SetSpecular(0.1)
|
||||
couch.Node.GetRoot():AddChild(light:Instance())
|
||||
|
||||
local box_mesh = couch.TexturedMesh("../resources/cube.obj", "../resources/paintedwood.jpg")
|
||||
local box_mesh = couch.TexturedMesh("../resources/cube.glb", "../resources/paintedwood.jpg")
|
||||
local box = couch.Rigidbody()
|
||||
box:SetCollisionShape(couch.BoxCollisionShape(1, 1, 1))
|
||||
box:AddChild(box_mesh)
|
||||
|
Loading…
Reference in New Issue
Block a user