Pillars, maybe a fix for windows? dunno

This commit is contained in:
UndeadMaelys 2021-03-16 16:40:36 +01:00
parent 66d0bf139a
commit ff4ced57d2
7 changed files with 334 additions and 17 deletions

View File

@ -7,17 +7,19 @@ function love.load()
notsorandomseed = tonumber(personalseed, 16) notsorandomseed = tonumber(personalseed, 16)
math.randomseed(notsorandomseed) math.randomseed(notsorandomseed)
-- GRAPHICS -- GRAPHICS
-- GOOD PIXEL -- GOOD PIXEL
love.graphics.setDefaultFilter("nearest") love.graphics.setDefaultFilter("nearest")
-- meshe stuff
love.graphics.setMeshCullMode("back")
-- FONTS -- FONTS
DefaultFont = love.graphics.newImageFont("default_font.png", DefaultFont = love.graphics.newImageFont("default_font.png",
" abcdefghijklmnopqrstuvwxyz" .. " abcdefghijklmnopqrstuvwxyz" ..
"ABCDEFGHIJKLMNOPQRSTUVWXYZ0" .. "ABCDEFGHIJKLMNOPQRSTUVWXYZ0" ..
"123456789.,!?-+/():;%&`'*#=[]\"") "123456789.,!?-+/():;%&`'*#=[]\"")
love.graphics.setFont(DefaultFont) love.graphics.setFont(DefaultFont)
g3d.camera.down = {0,-1,0}
obj_list = {} 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}), -- 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 -- make the ground
for w = 0, width, 1 do for d = 0, depth, 1 do 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 end end
-- make the walls -- make the walls
for w = 0, width, 1 do for h = 0, height, 1 do 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},{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+depth},{0,math.pi/2,0},{-1,1,-1}))
end end end end
for d = 0, depth, 1 do for h = 0, height, 1 do 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,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+width,y-h,z+d},{0,0,0},{-1,1,-1}))
end end end end
-- decorate with paintings -- 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) random_art(x+width,y-art_height,z+d,0,0,0)
end 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 -- 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 -- place camera in the middle of the room
g3d.camera.position = {x+width/2, y-2, z+depth/2} 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 if art == 0 then
-- no art :S -- no art :S
elseif art == 1 then 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 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 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 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 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 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 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 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 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
end end

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 B

299
objects/pillar.obj Normal file
View File

