use mesh node for round pole

This commit is contained in:
Vanessa Ezekowitz 2014-12-13 17:32:31 -05:00
parent d8252aee6b
commit 0d6d75a425
5 changed files with 118 additions and 18 deletions

BIN
homedecor/blends/pole.blend Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -161,21 +161,10 @@ minetest.register_node('homedecor:flower_pot_green', {
sounds = default.node_sound_leaves_defaults(),
})
-- cylinder-shaped objects courtesy Jeija
local cylbox = {}
local detail = 50
local sehne
local size = 0.2
for i = 1, detail-1 do
sehne = math.sqrt(0.25 - (((i/detail)-0.5)^2))
cylbox[i]={((i/detail)-0.5)*size, -0.5, -sehne*size, ((i/detail)+(1/detail)-0.5)*size, 0.5, sehne*size}
end
minetest.register_node("homedecor:pole_brass", {
description = S("Brass Pole"),
drawtype = "nodebox",
drawtype = "mesh",
mesh = "homedecor_round_pole.obj",
tiles = {"homedecor_tile_brass2.png"},
inventory_image = "homedecor_pole_brass2.png",
wield_image = "homedecor_pole_brass2.png",
@ -184,15 +173,15 @@ minetest.register_node("homedecor:pole_brass", {
is_ground_content = true,
selection_box = {
type = "fixed",
fixed = {-size/2, -0.5, -size/2, size/2, 0.5, size/2},
fixed = { -0.125, -0.5, -0.125, 0.125, 0.5, 0.125 },
},
collision_box = {
type = "fixed",
fixed = { -0.125, -0.5, -0.125, 0.125, 0.5, 0.125 },
},
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
node_box = {
type = "fixed",
fixed = cylbox,
}
})
minetest.register_node("homedecor:pole_wrought_iron", {

View File

@ -0,0 +1,111 @@
# Blender v2.69 (sub 0) OBJ File: 'pole.blend'
# www.blender.org
mtllib homedecor_round_pole.mtl
o Cylinder
v -0.047835 -0.500000 -0.115485
v -0.047835 0.500000 -0.115485
v 0.000000 -0.500000 -0.125000
v 0.000000 0.500000 -0.125000
v 0.047835 -0.500000 -0.115485
v 0.047835 0.500000 -0.115485
v 0.088388 -0.500000 -0.088388
v 0.088388 0.500000 -0.088388
v 0.115485 -0.500000 -0.047835
v 0.115485 0.500000 -0.047835
v 0.125000 -0.500000 0.000000
v 0.125000 0.500000 0.000000
v 0.115485 -0.500000 0.047835
v 0.115485 0.500000 0.047835
v 0.088388 -0.500000 0.088388
v 0.088388 0.500000 0.088388
v 0.047835 -0.500000 0.115485
v 0.047835 0.500000 0.115485
v 0.000000 -0.500000 0.125000
v 0.000000 0.500000 0.125000
v -0.047835 -0.500000 0.115485
v -0.047835 0.500000 0.115485
v -0.088388 -0.500000 0.088388
v -0.088388 0.500000 0.088388
v -0.115485 -0.500000 0.047835
v -0.115485 0.500000 0.047835
v -0.125000 -0.500000 -0.000000
v -0.125000 0.500000 -0.000000
v -0.115485 -0.500000 -0.047835
v -0.115485 0.500000 -0.047835
v -0.088388 -0.500000 -0.088388
v -0.088388 0.500000 -0.088388
vt 0.062500 0.000000
vt 0.062500 1.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 0.937500 1.000000
vt 0.937500 0.000000
vt 0.875000 1.000000
vt 0.875000 0.000000
vt 0.812500 1.000000
vt 0.812500 0.000000
vt 0.750000 1.000000
vt 0.750000 0.000000
vt 0.687500 1.000000
vt 0.687500 0.000000
vt 0.625000 1.000000
vt 0.625000 0.000000
vt 0.562500 1.000000
vt 0.562500 0.000000
vt 0.500000 1.000000
vt 0.500000 0.000000
vt 0.437500 1.000000
vt 0.437500 0.000000
vt 0.375000 1.000000
vt 0.375000 0.000000
vt 0.312500 1.000000
vt 0.312500 0.000000
vt 0.250000 1.000000
vt 0.250000 0.000000
vt 0.187500 1.000000
vt 0.187500 0.000000
vt 0.308658 0.961940
vt 0.146447 0.853553
vt 0.038060 0.691342
vt 0.000000 0.500000
vt 0.038060 0.308658
vt 0.146447 0.146446
vt 0.308659 0.038060
vt 0.500001 0.000000
vt 0.691342 0.038060
vt 0.853554 0.146447
vt 0.961940 0.308659
vt 1.000000 0.500000
vt 0.961940 0.691342
vt 0.853553 0.853553
vt 0.691341 0.961940
vt 0.125000 0.000000
vt 0.125000 1.000000
vt 0.308658 0.038060
vt 0.853553 0.853554
vt 0.499999 1.000000
vt 0.308658 0.961939
vt 0.146446 0.853553
vt 0.038061 0.308658
usemtl None
s off
f 1/1 2/2 4/3 3/4
f 3/5 4/6 6/7 5/8
f 5/8 6/7 8/9 7/10
f 7/10 8/9 10/11 9/12
f 9/12 10/11 12/13 11/14
f 11/14 12/13 14/15 13/16
f 13/16 14/15 16/17 15/18
f 15/18 16/17 18/19 17/20
f 17/20 18/19 20/21 19/22
f 19/22 20/21 22/23 21/24
f 21/24 22/23 24/25 23/26
f 23/26 24/25 26/27 25/28
f 25/28 26/27 28/29 27/30
f 27/30 28/29 30/31 29/32
f 4/21 2/33 32/34 30/35 28/36 26/37 24/38 22/39 20/40 18/41 16/42 14/43 12/44 10/45 8/46 6/47
f 31/48 32/49 2/2 1/1
f 29/32 30/31 32/49 31/48
f 1/50 3/40 5/41 7/42 9/43 11/44 13/45 15/51 17/47 19/52 21/53 23/54 25/35 27/36 29/55 31/38