Temperest wrote:Cylinders!
I used the Bresenham Circle Algorithm, so it's amazingly fast. The solid dirt cylinder (length 100, radius 5) in the middle took about 2 seconds, while the outer glass hollow cylinder (length 100, radius 10) took less than a second. It's the //hollowcylinder and //cylinder commands, and both are documented in the README.
Additionally, the WorldEdit API has the added worldedit.hollow_cylinder and worldedit.cylinder functions, so anyone can use these routines in their own mods!
Spheres coming soon!
Jordach wrote:Cool, and don't use ALT+Prt Scrn. Make use of F12, just as long you are using Minetest.
cornernote wrote:Awesome! Thanks for making them available via api. Will be useful to be able to make an object/node that turns into a sphere of nodes. I think I may also use it to generate starting spheres in my skyblock game.
I have some requests...
1) //save and //load with support for node metadata
2) other shapes:
- spiralsquare - http://rosettacode.org/wiki/Spiral_matrix#Lua (i also requested this in multinode) -- great for floor/wall patterns, or perhaps mazes.
- rectangular pyramid -- perfect for roofs
- circular pyramid (cone) -- perfect for castle turrets
- triangular prism (triangle tube)
- hexagonal prism (6 sided tube)
- wedge (like a cube cut down the )
- torus (doughnut)
I know that's a lot, but it would be really cool to be able to generate different 3d shapes to help build the world.
Thanks again for this mod.
zzarko wrote:Maybe this is not strictly mod-related, but I have a few questions:
- Is there a way to list available block names? Or, to see what's the name of the block under cursor?
- How can I know where are X and Z axes oriented? I often don't know in what direction will stacking be done (except when going up or down).
- When loading something, what will be the orientation (probably related to previous question)?
Thanks for the mod update!
cornernote wrote:[...]2) other shapes:
- spiralsquare - http://rosettacode.org/wiki/Spiral_matrix#Lua (i also requested this in multinode) -- great for floor/wall patterns, or perhaps mazes.
[...]
cornernote wrote:- spiralsquare - http://rosettacode.org/wiki/Spiral_matrix#Lua (i also requested this in multinode) -- great for floor/wall patterns, or perhaps mazes.
Eazi98 wrote:Lighting error unfixable? Whats with that? when you have a layer above air on top of another layer there will be a lighting error when you replace the top layer with air. Can you tell me what to do?
INFO[main]: [MineTest-WorldEdit] ["C:\Users\Dalton\Minetest\minetest-0.4.2-latest\bin\..\mods\minetest\MineTest-WorldEdit\init.lua"]
14:13:45: ERROR[main]: Error loading mod "MineTest-WorldEdit": modname does not follow naming conventions: Only chararacters [a-z0-9_] are allowed.
14:13:45: ERROR[main]: Server: Failed to load and run C:\Users\Dalton\Minetest\minetest-0.4.2-latest\bin\..\mods\minetest\MineTest-WorldEdit\init.lua
-- sphere or hollow sphere - (based on sphere+hollowsphere in multinode by mauvebic)
make_sphere = function(pos,radius,nodename,hollow)
pos.x = math.floor(pos.x+0.5)
pos.y = math.floor(pos.y+0.5)
pos.z = math.floor(pos.z+0.5)
for x=-radius,radius do
for y=-radius,radius do
for z=-radius,radius do
if hollow ~= nil then
if x*x+y*y+z*z >= (radius-hollow) * (radius-hollow) + (radius-hollow) and x*x+y*y+z*z <= radius * radius + radius then
minetest.env:add_node({x=pos.x+x,y=pos.y+y,z=pos.z+z},{name=nodename})
end
else
if x*x+y*y+z*z <= radius * radius + radius then
minetest.env:add_node({x=pos.x+x,y=pos.y+y,z=pos.z+z},{name=nodename})
end
end
end
end
end
end
cornernote wrote:[request]
i would like to be able to draw a cylinder with a negative length (eg, -100). at the moment this does not render any nodes, it should start from 0 and go backwards.
p.s. when i have some time i'll look at it if nobody else has by then, just noting these issues here so i dont forget.
Temperest wrote:Spheres! Commit.
I sped up the spheres code significantly, but it could still use some improvements with larger dimensions. Thanks to cornernote for the original code.
-- detect sphere/hollow sphere area
if x*x+y*y+z*z >= (radius-hollow) * (radius-hollow) + (radius-hollow) and x*x+y*y+z*z <= radius * radius + radius then ... end
if x*x+y*y+z*z <= radius * radius + radius then ... end
Users browsing this forum: No registered users and 82 guests