use mesh node for round-cornered ("small") rugs,

nodebox for square-cornered ("large", "persian") rugs.
This commit is contained in:
Vanessa Ezekowitz 2015-05-11 12:37:49 -04:00
parent a32e723ee2
commit 8e1670e3b9
3 changed files with 278 additions and 14 deletions

View File

@ -24,21 +24,44 @@ homedecor.register("ceiling_tile", {
selection_box = { type = "wallmounted" },
})
local rug_types = {"small", "large", "persian"}
local rug_types = {
{ "small", "homedecor_small_rug.obj" },
{ "large", { -0.5, -0.5, -0.5, 0.5, -0.4375, 0.5 } },
{ "persian", { -0.5, -0.5, -0.5, 0.5, -0.4375, 0.5 } }
}
for _, s in ipairs(rug_types) do
homedecor.register("rug_"..s, {
description = S("Throw Rug ("..s..")"),
drawtype = 'signlike',
tiles = {"homedecor_rug_"..s..".png"},
wield_image = "homedecor_rug_"..s..".png",
inventory_image = "homedecor_rug_"..s..".png",
for i in ipairs(rug_types) do
s = rug_types[i][1]
m = rug_types[i][2]
local mesh = m
local nodebox = nil
local tiles = { "homedecor_rug_"..s..".png", "wool_grey.png" }
if type(m) == "table" then
mesh = nil
nodebox = {
type = "fixed",
fixed = m
}
tiles = {
"homedecor_rug_"..s..".png",
"wool_grey.png",
"homedecor_rug_"..s..".png"
}
end
homedecor.register("rug_"..s, {
description = S("Rug ("..s..")"),
mesh = mesh,
tiles = tiles,
node_box = nodebox,
paramtype2 = "wallmounted",
walkable = false,
groups = {snappy = 3},
sounds = default.node_sound_leaves_defaults(),
selection_box = { type = "wallmounted" },
})
})
end
local pot_colors = {"black", "green", "terracotta"}

View File

