These aren't entities, they're nodes, and unlike the old method of using tons of small nodeboxes to create shapes, they are perfectly flat and/or diagonal and/or round (well, as much so as a computer is capable of anyway). The slopes consist of only a few faces/polygons each, while the more rounded objects have far more (though enormously less than a nodebox-based equivalent at a passable resolution would have).
All of the objects are based on Blender's built-in primitives. Why re-invent the wheel, right? :-)

Some of the shapes that can be made with this mod. The inventory at the bottom shows the full set of primitives.
Usage:
Nothing special to using them really. Get a few (creative or /giveme, see list below) and place them. Note that a few of these only have the "_onetexture" variety. The one-piece "long" slope takes up two nodes; point at where the back/thick end should go. The code does not check for adequate space before placing. Also, the code does not attempt to auto-place the front/back halves of the two-node version of the long slope..
Spoiler
slope_test:slope
slope_test:ocorner
slope_test:icorner
slope_test:slope_onetexture
slope_test:ocorner_onetexture
slope_test:icorner_onetexture
slope_test:slope_long
slope_test:slope_long_onetexture
slope_test:cylinder
slope_test:cylinder_onetexture
slope_test:pyramid_onetexture
slope_test:pyramid_short_onetexture
slope_test:quarter_round
slope_test:quarter_round_onetexture
slope_test:quarter_round_corner
slope_test:quarter_round_corner_onetexture
slope_test:slope_test_blob_onetexture
slope_test:slope_test_sphere
slope_test:slope_test_sphere_onetexture
slope_test:slope_test_cone_onetexture
slope_test:slope_long_fronthalf_onetexture
slope_test:slope_long_backhalf_onetexture
slope_test:icorner_half_tall_onetexture
slope_test:icorner_half_short_onetexture
slope_test:ocorner_short_onetexture
slope_test:corner_pyramid_short_1_onetexture
slope_test:corner_pyramid_short_2_onetexture
slope_test:corner_pyramid_tall_1_onetexture
slope_test:corner_pyramid_tall_2_onetexture
Spoiler
The versions without "_onetexture" in their names are designed to use a UV-mapped texture such that each face of the object is cut from a particular region of the texture file. Included in the textures/ directory you will find GIMP .xcf project files which should aid in understanding how these UV maps are laid out. Note that the numbers in those GIMP images are arbitrary and don't have any direct relation to the numbering of the faces or vertexes in the models - they're just there to help you compare a face in-game to the corresponding section of the texture file, and to aid in orienting the images.
Note that the UV maps are hardly what one would consider "ideal" layouts - there's a lot of wasted space in the textures, but this is deliberate. I wanted to leave everything "upright" and well-separated for the sake of understanding.
The colored borders in the GIMP images indicate where the UV map objects' edges are (roughly, in the case of diagonal lines). In the example files, you can see that I extended the wood textures out past the colored borders on all sides by one pixel, for all of the UV map objects. This is to account for Irrlicht rounding errors that would cause razor thin black lines between neighboring nodes (since the example image has a black background).
For the UV-mapped version of the cylinder (e.g. the one without "_onetexture"), I've used default_wood.png, tiled to 64 pixels, where the top-left 16x16 region goes to the top face, the 64x16 pixel strip below that is wrapped around (starting from the left-most point at -X and going around the front/-Z), and the next 16x16 pixel zone below that is for the bottom face. The rest of the image is set to black as it is unused. Like the slopes, there are 1-pixel "borders" zones around the active areas here to account for Irrlicht rounding errors.
Most other objects with per-face/per-side imagery generally have 48px textures to go with them, typically divided into 3x3 zones (which can be easily assessed by looking at the blender files). Not all objects in this mod have GIMP example images.
I had trouble getting the plain/one-texture sphere to texture properly. The mapped (not-onetexture) version of the sphere comes with an image of the Earth, thus making this object into a simple globe by default. The map image used here is Gall-Peters cylindrical projection.
Some of the more complex objects exhibit minor lighting/shadow glitches.
Included in the blends/ directory are the original .blend files.
When exporting a model from Blender to .obj format, it is important that you be in "Edit Mode" and that you've selected all faces of the model (or at least, that which you want to export), and that the following export options be set in the Export screen, or there will be wierd lighting glitches in your models when rendered in-game:
[X] Apply Modifiers
[X] Include Edges
[X] Write Normals
[X] Include UVs
[X] Objects as OBJ Objects
Got nodebox models you want to import into Blender for further editing? Try my bash script below to help out.
Spoiler
The best use of this script is to convert a model into a mesh that you can import into Blender, and then *move it aside* so that you can draw a new model from scratch next to the imported one, using the imported one as a guide. If however you want to load, convert, and then edit:
To use this code, save it out as something like nodebox-to-obj.sh, make it executable, then go to your mod code and save out your node_box={} definition to a separate file. You're really interested only in the coordinates table, e.g. this stuff:
Code: Select all
{-0.5, -0.5, -1.5, 0.5, -0.375, 0.5},
{-0.5, -0.375, -1.25, 0.5, -0.25, 0.5},
{-0.5, -0.25, -1, 0.5, -0.125, 0.5},
{-0.5, -0.125, -0.75, 0.5, 0, 0.5}
This script requires 'bc'.
Usage: nodebox-to-obj.sh <infile> <outfile.obj>
Script code license: WTFPL
Code: Select all
#!/bin/bash
infile=$1
outfile=$(basename -s ".obj" $2)
echo "# auto-converted from nodebox format" > /tmp/f1.txt
echo "# via script by Vanessa Ezekowitz" >> /tmp/f1.txt
echo "mtllib "$outfile".mtl" >> /tmp/f1.txt
echo "o converted_"$outfile >> /tmp/f1.txt
echo "usemtl none" > /tmp/f2.txt
echo "s off" >> /tmp/f2.txt
vc=1
nb=1
rm -f $outfile
while read n ; do
if [ -n "$n" ]; then
coords=$(echo $n|cut -f 2 -d "{"|cut -f 1 -d "}"|tr -d " "|grep -v "="|grep -v "\"")
if [ -n "$coords" ]; then
echo $coords
ifs_tmp=$IFS
IFS=,
read x1 y1 z1 x2 y2 z2 <<< "$coords"
IFS=$ifs_tmp
x1=$(echo "scale=5;0-("$x1")"|bc)
x2=$(echo "scale=5;0-("$x2")"|bc)
y1=$(echo "scale=5;"$y1|bc)
y2=$(echo "scale=5;"$y2|bc)
z1=$(echo "scale=5;"$z1|bc)
z2=$(echo "scale=5;"$z2|bc)
# Vertex list
echo "v $x1 $y1 $z1" >> /tmp/f1.txt
echo "v $x1 $y1 $z2" >> /tmp/f1.txt
echo "v $x1 $y2 $z2" >> /tmp/f1.txt
echo "v $x1 $y2 $z1" >> /tmp/f1.txt
echo "v $x2 $y1 $z1" >> /tmp/f1.txt
echo "v $x2 $y1 $z2" >> /tmp/f1.txt
echo "v $x2 $y2 $z2" >> /tmp/f1.txt
echo "v $x2 $y2 $z1" >> /tmp/f1.txt
# Mark this nodebox as a new group in the .obj file
echo "g nodebox-"$nb >> /tmp/f2.txt
# connect vertexes... the X- face
echo -n "f " >> /tmp/f2.txt
seq -s " " $vc $((vc+3)) >> /tmp/f2.txt
# the X+ face
echo -n "f " >> /tmp/f2.txt
seq -s " " $((vc+4)) $((vc+7)) >> /tmp/f2.txt
# the Z- face
echo "f $vc "$((vc+3))" "$((vc+7))" "$((vc+4)) >> /tmp/f2.txt
# the Z+ face
echo "f "$((vc+1))" "$((vc+2))" "$((vc+6))" "$((vc+5)) >> /tmp/f2.txt
# the Y- face
echo "f $vc "$((vc+1))" "$((vc+5))" "$((vc+4)) >> /tmp/f2.txt
# the Y+ face
echo "f "$((vc+3))" "$((vc+2))" "$((vc+6))" "$((vc+7)) >> /tmp/f2.txt
vc=$((vc+8))
nb=$((nb+1))
fi
fi
done < $infile
# combine the vertex list with the face defs and save the result
cat /tmp/f1.txt /tmp/f2.txt |grep -v "v "|grep -v "^$" > $outfile".obj"
# clean up
rm -f /tmp/f1.txt /tmp/f2.txt
echo -e "\nDone converting. The converted mesh is deliberately left as a set"
echo "of singular nodeboxes in the converted file. To use them, start Blender,"
echo "delete the default cube, and do 'File --> Import--> Wavefront (.obj)'."
echo -e "\nIf desired, adjust the positions of the nodeboxes."
echo -e "\nIf they're okay, go into 'Object' mode, select at least one nodebox,"
echo "then select all of them by pressing 'a' once or twice. Press ctrl-J to"
echo "join all of the selected nodeboxes together into a single object."
echo -e "\nThen, turn on the 'Properties' panel, click the 'Modifiers' tool,"
echo "select the 'Remesh' modifier and give it an Octree Depth of around 5 or"
echo "6 (use the lowest value you can that doesn't distort your mesh. Apply"
echo "the modifier."
echo -e "\nNow, go back into the Modifiers list, add the 'Decimate' modifier,"
echo "and set it to 'Planar' mode. Hit 'Apply'."
echo "Reposition your object on the X axis to put it back over the origin,"
echo "if necessary."
echo -e "\nFinally, go edit and UV-map your mesh like any normal object."
If you choose to do the clean-up steps the script tells you to do, expect to have to patch up small holes here and there and remove lots of excess faces on more complex models. This is due to Blender having to make guesses as to what parts of the mesh are really on the outside of the original model, where adjacent faces should come together, etc.
What is most helpful in avoiding these kinds of errors is avoiding overlapping nodeboxes in your models. Best to minimize overlap by shifting them around and/or resizing them in Blender before you use the Remesh modifier, or edit your nodebox table definitions before you import them into the initial .obj file. Another helpful tip is to separate your nodeboxes into small groups and move them apart, applying your clean-up steps to each group separately. For example, I made the books on Home Decor's 3d bookshelf four separate sets prior to clean-up, and the shelf itself was another set.
Ultimately, it's best to design your model from scratch, but failing that, convert it from nodeboxes with this script and then just clean up the model by hand.
Download: License: WTFPL for code and models, CC-By-SA for the textures.