diff --git a/demo/barn.mtl b/demo/barn.mtl new file mode 100644 index 0000000..f7ff407 --- /dev/null +++ b/demo/barn.mtl @@ -0,0 +1,32 @@ +# 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 diff --git a/demo/barn.obj b/demo/barn.obj new file mode 100644 index 0000000..ea43f4f --- /dev/null +++ b/demo/barn.obj @@ -0,0 +1,221 @@ +# 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 diff --git a/demo/barnroof_lowres.png b/demo/barnroof_lowres.png new file mode 100644 index 0000000..19ca4b9 Binary files /dev/null and b/demo/barnroof_lowres.png differ diff --git a/demo/main.lua b/demo/main.lua index fbe7960..c7efe24 100644 --- a/demo/main.lua +++ b/demo/main.lua @@ -72,6 +72,12 @@ function init() couch.Node.GetRoot().children:Append(scaffold) scaffold.transform:Translate(-10.0, 0.0, 0.0) + + barn = couch.TexturedMesh("barn.obj", "paintedwood.jpg", "barnroof_lowres.png", "wood_lowres.png") + material = barn:GetMaterial(0) + material.cullBack = false + barn:SetMaterial(0, material) + couch.Node.GetRoot().children:Append(barn) end function update(delta) diff --git a/demo/paintedwood.jpg b/demo/paintedwood.jpg new file mode 100644 index 0000000..2b99799 Binary files /dev/null and b/demo/paintedwood.jpg differ