A nodebox is a cub(e / oid) that is not rotated. It is defined by two points (eg: top left, bottom right)
Simple example:
Code: Select all
{-0.5,-0.5,-0.5,0.5,0.5,0.5}, -- one box
{-0.5,-0.5,-0.5,0.5,0.5,0.5}, -- another box
{-0.5,-0.5,-0.5,0.5,0.5,0.5} -- another box
Node box coordinates go from -0.5 to 0.5, because the center of a node (block) is 0,0,0
Each row is
Where 1 is one corner, and 2 is the other corner, diagonally.
Here is an
example of it in practice:
Code: Select all
minetest.register_node("3dforniture:table",{
description = 'Table',
tiles = {
"forniture_wood.png",
"forniture_wood.png",
"forniture_wood_s1.png",
"forniture_wood_s1.png",
"forniture_wood_s2.png",
"forniture_wood_s2.png",
},
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.4,-0.5,-0.4, -0.3,0.4,-0.3},
{0.3,-0.5,-0.4, 0.4,0.4,-0.3},
{-0.4,-0.5,0.3, -0.3,0.4,0.4},
{0.3,-0.5,0.3, 0.4,0.4,0.4},
{-0.5,0.4,-0.5, 0.5,0.5,0.5},
{-0.4,-0.2,-0.3, -0.3,-0.1,0.3},
{0.3,-0.2,-0.4, 0.4,-0.1,0.3},
{-0.3,-0.2,-0.4, 0.4,-0.1,-0.3},
{-0.3,-0.2,0.3, 0.3,-0.1,0.4},
},
},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}
})