Basic node_box model examples
Basic node_box model examples
well i hope this thread is helpfull.
Whats the goal?
it should help moders to see basic node_box model codes so they can use that in there projects.
How to put in here?
nice would be a picture and a basic discreption what the model looks like and the of course the fixed {x,y,z, x,y,z) values.
so here is a example:
Picture :
Description:
this is a left side panel of any material (in example its default:wood) with the thickness of 0.10
Code:
node_box = {
type = "fixed",
fixed = { {-0.50, - 0.50, -0.50, -0.40, 0.50, 0.50}, }
Would be nice if you guys would add some more examples so we can have a kind of database which allows us to develop more komplex node_boxes in future.
thanks in advance
Whats the goal?
it should help moders to see basic node_box model codes so they can use that in there projects.
How to put in here?
nice would be a picture and a basic discreption what the model looks like and the of course the fixed {x,y,z, x,y,z) values.
so here is a example:
Picture :
Description:
this is a left side panel of any material (in example its default:wood) with the thickness of 0.10
Code:
node_box = {
type = "fixed",
fixed = { {-0.50, - 0.50, -0.50, -0.40, 0.50, 0.50}, }
Would be nice if you guys would add some more examples so we can have a kind of database which allows us to develop more komplex node_boxes in future.
thanks in advance
++++ Kung walang tiyaga, walang nilaga. ++++
simple chair
Picture:
Discription:
three side's with basic panel and one middle panel form a chari
Code:
node_box = {
type = "fixed",
fixed = {
{-0.50, -0.50, -0.50, -0.40, 0.50, 0.50},
{-0.50, 0.00 ,-0.50, 0.50, 0.10, 0.50},
{-0.50, -0.50 ,-0.50, 0.50, 0.50, -0.40},
{ 0.40, 0.50 , 0.50, 0.50, -0.50, -0.50},
}
},
i guess this shows my attention, so a few basic node's and everybody is able to create more komplex things for adding to minetest.
Picture:
Discription:
three side's with basic panel and one middle panel form a chari
Code:
node_box = {
type = "fixed",
fixed = {
{-0.50, -0.50, -0.50, -0.40, 0.50, 0.50},
{-0.50, 0.00 ,-0.50, 0.50, 0.10, 0.50},
{-0.50, -0.50 ,-0.50, 0.50, 0.50, -0.40},
{ 0.40, 0.50 , 0.50, 0.50, -0.50, -0.50},
}
},
i guess this shows my attention, so a few basic node's and everybody is able to create more komplex things for adding to minetest.
++++ Kung walang tiyaga, walang nilaga. ++++
Pyramid 1 x 1 x 0.5
Code: Select all
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5, 0.5,-0.4,0.5}, --lower level
{-0.4,-0.4,-0.4, 0.4,-0.3,0.4}, --2nd level
{-0.3,-0.3,-0.3, 0.3,-0.2,0.3}, --3rd level
{-0.2,-0.2,-0.2, 0.2,-0.1,0.2}, --4th level
{-0.1,-0.1,-0.1, 0.1,0,0.1} -- top level
}
}
Last edited by cactuz_pl on Thu Jul 12, 2012 07:19, edited 1 time in total.
Nope
Thanks for this tutorial. I have tried duplicating it a bit with Wings3d and have some tips.
Here's the first slab: http://www.lesismore.co.za/img/wings-1.png
If you set a bounding box at 1, 1, 1, you can practice drawing cubes inside of it. That's the green cube in the image. If you export the cubes in bzw format you get the text to the right in that image. Since you can only draw cubes, only the vertices on lines 2 and 4 are needed, I marked them with ###.
Then I added another slab: http://www.lesismore.co.za/img/wings-2.png
This produced The following images inside Minetest:
http://www.lesismore.co.za/img/wings_in_mt1.png
http://www.lesismore.co.za/img/wings-in-mt2.png
...you can see the model messed up in the last image because I got the vertex order wrong. It seems you need to specify the smaller X, Y and Z before the larger, so this is correct:
-- x1 y1 z1 x2 y2 z2
{-0.5, -0.5, -0.5, -0.4, 0.5, 0.5}, -- slab 1
{0.4, -0.5, -0.5, 0.5, 0.5, 0.5} -- slab 2
This means that if you want to export cubes from Wings3d in bzw format, you need to rearrange things a bit. This is the second slab, the one that looks like this in Minetest:
{0.4, -0.5, -0.5, 0.5, 0.5, 0.5} -- slab 2
The mesh in the bzw file:
mesh
name cube2_copy3
#8 vertices, 6 faces
vertex 0.4000 -0.5000 0.5000
vertex 0.4000 0.5000 0.5000
vertex 0.5000 0.5000 0.5000 #line 2, second 3 co-ords
vertex 0.5000 -0.5000 0.5000
vertex 0.4000 -0.5000 -0.5000 #line 4, first 3 co-ords
vertex 0.4000 0.5000 -0.5000
vertex 0.5000 0.5000 -0.5000
vertex 0.5000 -0.5000 -0.5000
Is there a better format to use when exporting from Wings3d?
Here's the first slab: http://www.lesismore.co.za/img/wings-1.png
If you set a bounding box at 1, 1, 1, you can practice drawing cubes inside of it. That's the green cube in the image. If you export the cubes in bzw format you get the text to the right in that image. Since you can only draw cubes, only the vertices on lines 2 and 4 are needed, I marked them with ###.
Then I added another slab: http://www.lesismore.co.za/img/wings-2.png
This produced The following images inside Minetest:
http://www.lesismore.co.za/img/wings_in_mt1.png
http://www.lesismore.co.za/img/wings-in-mt2.png
...you can see the model messed up in the last image because I got the vertex order wrong. It seems you need to specify the smaller X, Y and Z before the larger, so this is correct:
-- x1 y1 z1 x2 y2 z2
{-0.5, -0.5, -0.5, -0.4, 0.5, 0.5}, -- slab 1
{0.4, -0.5, -0.5, 0.5, 0.5, 0.5} -- slab 2
This means that if you want to export cubes from Wings3d in bzw format, you need to rearrange things a bit. This is the second slab, the one that looks like this in Minetest:
{0.4, -0.5, -0.5, 0.5, 0.5, 0.5} -- slab 2
The mesh in the bzw file:
mesh
name cube2_copy3
#8 vertices, 6 faces
vertex 0.4000 -0.5000 0.5000
vertex 0.4000 0.5000 0.5000
vertex 0.5000 0.5000 0.5000 #line 2, second 3 co-ords
vertex 0.5000 -0.5000 0.5000
vertex 0.4000 -0.5000 -0.5000 #line 4, first 3 co-ords
vertex 0.4000 0.5000 -0.5000
vertex 0.5000 0.5000 -0.5000
vertex 0.5000 -0.5000 -0.5000
Is there a better format to use when exporting from Wings3d?
To answer my own question, yes, there is a better format. Here's a very rudimentary Wavefront .obj to Minetest block converter: http://pastebin.com/NbGDZe8d
So as long as you only make cubes and those cubes are inside the 1,1,1 bounding box, you should be able to export as .obj and then convert with this Ruby program.
Don't bother reporting problems with this script if it doesn't work for you though - I have only tested it on two scenes so far!
So as long as you only make cubes and those cubes are inside the 1,1,1 bounding box, you should be able to export as .obj and then convert with this Ruby program.
Don't bother reporting problems with this script if it doesn't work for you though - I have only tested it on two scenes so far!
@lesliev
looks like wings3d is a good program to test and dsign some nodebox models, guess i have to try this too.
my problem always is, that my mind is not working good in 3d, so i have to use a lot of try and error to see a good result with the nodebox.
so thank you for this good tip.
looks like wings3d is a good program to test and dsign some nodebox models, guess i have to try this too.
my problem always is, that my mind is not working good in 3d, so i have to use a lot of try and error to see a good result with the nodebox.
so thank you for this good tip.
++++ Kung walang tiyaga, walang nilaga. ++++
simple chair
Discription:
top panel and simple "stick" for a simple table
Code:
node_box = {
type = "fixed",
fixed = {
{-0.1,-0.5, -0.1, 0.1, 0.5 ,0.1},
{-0.5, 0.5, -0.5, 0.5, 0.4, 0.5},
}
},
Discription:
top panel and simple "stick" for a simple table
Code:
node_box = {
type = "fixed",
fixed = {
{-0.1,-0.5, -0.1, 0.1, 0.5 ,0.1},
{-0.5, 0.5, -0.5, 0.5, 0.4, 0.5},
}
},
Last edited by tkerwel on Mon Jul 16, 2012 13:29, edited 1 time in total.
++++ Kung walang tiyaga, walang nilaga. ++++
i dont get what you want to ask or what your intention is...Stef wrote:can you make with this also a litle blocks mod???
you want something like the little block mode in minecraft?
... thats posible, but will be a lot of work.
for example you can define little blocks inside the node as cube's with o,1 as side length. a node box is a box from -0.5 to 0.5 each axis, with this you can create 10 little cubs/blocks for each axis.....quite a lot to discribe and will be tricky not to lose the overview which little box you need.
maybe you like to start a data-base for this ;-) i would be glad, so i dont have to torture my brain, if i need a special box/cube in the nodebox ....
++++ Kung walang tiyaga, walang nilaga. ++++
simple shelf
Discription:l
left and right half panel plus two half layer to get a simple shelf
Code:
node_box = {
type = "fixed",
-- fixed = slopebox,
fixed = {
{-0.50, - 0.50, 0.00, -0.40, 0.50, 0.50}, -- left side
{-0.50, -0.35 , 0.00, 0.50, -0.25, 0.50},-- middle layer1
{-0.50, 0.250 , 0.00, 0.50, 0.35, 0.50},-- middle layer2
{ 0.50, 0.50 , 0.00, 0.40, -0.50, 0.50},--right sid
}
Discription:l
left and right half panel plus two half layer to get a simple shelf
Code:
node_box = {
type = "fixed",
-- fixed = slopebox,
fixed = {
{-0.50, - 0.50, 0.00, -0.40, 0.50, 0.50}, -- left side
{-0.50, -0.35 , 0.00, 0.50, -0.25, 0.50},-- middle layer1
{-0.50, 0.250 , 0.00, 0.50, 0.35, 0.50},-- middle layer2
{ 0.50, 0.50 , 0.00, 0.40, -0.50, 0.50},--right sid
}
Last edited by tkerwel on Tue Jul 17, 2012 12:17, edited 1 time in total.
++++ Kung walang tiyaga, walang nilaga. ++++
I created a tutorial for nodeboxes, using 3D programs.
Albert Einstein once said:
only really know something, if you can explain it so that your own grandmother will understand.
I created a step by step with everything needed for anyone ever to use 3D software.
only has a downside, is in Spanish,my language; I hope someone wants to translate it because google .... (google can help but not perfect ...)
download:
tutorial Nodebox con Wings 3D.pdf ESPAÑOL
Albert Einstein once said:
only really know something, if you can explain it so that your own grandmother will understand.
I created a step by step with everything needed for anyone ever to use 3D software.
only has a downside, is in Spanish,my language; I hope someone wants to translate it because google .... (google can help but not perfect ...)
download:
tutorial Nodebox con Wings 3D.pdf ESPAÑOL
Last edited by tonyka on Tue Jul 17, 2012 20:55, edited 1 time in total.
My mod: [MOD]3D Forniture 1.0
Download: 3DForniture_v_1.0.zip
Page development (European Castilian):
Moviliario 3D (proyecto 3D Forniture)
Download: 3DForniture_v_1.0.zip
Page development (European Castilian):
Moviliario 3D (proyecto 3D Forniture)
-
- Member
- Posts: 180
- Joined: Tue Nov 01, 2011 18:53
I'm translating it right now, but you really should learn english... and improve your spanish spelling, lol.tonyka wrote:I created a tutorial for nodeboxes, using 3D programs.
Albert Einstein once said:
only really know something, if you can explain it so that your own grandmother will understand.
I created a step by step with everything needed for anyone ever to use 3D software.
only has a downside, is in Spanish,my language; I hope someone wants to translate it because google .... (google can help but not perfect ...)
download:
tutorial Nodebox con Wings 3D.pdf ESPAÑOL
-
- Member
- Posts: 180
- Joined: Tue Nov 01, 2011 18:53
I translated tonyka's manual, you can download it from here: https://dl.dropbox.com/u/57504822/nodeboxes.odt
Please help me improve my English by telling me all the gramatical/spelling/... errors you can find in it
Please help me improve my English by telling me all the gramatical/spelling/... errors you can find in it
I'm afraid that's very difficult for me to get ...cosarara97 wrote:I'm translating it right now, but you really should learn english... and improve your spanish spelling, lol.
confuse letters, since he was little, is a kind of dysgraphia
but I'm a whiz with mathematics and technical drawing
the ways of God are inscrutable ...
My mod: [MOD]3D Forniture 1.0
Download: 3DForniture_v_1.0.zip
Page development (European Castilian):
Moviliario 3D (proyecto 3D Forniture)
Download: 3DForniture_v_1.0.zip
Page development (European Castilian):
Moviliario 3D (proyecto 3D Forniture)
hey thankscosarara97 wrote:I translated tonyka's manual, you can download it from here: https://dl.dropbox.com/u/57504822/nodeboxes.odt
Please help me improve my English by telling me all the gramatical/spelling/... errors you can find in it
My mod: [MOD]3D Forniture 1.0
Download: 3DForniture_v_1.0.zip
Page development (European Castilian):
Moviliario 3D (proyecto 3D Forniture)
Download: 3DForniture_v_1.0.zip
Page development (European Castilian):
Moviliario 3D (proyecto 3D Forniture)
@cosarara97
would it be possible also to translate most of the info of the "Moviliario 3D (proyecto 3D Forniture)" cause i think this is a very good basic for understanding how the node boy is working. kind of bible of 3d in minetest (lol).
i realy would love it, if somebody could translate this info and give other moders that as gift for therer development.
and my biggest thanks to tonyka for the work he is doing and the insperation he already give me
would it be possible also to translate most of the info of the "Moviliario 3D (proyecto 3D Forniture)" cause i think this is a very good basic for understanding how the node boy is working. kind of bible of 3d in minetest (lol).
i realy would love it, if somebody could translate this info and give other moders that as gift for therer development.
and my biggest thanks to tonyka for the work he is doing and the insperation he already give me
++++ Kung walang tiyaga, walang nilaga. ++++
Simple side table (cabinet)
Discription:
a bit more complicatet this time, mainly a cube with space to the bottom with 4 feet
code:
node_box = {
type = "fixed",
-- fixed = slopebox,
fixed = {
{-0.50, 0.30, -0.50, 0.50, 0.50, 0.50},-- tope layer
{-0.50, -0.30, -0.50, -0.40, 0.50, 0.50},-- left side
{ 0.40, -0.30, -0.50, 0.50, 0.50, 0.50},-- right sid
{-0.50, -0.30, -0.50, 0.50, 0.50, -0.50},-- front side
{ 0.50, -0.30, 0.50, -0.50, 0.50, 0.50},-- back side
{-0.50, -0.50, -0.50, -0.40, 0.50, -0.40},-- left front foot
{-0.50, -0.50, 0.40, -0.40, 0.50, 0.50},-- left back foot
{ 0.50, -0.50, -0.50, 0.40, 0.50, -0.40},-- right front foot
{ 0.40, -0.50, 0.40, 0.50, 0.50, 0.50},-- right back foot
}
},
Discription:
a bit more complicatet this time, mainly a cube with space to the bottom with 4 feet
code:
node_box = {
type = "fixed",
-- fixed = slopebox,
fixed = {
{-0.50, 0.30, -0.50, 0.50, 0.50, 0.50},-- tope layer
{-0.50, -0.30, -0.50, -0.40, 0.50, 0.50},-- left side
{ 0.40, -0.30, -0.50, 0.50, 0.50, 0.50},-- right sid
{-0.50, -0.30, -0.50, 0.50, 0.50, -0.50},-- front side
{ 0.50, -0.30, 0.50, -0.50, 0.50, 0.50},-- back side
{-0.50, -0.50, -0.50, -0.40, 0.50, -0.40},-- left front foot
{-0.50, -0.50, 0.40, -0.40, 0.50, 0.50},-- left back foot
{ 0.50, -0.50, -0.50, 0.40, 0.50, -0.40},-- right front foot
{ 0.40, -0.50, 0.40, 0.50, 0.50, 0.50},-- right back foot
}
},
Last edited by tkerwel on Wed Jul 18, 2012 09:55, edited 1 time in total.
++++ Kung walang tiyaga, walang nilaga. ++++
simple half cabinet (Billy IKEA like) ;-)
Discription:
its a half cabinet same build like the shelf, just add a front door. in pic now with the same texture like the simple shelf, gives us a little IKEA feeling.... my tribute to "BILLY"
code:
node_box = {
type = "fixed",
-- fixed = slopebox,
fixed = {
{-0.50, - 0.50, 0.00, -0.40, 0.50, 0.50}, -- left side
{-0.50, -0.35, 0.00, 0.50, 0.35, 0.50},-- front side
{ 0.50, 0.50 , 0.00, 0.40, -0.50, 0.50},--right sid
}
},
Discription:
its a half cabinet same build like the shelf, just add a front door. in pic now with the same texture like the simple shelf, gives us a little IKEA feeling.... my tribute to "BILLY"
code:
node_box = {
type = "fixed",
-- fixed = slopebox,
fixed = {
{-0.50, - 0.50, 0.00, -0.40, 0.50, 0.50}, -- left side
{-0.50, -0.35, 0.00, 0.50, 0.35, 0.50},-- front side
{ 0.50, 0.50 , 0.00, 0.40, -0.50, 0.50},--right sid
}
},
++++ Kung walang tiyaga, walang nilaga. ++++
Castle window, three blocks: upper middle and bottom.
Upper:
Middle:
Bottom:
Licence: GNU GPL v3
Feel free to use these data in your mod.
Upper:
Code: Select all
node_box = {
type = "fixed",
fixed = {
{-0.4,0.4,-0.5, 0.4,0.5,-0.4},
{-0.4,0.4,0.4, 0.4,0.5,0.5},
{-0.3,0.3,-0.4, 0.3,0.5,-0.3},
{-0.3,0.3,0.3, 0.3,0.5,0.4},
{-0.2,0.2,-0.3, 0.2,0.5,0.3},
{0.2,-0.5,-0.3, 0.3,0.5,0.3},
{-0.3,-0.5,-0.3, -0.2,0.5,0.3},
{0.3,-0.5,-0.4, 0.4,0.5,0.4},
{-0.4,-0.5,-0.4, -0.3,0.5,0.4},
{0.4,-0.5,-0.5, 0.5,0.5,0.5},
{-0.5,-0.5,-0.5, -0.4,0.5,0.5},
},
},
Code: Select all
node_box = {
type = "fixed",
fixed = {
{0.2,-0.5,-0.3, 0.3,0.5,0.3},
{-0.3,-0.5,-0.3, -0.2,0.5,0.3},
{0.3,-0.5,-0.4, 0.4,0.5,0.4},
{-0.4,-0.5,-0.4, -0.3,0.5,0.4},
{0.4,-0.5,-0.5, 0.5,0.5,0.5},
{-0.5,-0.5,-0.5, -0.4,0.5,0.5},
},
},
Code: Select all
node_box = {
type = "fixed",
fixed = {
{0.2,-0.4,-0.3, 0.3,0.5,0.3},
{-0.3,-0.4,-0.3, -0.2,0.5,0.3},
{0.3,-0.4,-0.4, 0.4,0.5,0.4},
{-0.4,-0.4,-0.4, -0.3,0.5,0.4},
{0.4,-0.4,-0.5, 0.5,0.5,0.5},
{-0.5,-0.4,-0.5, -0.4,0.5,0.5},
{-0.5,-0.5,-0.5, 0.5,-0.4,0.5}
},
},
Feel free to use these data in your mod.
Last edited by cactuz_pl on Wed Jul 18, 2012 16:28, edited 1 time in total.
Nope
simple barrel (as far this can still be called simple)
Discription:
first i have to mention:
1. this this is based on the texture of "mauvebic" its his barrel texture
2. the idea with the slopebox is original from jeija
here we draw a circle in the node box parameters can be changed
local slopebox = {}
local px = 0
local py = 0
local kreis =45
local r = 0.3
for pk = 0, kreis, 1 do
px= r * math.cos(pk)
py= r * math.sin(pk)
slopebox[pk+1]={px, -0.5 , py, px+0.1, 0.4, py+0.1}
end
the node box function is easy with this:
node_box = {
type = "fixed",
fixed = slopebox,
},
i dont know if i realy have to write hier the licence ? mainly its only a code sniplet, so everybody can use it for his own purpose and change this.
my intention is, to give with this examples some ppl the idea what is possible with the node box ....
Discription:
first i have to mention:
1. this this is based on the texture of "mauvebic" its his barrel texture
2. the idea with the slopebox is original from jeija
here we draw a circle in the node box parameters can be changed
local slopebox = {}
local px = 0
local py = 0
local kreis =45
local r = 0.3
for pk = 0, kreis, 1 do
px= r * math.cos(pk)
py= r * math.sin(pk)
slopebox[pk+1]={px, -0.5 , py, px+0.1, 0.4, py+0.1}
end
the node box function is easy with this:
node_box = {
type = "fixed",
fixed = slopebox,
},
i dont know if i realy have to write hier the licence ? mainly its only a code sniplet, so everybody can use it for his own purpose and change this.
my intention is, to give with this examples some ppl the idea what is possible with the node box ....
++++ Kung walang tiyaga, walang nilaga. ++++
Can you post complete lua with this barrel, I want to understand where this:tkerwel wrote:local slopebox = {}
local px = 0
local py = 0
local kreis =45
local r = 0.3
for pk = 0, kreis, 1 do
px= r * math.cos(pk)
py= r * math.sin(pk)
slopebox[pk+1]={px, -0.5 , py, px+0.1, 0.4, py+0.1}
end
the node box function is easy with this:
node_box = {
type = "fixed",
fixed = slopebox,
},
Code: Select all
local slopebox = {}
local px = 0
local py = 0
local kreis =45
local r = 0.3
for pk = 0, kreis, 1 do
px= r * math.cos(pk)
py= r * math.sin(pk)
slopebox[pk+1]={px, -0.5 , py, px+0.1, 0.4, py+0.1}
end
---
Simple model of platform:
Code: Select all
node_box = {
type = "fixed",
fixed = {
{-0.5,0.4,0.3, 0.5,0.5,0.35},
{-0.5,0.4,0.1, 0.5,0.5,0.15},
{-0.5,0.4,-0.1, 0.5,0.5,-0.05},
{-0.5,0.4,-0.3, 0.5,0.5,-0.25},
{-0.5,0.4,-0.5, 0.5,0.5,-0.45},
{-0.35,0.4,-0.5, -0.3,0.5,0.5},
{-0.15,0.4,-0.5, -0.1,0.5,0.5},
{5.e-2,0.4,-0.5, 1.e-1,0.5,0.5},
{0.25,0.4,-0.5, 0.3,0.5,0.5},
{0.45,0.4,-0.5, 0.5,0.5,0.5},
},
},
Last edited by cactuz_pl on Thu Jul 19, 2012 12:04, edited 1 time in total.
Nope
@cactuz_pl
local slopebox = {}
local px = 0
local py = 0
local kreis =45
local r = 0.3
for pk = 0, kreis, 1 do
px= r * math.cos(pk)
py= r * math.sin(pk)
slopebox[pk+1]={px, -0.5 , py, px+0.1, 0.4, py+0.1}
end
minetest.register_node("deko:deko_circle", {
description = "deko_circle",
drawtype = "nodebox",
tiles = {
"deko_stahl.png",
"deko_stahl.png",
"deko_barrel.png",
},
inventory_image = "default_wood.png",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
},
node_box = {
type = "fixed",
fixed = slopebox,
},
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=3,flammable=2},
})
just make sure that the name (deko:deko_circle) is changed to the name you use in your mod. for the tiles ={} you can use your own or default_wood.png.
the whole secret is that you put all the values you need into the slopebox ={} with a simple "for loop" within this loop you calculate with the a bit of math the values of the x and y coordinate for a circle and put them into the slope.
this slopebox contains now all data you need and can be put into the node_box easy....
fixed = slopebox
i already was thinking abt a small converter for 3D objects. theoretical you can transfer into this slopebox data for lots of 3D objects and then place them with the node_box parameter into minetest.
i guess sooner or later somebody herer will find a way to convert 3D objects into minetest this way....
maybe you start this ?
no problem, here is the whole code for itCan you post complete lua with this barrel, I want to understand where this:
local slopebox = {}
local px = 0
local py = 0
local kreis =45
local r = 0.3
for pk = 0, kreis, 1 do
px= r * math.cos(pk)
py= r * math.sin(pk)
slopebox[pk+1]={px, -0.5 , py, px+0.1, 0.4, py+0.1}
end
minetest.register_node("deko:deko_circle", {
description = "deko_circle",
drawtype = "nodebox",
tiles = {
"deko_stahl.png",
"deko_stahl.png",
"deko_barrel.png",
},
inventory_image = "default_wood.png",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
},
node_box = {
type = "fixed",
fixed = slopebox,
},
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=3,flammable=2},
})
just make sure that the name (deko:deko_circle) is changed to the name you use in your mod. for the tiles ={} you can use your own or default_wood.png.
the whole secret is that you put all the values you need into the slopebox ={} with a simple "for loop" within this loop you calculate with the a bit of math the values of the x and y coordinate for a circle and put them into the slope.
this slopebox contains now all data you need and can be put into the node_box easy....
fixed = slopebox
i already was thinking abt a small converter for 3D objects. theoretical you can transfer into this slopebox data for lots of 3D objects and then place them with the node_box parameter into minetest.
i guess sooner or later somebody herer will find a way to convert 3D objects into minetest this way....
maybe you start this ?
++++ Kung walang tiyaga, walang nilaga. ++++
drill machine
Discription:
an simple 3d model for a drill you can put on a table or block.
code:
node_box = {
type = "fixed",
-- fixed = slopebox,
fixed = {
{ -0.10, -0.50, 0.40, 0.10, 0.50, 0.50},
{ -0.10, 0.40, 0.40, 0.10, 0.50, -0.20},
{ -0.20, 0.00, 0.20, 0.20, 0.40, -0.20},
{ -0.01, 0.40,-0.01, 0.01,-0.30, 0.01},
{ -0.20, -0.50, 0.20, 0.20,-0.40, -0.20},
}
},
Discription:
an simple 3d model for a drill you can put on a table or block.
code:
node_box = {
type = "fixed",
-- fixed = slopebox,
fixed = {
{ -0.10, -0.50, 0.40, 0.10, 0.50, 0.50},
{ -0.10, 0.40, 0.40, 0.10, 0.50, -0.20},
{ -0.20, 0.00, 0.20, 0.20, 0.40, -0.20},
{ -0.01, 0.40,-0.01, 0.01,-0.30, 0.01},
{ -0.20, -0.50, 0.20, 0.20,-0.40, -0.20},
}
},
++++ Kung walang tiyaga, walang nilaga. ++++
LCD monitor model:
Feel free to use these data in your mod.
Code: Select all
node_box = {
type = "fixed",
fixed = {
{-2.5136044e-2,-0.45259861,-1.0000000e-1, 2.4863956e-2,-2.5986075e-3,0.10000000},
{0.13023723,-0.25615262,-0.40006064, 0.16023723,0.26767738,-0.37006064},
{0.13023723,-0.25615274,0.37054221, 0.16023723,0.26767750,0.40054221},
{0.13023723,-0.30600000,-0.40000000, 0.16023723,-0.25600000,0.40000000},
{0.12945597,0.26433021,-0.40000000, 0.15945597,0.29433021,0.40000000},
{2.9045502e-2,-0.25514168,-0.35000000, 7.9045502e-2,0.24485832,0.35000000},
{8.0237234e-2,-0.30617002,-0.40000000, 0.13023723,0.29382998,0.40000000},
{-0.25000000,-0.50000000,-0.25000000, 0.25000000,-0.45000000,0.25000000}
},
},
Last edited by cactuz_pl on Thu Jul 19, 2012 16:25, edited 1 time in total.
Nope
Who is online
Users browsing this forum: No registered users and 33 guests