@ -0,0 +1,299 @@
# Made in Blockbench 3.7.4
mtllib pillar.mtl
o cube
v 0.5 4.75 0.5
v 0.5 4.75 -0.5
v 0.5 4.375 0.5
v 0.5 4.375 -0.5
v -0.5 4.75 -0.5
v -0.5 4.75 0.5
v -0.5 4.375 -0.5
v -0.5 4.375 0.5
vt 0.6 0.71875
vt 0.6 0.625
vt 0.8 0.71875
vt 0.6 0.625
vt 0.8 0.625
vt 0.8 0.71875
vt 0.6 0.90625
vt 0.6 0.8125
vt 0.8 0.90625
vt 0.6 0.8125
vt 0.8 0.8125
vt 0.8 0.90625
vt 0.8 1
vt 0.8 0.75
vt 1 1
vt 0.8 0.75
vt 1 0.75
vt 1 1
vt 0.8 0.75
vt 0.8 0.5
vt 1 0.75
vt 0.8 0.5
vt 1 0.5
vt 1 0.75
vt 0.6 0.8125
vt 0.6 0.71875
vt 0.8 0.8125
vt 0.6 0.71875
vt 0.8 0.71875
vt 0.8 0.8125
vt 0.6 1
vt 0.6 0.90625
vt 0.8 1
vt 0.6 0.90625
vt 0.8 0.90625
vt 0.8 1
vn 1 0 0
vn 1 0 0
vn 1 0 0
vn 1 0 0
vn 1 0 0
vn 1 0 0
vn -1 0 0
vn -1 0 0
vn -1 0 0
vn -1 0 0
vn -1 0 0
vn -1 0 0
vn 0 1 0
vn 0 1 0
vn 0 1 0
vn 0 1 0
vn 0 1 0
vn 0 1 0
vn 0 -1 0
vn 0 -1 0
vn 0 -1 0
vn 0 -1 0
vn 0 -1 0
vn 0 -1 0
vn 0 0 1
vn 0 0 1
vn 0 0 1
vn 0 0 1
vn 0 0 1
vn 0 0 1
vn 0 0 -1
vn 0 0 -1
vn 0 0 -1
vn 0 0 -1
vn 0 0 -1
vn 0 0 -1
usemtl m_0
f 1/1/1 3/2/2 2/3/3
f 3/4/4 4/5/5 2/6/6
usemtl m_0
f 5/7/7 7/8/8 6/9/9
f 7/10/10 8/11/11 6/12/12
usemtl m_0
f 5/13/13 6/14/14 2/15/15
f 6/16/16 1/17/17 2/18/18
usemtl m_0
f 8/19/19 7/20/20 3/21/21
f 7/22/22 4/23/23 3/24/24
usemtl m_0
f 6/25/25 8/26/26 1/27/27
f 8/28/28 3/29/29 1/30/30
usemtl m_0
f 2/31/31 4/32/32 5/33/33
f 4/34/34 7/35/35 5/36/36
o cube
v 0.3125 4.375 0.3125
v 0.3125 4.375 -0.3125
v 0.3125 0.375 0.3125
v 0.3125 0.375 -0.3125
v -0.3125 4.375 -0.3125
v -0.3125 4.375 0.3125
v -0.3125 0.375 -0.3125
v -0.3125 0.375 0.3125
vt 0.375 1
vt 0.375 0
vt 0.5 1
vt 0.375 0
vt 0.5 0
vt 0.5 1
vt 0.125 1
vt 0.125 0
vt 0.25 1
vt 0.125 0
vt 0.25 0
vt 0.25 1
vt 0.5 0.15625
vt 0.5 0
vt 0.625 0.15625
vt 0.5 0
vt 0.625 0
vt 0.625 0.15625
vt 0.625 0.15625
vt 0.625 0
vt 0.75 0.15625
vt 0.625 0
vt 0.75 0
vt 0.75 0.15625
vt 0.25 1
vt 0.25 0
vt 0.375 1
vt 0.25 0
vt 0.375 0
vt 0.375 1
vt 0 1
vt 0 0
vt 0.125 1
vt 0 0
vt 0.125 0
vt 0.125 1
vn 1 0 0
vn 1 0 0
vn 1 0 0
vn 1 0 0
vn 1 0 0
vn 1 0 0
vn -1 0 0
vn -1 0 0
vn -1 0 0
vn -1 0 0
vn -1 0 0
vn -1 0 0
vn 0 1 0
vn 0 1 0
vn 0 1 0
vn 0 1 0
vn 0 1 0
vn 0 1 0
vn 0 -1 0
vn 0 -1 0
vn 0 -1 0
vn 0 -1 0
vn 0 -1 0
vn 0 -1 0
vn 0 0 1
vn 0 0 1
vn 0 0 1
vn 0 0 1
vn 0 0 1
vn 0 0 1
vn 0 0 -1
vn 0 0 -1
vn 0 0 -1
vn 0 0 -1
vn 0 0 -1
vn 0 0 -1
usemtl m_0
f 9/37/37 11/38/38 10/39/39
f 11/40/40 12/41/41 10/42/42
usemtl m_0
f 13/43/43 15/44/44 14/45/45
f 15/46/46 16/47/47 14/48/48
usemtl m_0
f 13/49/49 14/50/50 10/51/51
f 14/52/52 9/53/53 10/54/54
usemtl m_0
f 16/55/55 15/56/56 11/57/57
f 15/58/58 12/59/59 11/60/60
usemtl m_0
f 14/61/61 16/62/62 9/63/63
f 16/64/64 11/65/65 9/66/66
usemtl m_0
f 10/67/67 12/68/68 13/69/69
f 12/70/70 15/71/71 13/72/72
o cube
v 0.5 0.375 0.5
v 0.5 0.375 -0.5
v 0.5 0 0.5
v 0.5 0 -0.5
v -0.5 0.375 -0.5
v -0.5 0.375 0.5
v -0.5 0 -0.5
v -0.5 0 0.5
vt 0.8 0.15625
vt 0.8 0.0625
vt 1 0.15625
vt 0.8 0.0625
vt 1 0.0625
vt 1 0.15625
vt 0.6 0.28125
vt 0.6 0.1875
vt 0.8 0.28125
vt 0.6 0.1875
vt 0.8 0.1875
vt 0.8 0.28125
vt 0.8 0.5
vt 0.8 0.25
vt 1 0.5
vt 0.8 0.25
vt 1 0.25
vt 1 0.5
vt 0.6 0.625
vt 0.6 0.375
vt 0.8 0.625
vt 0.6 0.375
vt 0.8 0.375
vt 0.8 0.625
vt 0.8 0.25
vt 0.8 0.15625
vt 1 0.25
vt 0.8 0.15625
vt 1 0.15625
vt 1 0.25
vt 0.6 0.375
vt 0.6 0.28125
vt 0.8 0.375
vt 0.6 0.28125
vt 0.8 0.28125
vt 0.8 0.375
vn 1 0 0
vn 1 0 0
vn 1 0 0
vn 1 0 0
vn 1 0 0
vn 1 0 0
vn -1 0 0
vn -1 0 0
vn -1 0 0
vn -1 0 0
vn -1 0 0
vn -1 0 0
vn 0 1 0
vn 0 1 0
vn 0 1 0
vn 0 1 0
vn 0 1 0
vn 0 1 0
vn 0 -1 0
vn 0 -1 0
vn 0 -1 0
vn 0 -1 0
vn 0 -1 0
vn 0 -1 0
vn 0 0 1
vn 0 0 1
vn 0 0 1
vn 0 0 1
vn 0 0 1
vn 0 0 1
vn 0 0 -1
vn 0 0 -1
vn 0 0 -1
vn 0 0 -1
vn 0 0 -1
vn 0 0 -1
usemtl m_0
f 17/73/73 19/74/74 18/75/75
f 19/76/76 20/77/77 18/78/78
usemtl m_0
f 21/79/79 23/80/80 22/81/81
f 23/82/82 24/83/83 22/84/84
usemtl m_0
f 21/85/85 22/86/86 18/87/87
f 22/88/88 17/89/89 18/90/90
usemtl m_0
f 24/91/91 23/92/92 19/93/93
f 23/94/94 20/95/95 19/96/96
usemtl m_0
f 22/97/97 24/98/98 17/99/99
f 24/100/100 19/101/101 17/102/102
usemtl m_0
f 18/103/103 20/104/104 21/105/105
f 20/106/106 23/107/107 21/108/108

