tweaked leaf model.

This commit is contained in:
NathanSalapat 2017-01-21 10:57:13 -06:00
parent f60d471f82
commit b57c1eab30
3 changed files with 94 additions and 42 deletions

View File

@ -109,68 +109,61 @@ minetest.override_item("default:coral_skeleton", {
drawtype = "mesh",
tiles = {"nodeboxtrees_scoral.png"},
wield_scale = {x = 0.5, y = 0.5, z = 0.5},
mesh = "leaf.b3d",
mesh = "leaf.obj",
paramtype = "light",
visual_scale = 0.55,
})
minetest.override_item("default:coral_brown", {
drawtype = "mesh",
tiles = {"nodeboxtrees_bcoral.png"},
wield_scale = {x = 0.5, y = 0.5, z = 0.5},
mesh = "leaf.b3d",
mesh = "leaf.obj",
paramtype = "light",
visual_scale = 0.55,
})
minetest.override_item("default:coral_orange", {
drawtype = "mesh",
tiles = {"nodeboxtrees_ocoral.png"},
wield_scale = {x = 0.5, y = 0.5, z = 0.5},
mesh = "leaf.b3d",
mesh = "leaf.obj",
paramtype = "light",
visual_scale = 0.55,
})
minetest.override_item("default:bush_leaves", {
drawtype = "mesh",
tiles = {"nodeboxtrees_leaves_simple.png"},
wield_scale = {x = 0.5, y = 0.5, z = 0.5},
mesh = "leaf.b3d",
mesh = "leaf.obj",
paramtype = "light",
visual_scale = 0.5,
})
minetest.override_item("default:acacia_bush_leaves", {
drawtype = "mesh",
tiles = {"nodeboxtrees_acacia_leaves_simple.png"},
wield_scale = {x = 0.5, y = 0.5, z = 0.5},
mesh = "leaf.b3d",
mesh = "leaf.obj",
paramtype = "light",
visual_scale = 0.5,
})
minetest.override_item("default:leaves", {
drawtype = "mesh",
tiles = {"nodeboxtrees_leaves.png"},
wield_scale = {x = 0.5, y = 0.5, z = 0.5},
mesh = "leaf.b3d",
mesh = "leaf.obj",
paramtype = "light",
paramtype2 = "degrotate",
visual_scale = 0.5,
on_construct = function(pos)
local node = minetest.get_node(pos)
node.param2 = math.random(10, 169)
end
-- paramtype2 = "degrotate",
-- on_construct = function(pos)
-- local node = minetest.get_node(pos)
-- node.param2 = math.random(10, 169)
-- end
})
minetest.override_item("default:acacia_leaves", {
drawtype = "mesh",
tiles = {"nodeboxtrees_acacia_leaves.png"},
wield_scale = {x = 0.5, y = 0.5, z = 0.5},
mesh = "leaf.b3d",
mesh = "leaf.obj",
paramtype = "light",
visual_scale = 0.5,
})
@ -178,27 +171,24 @@ minetest.override_item("default:jungleleaves", {
drawtype = "mesh",
tiles = {"nodeboxtrees_jungleleaves.png"},
wield_scale = {x = 0.5, y = 0.5, z = 0.5},
mesh = "leaf.b3d",
mesh = "leaf.obj",
paramtype = "light",
visual_scale = 0.5,
})
minetest.override_item("default:pine_needles", {
drawtype = "mesh",
tiles = {"nodeboxtrees_pine_needles.png"},
wield_scale = {x = 0.5, y = 0.5, z = 0.5},
mesh = "leaf.b3d",
mesh = "leaf.obj",
paramtype = "light",
visual_scale = 0.5,
})
minetest.override_item("default:aspen_leaves", {
drawtype = "mesh",
tiles = {"nodeboxtrees_aspen_leaves.png"},
wield_scale = {x = 0.5, y = 0.5, z = 0.5},
mesh = "leaf.b3d",
mesh = "leaf.obj",
paramtype = "light",
visual_scale = 0.5,
})
@ -211,30 +201,27 @@ if snowy_leaves then
minetest.register_node("nodebox_trees:leaves_with_snow", {
description = "Leaves With Snow",
drawtype = "mesh",
mesh = "leaf.b3d",
tiles = {"nodeboxtrees_leaves_snow.png", "default_snow.png", "default_snow.png",},
mesh = "leaf.obj",
tiles = {"nodeboxtrees_leaves_snow.png", "default_snow.png", "default_snow.png",},
paramtype = "light",
visual_scale = 0.5,
groups = {snappy=1, oddly_breakable_by_hand=1, leaves=1}
})
minetest.register_node("nodebox_trees:bush_leaves_with_snow", {
description = "Bush Leaves With Snow",
drawtype = "mesh",
mesh = "leaf.b3d",
tiles = {"nodeboxtrees_leaves_snow_simple.png", "default_snow.png", "default_snow.png",},
mesh = "leaf.obj",
tiles = {"nodeboxtrees_leaves_snow_simple.png", "default_snow.png", "default_snow.png",},
paramtype = "light",
visual_scale = 0.5,
groups = {snappy=1, oddly_breakable_by_hand=1, leaves=1}
})
minetest.register_node("nodebox_trees:pine_needles_with_snow", {
description = "Pine Needles With Snow",
drawtype = "mesh",
mesh = "leaf.b3d",
tiles = {"nodeboxtrees_pine_needles_snow.png",},
mesh = "leaf.obj",
tiles = {"nodeboxtrees_pine_needles_snow.png",},
paramtype = "light",
visual_scale = 0.5,
groups = {snappy=1, oddly_breakable_by_hand=1, leaves=1}
})
@ -252,7 +239,7 @@ minetest.register_on_generated(function(minp, maxp)
minetest.set_node(pos, {name="nodebox_trees:pine_needles_with_snow"})
end
end
local leaves = minetest.find_nodes_in_area(minp, maxp,
{"default:leaves"})
for n = 1, #leaves do
@ -261,7 +248,7 @@ minetest.register_on_generated(function(minp, maxp)
minetest.set_node(pos, {name="nodebox_trees:leaves_with_snow"})
end
end
local bush = minetest.find_nodes_in_area(minp, maxp,
{"default:bush_leaves"})
for n = 1, #bush do
@ -299,7 +286,7 @@ minetest.override_item("default:acacia_tree", {
connect_left = {{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}},
connect_right = {{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}},
},
connects_to = {"default:acacia_tree"}
connects_to = {"default:acacia_tree"}
})
minetest.override_item("default:tree", {
@ -316,7 +303,7 @@ minetest.override_item("default:tree", {
connect_left = {{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}},
connect_right = {{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}},
},
connects_to = {"default:tree"}
connects_to = {"default:tree"}
})
minetest.override_item("default:aspen_tree", {
@ -333,7 +320,7 @@ minetest.override_item("default:aspen_tree", {
connect_left = {{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}},
connect_right = {{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}},
},
connects_to = {"default:aspen_tree"}
connects_to = {"default:aspen_tree"}
})
minetest.override_item("default:pine_tree", {
@ -350,7 +337,7 @@ minetest.override_item("default:pine_tree", {
connect_left = {{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}},
connect_right = {{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}},
},
connects_to = {"default:pine_tree"}
connects_to = {"default:pine_tree"}
})
minetest.override_item("default:jungletree", {
@ -374,7 +361,7 @@ minetest.override_item("default:jungletree", {
connect_left = {{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}},
connect_right = {{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}},
},
connects_to = {"default:jungletree"}
connects_to = {"default:jungletree"}
})
@ -486,4 +473,4 @@ local mapgen = true
if mapgen and minetest.get_mapgen_setting("mg_name") ~= "v6" then
dofile(minetest.get_modpath("nodebox_trees").."/mapgen.lua")
end
end

Binary file not shown.

65
models/leaf.obj Normal file
View File

@ -0,0 +1,65 @@
# Blender v2.78 (sub 4) OBJ File: 'leaf.blend'
# www.blender.org
o Cube_Cube.001
v -0.498688 -0.491247 0.498704
v -0.498688 0.503753 0.498704
v -0.498688 -0.491247 -0.501296
v -0.498688 0.503753 -0.501296
v 0.501312 -0.491247 0.498704
v 0.501312 0.503753 0.498704
v 0.501312 -0.491247 -0.501296
v 0.501312 0.503753 -0.501296
v -0.702969 -0.742777 -0.895241
v 0.715709 -0.859610 0.769645
v -0.702969 0.877419 -0.781544
v 0.715710 0.760585 0.883342
v -0.832987 0.769057 0.762625
v 0.835994 0.868368 -0.652574
v -0.832987 -0.851139 0.648928
v 0.835994 -0.751827 -0.766271
vt 0.750000 0.250000
vt 0.750000 0.750000
vt 0.250000 0.750000
vt 0.250000 0.250000
vt 0.750000 0.250000
vt 0.750000 0.750000
vt 0.250000 0.750000
vt 0.250000 0.250000
vt 0.750000 0.250000
vt 0.750000 0.750000
vt 0.250000 0.750000
vt 0.250000 0.250000
vt 0.750000 0.250000
vt 0.750000 0.750000
vt 0.250000 0.750000
vt 0.250000 0.250000
vt 0.750000 0.750000
vt 0.250000 0.750000
vt 0.750000 0.250000
vt 0.250000 0.250000
vt 0.000000 0.000000
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 0.000000 1.000000
vn -1.0000 0.0000 0.0000
vn 0.0000 0.0000 -1.0000
vn 1.0000 0.0000 0.0000
vn 0.0000 0.0000 1.0000
vn 0.0000 -1.0000 0.0000
vn 0.0000 1.0000 0.0000
vn -0.7619 -0.0453 0.6461
vn -0.6477 0.0533 -0.7601
g Cube_Cube.001_Material
s off
f 1/1/1 2/2/1 4/3/1 3/4/1
f 3/5/2 4/6/2 8/7/2 7/8/2
f 7/9/3 8/10/3 6/11/3 5/12/3
f 5/13/4 6/14/4 2/15/4 1/16/4
f 3/5/5 7/17/5 5/18/5 1/16/5
f 8/10/6 4/19/6 2/20/6 6/11/6
f 12/21/7 11/22/7 9/23/7 10/24/7
f 13/25/8 14/26/8 16/27/8 15/28/8