@ -0,0 +1,241 @@
# Blender v2.73 (sub 0) OBJ File: 'small-rug.blend'
# www.blender.org
o Cylinder
v -0.000000 -0.437500 0.000000
v 0.323112 -0.437500 0.405968
v -0.491090 -0.449921 -0.245545
v -0.491090 -0.500000 0.245545
v 0.245545 -0.449921 -0.491090
v -0.245545 -0.500000 -0.491090
v 0.491090 -0.449921 0.245545
v 0.491090 -0.500000 -0.245545
v -0.245545 -0.449921 0.491090
v 0.245545 -0.500000 0.491090
v -0.491090 -0.449921 0.245545
v -0.491090 -0.500000 -0.245545
v -0.245545 -0.449921 -0.491090
v 0.245545 -0.500000 -0.491090
v 0.491090 -0.449921 -0.245545
v 0.491090 -0.500000 0.245545
v 0.245545 -0.449921 0.491090
v -0.245545 -0.500000 0.491090
v -0.451076 -0.449921 -0.359013
v -0.451076 -0.500000 0.359013
v 0.359013 -0.449921 -0.451076
v -0.359013 -0.500000 -0.451076
v 0.451076 -0.449921 0.359013
v 0.451076 -0.500000 -0.359013
v -0.359013 -0.449921 0.451076
v 0.359013 -0.500000 0.451076
v 0.405968 -0.437500 -0.323112
v -0.323112 -0.437500 -0.405968
v -0.405968 -0.437500 0.323112
v -0.323112 -0.437500 0.405968
v 0.405968 -0.437500 0.323112
v 0.323112 -0.437500 -0.405968
v -0.405968 -0.437500 -0.323112
v 0.220990 -0.437500 0.441981
v 0.441981 -0.437500 -0.220990
v -0.220990 -0.437500 -0.441981
v -0.441981 -0.437500 0.220990
v -0.220990 -0.437500 0.441981
v 0.441981 -0.437500 0.220990
v 0.220990 -0.437500 -0.441981
v -0.441981 -0.437500 -0.220990
v -0.000000 -0.500000 -0.000000
v -0.451076 -0.449921 0.359013
v -0.451076 -0.500000 -0.359013
v -0.359013 -0.449921 -0.451076
v 0.359013 -0.500000 -0.451076
v 0.451076 -0.449921 -0.359013
v 0.451076 -0.500000 0.359013
v 0.359013 -0.449921 0.451076
v -0.359013 -0.500000 0.451076
vt 1.000000 0.125000
vt 1.000000 0.250000
vt 0.937500 0.250000
vt 0.937500 0.125000
vt 0.875000 1.000000
vt 0.750000 1.000000
vt 0.750000 0.937500
vt 0.875000 0.937500
vt 0.125000 0.000000
vt 0.250000 0.000000
vt 0.250000 0.062500
vt 0.125000 0.062500
vt 0.865527 0.959260
vt 0.725000 0.950000
vt 0.828974 0.913334
vt 0.000000 0.750000
vt 0.000000 0.625000
vt 0.062500 0.625000
vt 0.062500 0.750000
vt 0.375000 0.000000
vt 0.375000 0.062500
vt 1.000000 0.375000
vt 0.937500 0.375000
vt 0.625000 1.000000
vt 0.625000 0.937500
vt -0.000000 0.125000
vt 0.062500 0.125000
vt 0.062500 0.687500
vt -0.000000 0.687500
vt 0.040740 0.134473
vt 0.134473 0.040740
vt 0.171026 0.086666
vt 0.086666 0.171026
vt 0.875000 0.000000
vt 0.875000 0.062500
vt 1.000000 0.875000
vt 0.937500 0.875000
vt 0.125000 1.000000
vt 0.125000 0.937500
vt 0.000000 1.000000
vt 0.000000 0.937500
vt 1.000000 1.000000
vt 0.937500 1.000000
vt 1.000000 0.000000
vt 1.000000 0.062500
vt -0.000000 0.000000
vt 0.062500 0.000000
vt 0.000000 0.875000
vt 0.062500 0.875000
vt 0.040740 0.865527
vt 0.050000 0.725000
vt 0.086666 0.828974
vt 0.750000 0.000000
vt 0.725000 0.050000
vt 0.275000 0.050000
vt 1.000000 0.750000
vt 0.950000 0.725000
vt 0.950000 0.275000
vt 0.250000 1.000000
vt 0.275000 0.950000
vt 0.000000 0.250000
vt 0.050000 0.275000
vt 0.865527 0.040740
vt 0.828974 0.086666
vt 0.959260 0.865527
vt 0.913334 0.828974
vt 0.134473 0.959260
vt 0.171026 0.913334
vt 0.959260 0.134473
vt 0.913334 0.171026
vt 0.500000 0.500000
vn 0.432600 0.587800 -0.683600
vn 0.683600 0.587800 -0.432600
vn 0.635200 -0.660500 -0.400200
vn 0.400200 -0.660500 -0.635200
vn 0.683600 0.587800 0.432600
vn 0.432600 0.587800 0.683600
vn 0.400200 -0.660500 0.635200
vn 0.635200 -0.660500 0.400200
vn -0.683600 0.587800 -0.432600
vn -0.432600 0.587800 -0.683600
vn -0.400200 -0.660500 -0.635200
vn -0.635200 -0.660500 -0.400200
vn 0.139800 0.590500 -0.794800
vn 0.017200 0.991500 -0.128400
vn 0.062900 0.992600 -0.104200
vn -0.683600 0.587800 0.432600
vn -0.794800 0.590500 0.139800
vn -0.730800 -0.671000 0.125100
vn -0.635200 -0.660500 0.400200
vn -0.139800 0.590500 -0.794800
vn -0.125100 -0.671000 -0.730800
vn 0.794800 0.590500 -0.139800
vn 0.730800 -0.671000 -0.125100
vn 0.139800 0.590500 0.794800
vn 0.125100 -0.671000 0.730800
vn -0.794800 0.590500 -0.139800
vn -0.730800 -0.671000 -0.125100
vn -0.432600 0.587800 0.683600
vn -0.062900 0.992600 0.104200
vn -0.104200 0.992600 0.062900
vn 0.125100 -0.671000 -0.730800
vn 0.794800 0.590500 0.139800
vn 0.730800 -0.671000 0.125100
vn -0.139800 0.590500 0.794800
vn -0.125100 -0.671000 0.730800
vn -0.400200 -0.660500 0.635200
vn -0.128400 0.991500 -0.017200
vn -0.104200 0.992600 -0.062900
vn 0.017200 0.991500 0.128400
vn -0.017200 0.991500 0.128400
vn 0.128400 0.991500 -0.017200
vn 0.128400 0.991500 0.017200
vn -0.017200 0.991500 -0.128400
vn -0.128400 0.991500 0.017200
vn 0.062900 0.992600 0.104200
vn 0.104200 0.992600 -0.062900
vn -0.062900 0.992600 -0.104200
vn 0.104200 0.992600 0.062900
vn 0.000000 1.000000 0.000000
vn 0.000000 -1.000000 0.000000
g Cylinder_Cylinder_top-sides
s 1
f 21/1/1 47/2/2 24/3/3 46/4/4
f 23/5/5 49/6/6 26/7/7 48/8/8
f 19/9/9 45/10/10 22/11/11 44/12/12
f 21/13/1 5/6/13 40/14/14 32/15/15
f 43/16/16 11/17/17 4/18/18 20/19/19
f 45/10/10 13/20/20 6/21/21 22/11/11
f 47/2/2 15/22/22 8/23/23 24/3/3
f 49/6/6 17/24/24 10/25/25 26/7/7
f 3/26/26 12/27/27 4/28/18 11/29/17
f 43/30/16 25/31/28 30/32/29 29/33/30
f 5/34/13 14/35/31 6/21/21 13/20/20
f 7/36/32 16/37/33 8/23/23 15/22/22
f 17/24/24 9/38/34 18/39/35 10/25/25
f 9/38/34 25/40/28 50/41/36 18/39/35
f 7/36/32 23/42/5 48/43/8 16/37/33
f 5/34/13 21/44/1 46/45/4 14/35/31
f 3/26/26 19/46/9 44/47/12 12/27/27
f 25/48/28 43/16/16 20/19/19 50/49/36
f 19/50/9 3/16/26 41/51/37 33/52/38
f 9/10/34 17/53/24 34/54/39 38/55/40
f 7/2/32 15/56/22 35/57/41 39/58/42
f 5/6/13 13/59/20 36/60/43 40/14/14
f 3/16/26 11/61/17 37/62/44 41/51/37
f 17/53/24 49/63/6 2/64/45 34/54/39
f 15/56/22 47/65/2 27/66/46 35/57/41
f 13/59/20 45/67/10 28/68/47 36/60/43
f 49/63/6 23/69/5 31/70/48 2/64/45
f 11/61/17 43/30/16 29/33/30 37/62/44
f 25/31/28 9/10/34 38/55/40 30/32/29
f 47/65/2 21/13/1 32/15/15 27/66/46
f 23/69/5 7/2/32 39/58/42 31/70/48
f 45/67/10 19/50/9 33/52/38 28/68/47
f 30/32/29 38/55/40 1/71/49
f 38/55/40 34/54/39 1/71/49
f 34/54/39 2/64/45 1/71/49
f 2/64/45 31/70/48 1/71/49
f 31/70/48 39/58/42 1/71/49
f 39/58/42 35/57/41 1/71/49
f 35/57/41 27/66/46 1/71/49
f 27/66/46 32/15/15 1/71/49
f 32/15/15 40/14/14 1/71/49
f 40/14/14 36/60/43 1/71/49
f 36/60/43 28/68/47 1/71/49
f 28/68/47 33/52/38 1/71/49
f 33/52/38 41/51/37 1/71/49
f 41/51/37 37/62/44 1/71/49
f 37/62/44 29/33/30 1/71/49
f 29/33/30 30/32/29 1/71/49
g Cylinder_Cylinder_bottom
f 22/31/11 6/10/21 42/71/50
f 4/16/18 12/61/27 42/71/50
f 12/61/27 44/30/12 42/71/50
f 44/30/12 22/31/11 42/71/50
f 14/53/31 46/63/4 42/71/50
f 46/63/4 24/69/3 42/71/50
f 24/69/3 8/2/23 42/71/50
f 8/2/23 16/56/33 42/71/50
f 16/56/33 48/65/8 42/71/50
f 48/65/8 26/13/7 42/71/50
f 26/13/7 10/6/25 42/71/50
f 20/50/19 4/16/18 42/71/50
f 6/10/21 14/53/31 42/71/50
f 10/6/25 18/59/35 42/71/50
f 18/59/35 50/67/36 42/71/50
f 50/67/36 20/50/19 42/71/50

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB