From ff4ced57d237b4cc640fd0b03d705d8a99ece165 Mon Sep 17 00:00:00 2001 From: UndeadMaelys Date: Tue, 16 Mar 2021 16:40:36 +0100 Subject: [PATCH] Pillars, maybe a fix for windows? dunno --- main.lua | 47 +++-- objects/art_9_12/texture.png | Bin 0 -> 356 bytes objects/pillar.obj | 299 +++++++++++++++++++++++++++ objects/pillar/model.bbmodel | 1 + objects/pillar/pillar.mtl | 4 + objects/pillar/texture (còpia 1).png | Bin 0 -> 369 bytes objects/pillar/texture.png | Bin 0 -> 520 bytes 7 files changed, 334 insertions(+), 17 deletions(-) create mode 100644 objects/art_9_12/texture.png create mode 100644 objects/pillar.obj create mode 100644 objects/pillar/model.bbmodel create mode 100644 objects/pillar/pillar.mtl create mode 100644 objects/pillar/texture (còpia 1).png create mode 100644 objects/pillar/texture.png diff --git a/main.lua b/main.lua index 07a9584..0273edf 100644 --- a/main.lua +++ b/main.lua @@ -7,17 +7,19 @@ function love.load() notsorandomseed = tonumber(personalseed, 16) math.randomseed(notsorandomseed) + -- GRAPHICS -- GOOD PIXEL love.graphics.setDefaultFilter("nearest") - + -- meshe stuff + love.graphics.setMeshCullMode("back") -- FONTS DefaultFont = love.graphics.newImageFont("default_font.png", " abcdefghijklmnopqrstuvwxyz" .. "ABCDEFGHIJKLMNOPQRSTUVWXYZ0" .. "123456789.,!?-+/():;%&`'*#=[]\"") love.graphics.setFont(DefaultFont) - + g3d.camera.down = {0,-1,0} obj_list = {} -- obj_flower_pot = g3d.newModel("objects/flower_pot.obj","objects/flower_pot/texture.png",{0,0,0},{0,0,0},{1,-1,1}), @@ -89,18 +91,18 @@ function generate_museum(x,y,z) -- make the ground for w = 0, width, 1 do for d = 0, depth, 1 do - table.insert(obj_list,g3d.newModel("objects/ground.obj","objects/ground/texture.png",{x+w,y,z+d},{0,0,0},{1,-1,1})) + table.insert(obj_list,g3d.newModel("objects/ground.obj","objects/ground/texture.png",{x+w,y,z+d},{0,0,0},{-1,1,-1})) end end -- make the walls for w = 0, width, 1 do for h = 0, height, 1 do - table.insert(obj_list,g3d.newModel("objects/wall.obj","objects/wall/texture.png",{x+w,y-h,z},{0,math.pi/2,0},{1,-1,1})) - table.insert(obj_list,g3d.newModel("objects/wall.obj","objects/wall/texture.png",{x+w,y-h,z+depth},{0,math.pi/2,0},{1,-1,1})) + table.insert(obj_list,g3d.newModel("objects/wall.obj","objects/wall/texture.png",{x+w,y-h,z},{0,math.pi/2,0},{-1,1,-1})) + table.insert(obj_list,g3d.newModel("objects/wall.obj","objects/wall/texture.png",{x+w,y-h,z+depth},{0,math.pi/2,0},{-1,1,-1})) end end for d = 0, depth, 1 do for h = 0, height, 1 do - table.insert(obj_list,g3d.newModel("objects/wall.obj","objects/wall/texture.png",{x,y-h,z+d},{0,0,0},{1,-1,1})) - table.insert(obj_list,g3d.newModel("objects/wall.obj","objects/wall/texture.png",{x+width,y-h,z+d},{0,0,0},{1,-1,1})) + table.insert(obj_list,g3d.newModel("objects/wall.obj","objects/wall/texture.png",{x,y-h,z+d},{0,0,0},{-1,1,-1})) + table.insert(obj_list,g3d.newModel("objects/wall.obj","objects/wall/texture.png",{x+width,y-h,z+d},{0,0,0},{-1,1,-1})) end end -- decorate with paintings @@ -115,9 +117,20 @@ function generate_museum(x,y,z) random_art(x+width,y-art_height,z+d,0,0,0) end + -- place pillars to support the room in the middle of the room + pillars = math.random(0,1) + + if pillars == 0 then + -- no pillars + elseif pillars == 1 then + table.insert(obj_list,g3d.newModel("objects/pillar.obj","objects/pillar/texture.png",{x+width/4, y-5*(76/80), z+depth/4},{0,0,0},{1,1,1})) + table.insert(obj_list,g3d.newModel("objects/pillar.obj","objects/pillar/texture.png",{x+width*3/4, y-5*(76/80), z+depth*3/4},{0,0,0},{1,1,1})) + table.insert(obj_list,g3d.newModel("objects/pillar.obj","objects/pillar/texture.png",{x+width*3/4, y-5*(76/80), z+depth/4},{0,0,0},{1,1,1})) + table.insert(obj_list,g3d.newModel("objects/pillar.obj","objects/pillar/texture.png",{x+width/4, y-5*(76/80), z+depth*3/4},{0,0,0},{1,1,1})) + end -- place carpet in the middle of the room - table.insert(obj_list,g3d.newModel("objects/carpet.obj","objects/carpet/texture.png",{x+width/2, y, z+depth/2},{0,math.random(),0},{1,-1,1})) + table.insert(obj_list,g3d.newModel("objects/carpet.obj","objects/carpet/texture.png",{x+width/2, y-(1/16) , z+depth/2},{0,math.random(),0},{1,-1,1})) -- place camera in the middle of the room g3d.camera.position = {x+width/2, y-2, z+depth/2} @@ -129,22 +142,22 @@ function random_art(x,y,z,rotx,roty,rotz) if art == 0 then -- no art :S elseif art == 1 then - table.insert(obj_list,g3d.newModel("objects/art_9_12.obj","objects/art_9_12/eri_sueños.png",{x,y-(12/16),z},{rotx,roty,rotz},{-1,1,1})) + table.insert(obj_list,g3d.newModel("objects/art_9_12.obj","objects/art_9_12/eri_sueños.png",{x,y-(12/16),z},{rotx,roty,rotz},{-1,1,-1})) elseif art == 2 then - table.insert(obj_list,g3d.newModel("objects/art_1_1.obj","objects/art_1_1/yari_walk.png",{x,y-(10/16),z},{rotx,roty,rotz},{-1,1,1})) + table.insert(obj_list,g3d.newModel("objects/art_1_1.obj","objects/art_1_1/yari_walk.png",{x,y-(10/16),z},{rotx,roty,rotz},{-1,1,-1})) elseif art == 3 then - table.insert(obj_list,g3d.newModel("objects/art_16_9.obj","objects/art_16_9/clareta_tira.png",{x,y-(9/16),z},{rotx,roty,rotz},{-1,1,1})) + table.insert(obj_list,g3d.newModel("objects/art_16_9.obj","objects/art_16_9/clareta_tira.png",{x,y-(9/16),z},{rotx,roty,rotz},{-1,1,-1})) elseif art == 4 then - table.insert(obj_list,g3d.newModel("objects/art_16_12.obj","objects/art_16_12/clareta_garden_throne.png",{x,y-(12/16),z},{rotx,roty,rotz},{-1,1,1})) + table.insert(obj_list,g3d.newModel("objects/art_16_12.obj","objects/art_16_12/clareta_garden_throne.png",{x,y-(12/16),z},{rotx,roty,rotz},{-1,1,-1})) elseif art == 5 then - table.insert(obj_list,g3d.newModel("objects/art_24_16.obj","objects/art_24_16/eri_dungeon.png",{x,y-(16/16),z},{rotx,roty,rotz},{-1,1,1})) + table.insert(obj_list,g3d.newModel("objects/art_24_16.obj","objects/art_24_16/eri_dungeon.png",{x,y-(16/16),z},{rotx,roty,rotz},{-1,1,-1})) elseif art == 6 then - table.insert(obj_list,g3d.newModel("objects/art_12_9.obj","objects/art_12_9/noe_nerielle.png",{x,y-(9/16),z},{rotx,roty,rotz},{-1,1,1})) + table.insert(obj_list,g3d.newModel("objects/art_12_9.obj","objects/art_12_9/noe_nerielle.png",{x,y-(9/16),z},{rotx,roty,rotz},{-1,1,-1})) elseif art == 7 then - table.insert(obj_list,g3d.newModel("objects/art_1_1.obj","objects/art_1_1/yari_pumpum.png",{x,y-(10/16),z},{rotx,roty,rotz},{-1,1,1})) + table.insert(obj_list,g3d.newModel("objects/art_1_1.obj","objects/art_1_1/yari_pumpum.png",{x,y-(10/16),z},{rotx,roty,rotz},{-1,1,-1})) elseif art == 8 then - table.insert(obj_list,g3d.newModel("objects/art_12_6.obj","objects/art_12_6/eri_sigils.png",{x,y-(6/16),z},{rotx,roty,rotz},{-1,1,1})) + table.insert(obj_list,g3d.newModel("objects/art_12_6.obj","objects/art_12_6/eri_sigils.png",{x,y-(6/16),z},{rotx,roty,rotz},{-1,1,-1})) elseif art == 9 then - table.insert(obj_list,g3d.newModel("objects/art_16_24.obj","objects/art_16_24/eri_ariel_with_overalls.png",{x,y-(24/16),z},{rotx,roty,rotz},{-1,1,1})) + table.insert(obj_list,g3d.newModel("objects/art_16_24.obj","objects/art_16_24/eri_ariel_with_overalls.png",{x,y-(24/16),z},{rotx,roty,rotz},{-1,1,-1})) end end diff --git a/objects/art_9_12/texture.png b/objects/art_9_12/texture.png new file mode 100644 index 0000000000000000000000000000000000000000..1f2e037c86720daa65c58d3c50d404cde031cd40 GIT binary patch literal 356 zcmeAS@N?(olHy`uVBq!ia0vp^0YL1)!3HFIkAE;@U|`htba4!+nDh3|LEa_@0f&o` z$-)8cr8n421KD#Eq@#{iePi(Xl$|2c(c>4%yeqxxS={NR%-x^YjD^ta>cTVuO7 zzOD27^gCbj=DR}Y>eCHV7!{eF*jnDD*E4EWmu|=`@3nu%0uVO#JNRE3`mXA&EXHdG`=vFj)Pm^@slXFWK=)*rPUV+kRn)3;xOMFxk-;|b&X>ITuF$#qbi))zMP?_qmUrp(j9S&D8#2p#?Vqs#1$a0l z1&kCz>O{}otIn5v@NurgiG~S`3qL(~cxAgeT2Ng;%f9hu{5JEmIpyj=g(*mJ%ktxR)1>!p@05Mc6<`{s14h;Ul`(o ze=<8vcJ!@#vy{_Mq2wp0%%bILD!;eX&aP9RW|#aH;nb3!p+D~T-8)-)gcEGVFQ$8m WN|NW>`rCnF$l&Sf=d#Wzp$PyEI*-Qy literal 0 HcmV?d00001 diff --git a/objects/pillar/texture.png b/objects/pillar/texture.png new file mode 100644 index 0000000000000000000000000000000000000000..8a0ebe91baa60658d7bb3d84d84b96428bd717ca GIT binary patch literal 520 zcmeAS@N?(olHy`uVBq!ia0vp^0YL1)!3HFIkAE-&QjEnx?oJHr&dIz4vJZK>IEGZr zc{_V!9+RPf%XE!Jp0%>IOEg0N{g)1M^YT9~e?evH(zD0xe%nktv+lX+fkeeGCZ}gu zTh!Lq{)^eRIVQin^2qJ5b=#{i@4CLdKlpRE*$0zPN5fi}95n=NtPkUhN%@JL&}`-14d}Ov1LhJ&)`fr_B>{E12(4 zBHu2g)R^;-QAKepZ*lI~z(X8!SXr9_6gcn_9ukeV*Gt?59`%&GmM@7qA0vNo?}0f2 zf4O!3THJmAQ$3{9KzYsv@hMry1D!b6^gcZiucC6Ne}nA(I~woTI=8lYJO~t2*3aJM zzknlJf+;sKB&kF2+J;uf8;4{U==OkIlsI9g?i;(trDEG2ub%(7{GsfPLku|&`EDFy pPT+0^t87l>X5P?hJ>%}7{e=t4b_l;)vK$z-44$rjF6*2UngEz(-njq( literal 0 HcmV?d00001