View File

@ -0,0 +1 @@
{"meta":{"format_version":"3.6","creation_time":1615904993,"model_format":"free","box_uv":false},"name":"","geometry_name":"","visible_box":[1,1,0],"resolution":{"width":80,"height":64},"elements":[{"name":"cube","from":[-8,0,-8],"to":[8,6,8],"autouv":0,"color":6,"locked":false,"origin":[0,0,0],"faces":{"north":{"uv":[48,40,64,46],"texture":0},"east":{"uv":[64,54,80,60],"texture":0},"south":{"uv":[64,48,80,54],"texture":0},"west":{"uv":[48,46,64,52],"texture":0},"up":{"uv":[64,32,80,48],"texture":0},"down":{"uv":[48,24,64,40],"texture":0}},"uuid":"0e8ca154-543b-cc74-c352-af6c94b6080f"},{"name":"cube","from":[-5,6,-5],"to":[5,70,5],"autouv":0,"color":6,"locked":false,"origin":[0,6,0],"faces":{"north":{"uv":[0,0,10,64],"texture":0},"east":{"uv":[30,0,40,64],"texture":0},"south":{"uv":[20,0,30,64],"texture":0},"west":{"uv":[10,0,20,64],"texture":0},"up":{"uv":[40,54,50,64],"texture":0},"down":{"uv":[50,54,60,64],"texture":0}},"uuid":"c2fd3ec9-aa4e-b456-3546-49a1f3bb00ce"},{"name":"cube","from":[-8,70,-8],"to":[8,76,8],"autouv":0,"color":6,"locked":false,"origin":[0,70,0],"faces":{"north":{"uv":[48,0,64,6],"texture":0},"east":{"uv":[48,18,64,24],"texture":0},"south":{"uv":[48,12,64,18],"texture":0},"west":{"uv":[48,6,64,12],"texture":0},"up":{"uv":[64,0,80,16],"texture":0},"down":{"uv":[64,16,80,32],"texture":0}},"uuid":"d754493a-3793-55e4-68aa-6211266de323"}],"outliner":["0e8ca154-543b-cc74-c352-af6c94b6080f","d754493a-3793-55e4-68aa-6211266de323","c2fd3ec9-aa4e-b456-3546-49a1f3bb00ce"],"textures":[{"path":"/home/maelys/Projects/Love2D/LoreMuseum/objects/pillar/texture.png","name":"texture.png","folder":"pillar","namespace":"","id":"0","particle":false,"visible":true,"mode":"bitmap","saved":true,"uuid":"1dc177f9-a59b-95af-232c-bfa9c282dd55","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABACAYAAACNx/A2AAABiElEQVR4Xu2c0Y3CMBBE12XgOmjjaIOaUgdtQBtQhhG6+4mE7dGNhGPy8r0C5zGzu944pBJRQrhOUlTE5aYFluND+NaIFDm1AtX11z4ja7dfXUJSFwDA9wwBiAI9AlhYzOHkwAoBNYcDsELgp3gWvr6qgHFNX0QA2Pn1e30gAAG4JvDpnQgKRIFjFRjXYpXRw9EowRExfRUGoGlhAAJw7hxYbs1xYzdB7j4H7h5gibtVhWPJXZW1AqZXIADNIgJAAI6twigQBQ5W4OJNpK0S/A174QLAtgZ6E2kAujkQBaLAFYFPj/SxMBamjZGmGZs93mYWkXyWbr/qk/mnMQAcW4VRIApEgVP3gVgYC2PhsRbmjLSpQAACEAsrzwU2uxfGwlh4qIU5I20OVAE4GKD6CKK2zOnnga4CAWi+KwdAAHptjNLDNmPM90ymz4EA7BDIcZAY3RfttH06xyrQPV+4eQUCsKIf9X9jAAjAXwKjpjEoEAV+twKlEt8I2n0VBuAfgf/2gQAcDPAJ2krkw0hzC1sAAAAASUVORK5CYII="}]}

View File

@ -0,0 +1,4 @@
# Made in Blockbench 3.7.4
newmtl m_0
map_Kd texture.png
newmtl none

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

BIN
objects/pillar/texture.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 520 B