Austria
Joined: Oct 16, 2025
Post Count: 19
Status:
Offline
Re: Terrain Generator plug-in
I don't know if this behavior is intentional, or what sense it makes, but... When I create a level with a space for terrain around my house, e.g., with a depth of -200, and then activate the generator, the generator's preview window always shows the terrain mesh to be edited only at level 0, without the actual room depth. As a result, the ratio of terrain to house doesn't match, and terraforming can only be done by feel and in "blind flight." Only after completing the generator does the terrain appear at the correct level. This makes it practically impossible to orient the terrain to the house. Am I doing something wrong?
Netherlands
Joined: Apr 8, 2022
Post Count: 1807
Status:
Offline
Re: Terrain Generator plug-in
I don't know if this behavior is intentional, or what sense it makes, but... When I create a level with a space for terrain around my house, e.g., with a depth of -200, and then activate the generator, the generator's preview window always shows the terrain mesh to be edited only at level 0, without the actual room depth. As a result, the ratio of terrain to house doesn't match, and terraforming can only be done by feel and in "blind flight." Only after completing the generator does the terrain appear at the correct level. This makes it practically impossible to orient the terrain to the house. Am I doing something wrong?
That is the default (and fixed) behavior. The floor thickness is not a data point for the generator, only the room circumference. The generator creates 'depth', i.e. raises selected points of the terrain grid. At the bottom right you can select to display a wire frame of the house.
The fact that the generator always uses level 0 was discussed some time ago, until then I didn't even realize that was the default behavior and I experimented a lot! You state that the ratio of terrain to house doesn't match but I assume you mean the (start-)height of the terrain that you want at a level with elevation -200. I depends on what you want to achieve but since you want the terrain object at a level -200 I assume you want parts of the terrain below the 0 elevation. There are tricks but it depends on what what result you want. Explain it a little more and I can give better advise.
---------------------------------------- Dodecagon.nl 1300+ 3D models, manuals, and projects
Austria
Joined: Oct 16, 2025
Post Count: 19
Status:
Offline
Re: Terrain Generator plug-in
I'll try to explain this and hope it comes across reasonably clearly: I have a house that's built on a slope (Level 0). The house has a platform in the rear (north) section that's used as a parking area and also serves as the flat roof for the back part of the house (one level above... about 2.8 m). From there, an outdoor staircase leads to the entrance area (Level 0). In front of the house, there's a terrace spanning the entire west-east length (Level 0); this flows into a lower terrace via a staircase (Level -1, about 1.5 m lower). This lower terrace is bordered by a stone wall that stabilizes the rest of the slope, since the ground level drops about 6 m afterward.That means the terrain ranges from about -700 cm to about +280 cm.I'd now like to model the surrounding slope terrainâfrom the -700 up to the first terrace at -150, to the house level, the upper terrace at Level 0, the parking platform at +280, and beyond that (the mountainside)âas well as the surrounding slope structures. To do that, I'd need to build the terrain from the bottom up, and in the preview window, I'd have to be able to see the existing house/terrace construction so I can properly "mold" the terrain to fit against the structures. If I can't see the terrain I'm building in relation to the house while I'm doing it, it just won't work.If the terrain always starts at Level 0, I'd have to begin with the deepest point as Level 0, which would be a massive undertaking given the already constructed house and its internal levels. So, I hope that's somehow understandable...
Netherlands
Joined: Apr 8, 2022
Post Count: 1807
Status:
Offline
Re: Terrain Generator plug-in
That's quite a complex set of elevations to manage.
First a little lesson on how terrains are stored. Terrain elevations are stored in the Home.xml file in your .sh3d project file (The .sh3d file is a zip file). The generator adds a line for each point of the terrain grid in the section for the room it belongs to. It looks something like this:
It is not uncommon that the number of lines for a terrain grows to tens of thousands of lines which makes the file size of your project a lot bigger, really a lot bigger. Since you only need the room object(s) to generate the terrain object(s) it is common sense to use a copy of your project just for generating the terrain objects. You can then copy the generated terrain object to your original project without having the burden of the huge room object stored in the project file. You can always use the copied project if you want to change the terrain. When you select a room that already has terrain points the generator will read them and display the terrain. This makes is easy to edit an existing terrain. It's just that those thousands of lines are never used again, only by the terrain generator. The copy project also allows you to use additional objects for reference as you will see next.
The real problem is that the terrain generator shows both the room and the house on the same level. (Discussed before here .)As you found out that makes it difficult to relate the terrain elevations to the elevation of the house. What I do in such cases is to copy only the outside walls of the house to the copy 'terrain project'. Assume the shown terrain in the generator to start at the bottom, no matter what elevation that is. Calculate the height from the bottom of the lowest level to the bottom of your house level, in your case 700 if I read it correct. Set the height of the walls to that number. Select the walls and export them to 'walls.obj'. Import the walls.obj and set its height to the original height of your house walls and elevate it to the top of the existing walls (place it on top of those walls). This construction will show the house outline in the terrain generator by displaying the walls to the bottom of the house and the "house" itself as the walls.obj model on top of it. Of course you can only use the elevated model but the walls give you an extra reference. Since you now have a reference to the elevation and outline of your house it's much easier to create the terrain. And of course you can use multiple object for reference. Just elevate them to the correct position in relation to the room.
You can use multiple rooms for your terrain and of course they will all show on the same level. When you select multiple rooms and start the Terrain Generator it will show all selected rooms and you can edit them at the same time. This is useful for several reasons: smaller rooms are faster to handle in the generator and you can have separate textures for the terrain parts. The connecting rooms will elevate at the same time to ensure a prefect flow from one to the other. Although the generator will generate a single object for all selected rooms the data is stored per room. That allows you to delete the combined terrain object, select a single room and use that to generate a terrain only for that room. Repeat for all rooms and you have a terrain objects that you can give its own texture.
Now with multiple rooms you can do some really neat things! First read this post . It's an easy way to create rivers or paths since you can set a different texture for each room. it allows you to create a path or river that goes along with the flow of the terrain. Since then I found that there's an easier way to create a room-between-rooms: make sure the walls are enclosed and don't click inside the walls to create a room but click ON the wall. It will create a room using the outside outline of the walls instead of inside the walls. That will nicely fit against the room(s) you create on the outside of the walls.
If the terrain always starts at Level 0, I'd have to begin with the deepest point as Level 0, which would be a massive undertaking given the already constructed house and its internal levels.
There is a hack to easily edit the elevations of all levels but you will have to edit the Home.xml file in the .sh3d project file. When you open the Home.xml file with an editor it shows the levels like this:
As you can see the elevation is listed as "elevation='0.0'" in each level line. It's much easier to edit the elevation numbers this way if you have a lot of levels. Of course make sure you have a backup copy of your project before you try this!
---------------------------------------- Dodecagon.nl 1300+ 3D models, manuals, and projects
Joined: Mar 23, 2020
Post Count: 122
Status:
Offline
Re: Terrain Generator plug-in
Hello All This major update version 1.2.2 brings powerful new procedural generation, image-mapping capabilities, and refined sculpting tools to give you ultimate control over your 3D terrains.
Advanced Height Map Support
Import Height Maps :You can now instantly generate complex landscapes by importing standard height map images (BMP, TIF, and TIFF formats supported).
Precise Altitude Control: When importing a height map, a new prompt allows you to define the exact real-world minimum (black pixels) and maximum (white pixels) heights in centimeters.
Export Your Terrains: You can now export your customized Sweet Home 3D terrain back out as a high-resolution BMP height map for use in other software.
Procedural Generation Tools
Random Height Maps: Instantly generate organic, natural-looking hills and valleys with a single click using the new "Random Height Map" button.
Tileable Terrains: Building massive environments? Use the "Tileable Random Height Map" feature to create seamless terrain blocks that perfectly connect edge-to-edge.
New Sculpting & Shaping Utilities
Square Modification Mode: Alongside the existing radial and row tools, you can now check the "Square modification" box to sculpt and elevate terrain in rigid, square block formations.
Smooth Tool: Instantly soften jagged peaks and rough transitions with the dedicated "Smooth" button.
Invert Tool: Flip your terrain upside down! The new "Invert" button instantly turns mountains into craters and valleys into hills.
"Edges = 0" Feature: A highly requested feature! Toggle the "Edges = 0" checkbox to automatically sink and smooth the outer boundaries of your terrain, preventing ugly mesh outlines and Z-fighting in your 3D views.
Enhanced Usability & Control
Customizable Grid Divisions: You are no longer locked to the default mesh resolution. Use the new "Grid Divisions" spinner to scale your terrain's detail anywhere from a low-poly 4x4 up to a highly detailed 2048x2048 grid.
Smart Memory: The plugin now remembers your favorite settings between sessions! It will automatically recall your last-used height map directory, grid division settings, and preferred height values.
Netherlands
Joined: Apr 8, 2022
Post Count: 1807
Status:
Offline
Re: Terrain Generator plug-in
Just at the right time: I'm still working on the terrain surrounding my ShoppingMall. I create a new one every once in a while but it's never what I really envision.
I LOVE the square modification option! A single point elevation always creates sharp spikes, even with a larges radius. This new option creates a flatter elevation over the selected radius. Combined with smoothing it's much easier to create large waves that look more natural.
Over time I will probably use most of the new functions. Thank you!
(You forgot to update the version number, the current already was at 1.2.2.)
---------------------------------------- Dodecagon.nl 1300+ 3D models, manuals, and projects
Netherlands
Joined: Apr 8, 2022
Post Count: 1807
Status:
Offline
Re: Terrain Generator plug-in
Bug: terrainGridSize is written with the wrong value.
Background (Using the previous version 1.2.2) I have a terrain that spans over 232500 square meter with 970000+ elevation points and the original gridsize 50. This is spread over 25 rooms, some with very few room-points, and curved rooms with many room-points. Initially I increase the elevation of all rooms using a very large radius to force generation of the elevation points in the Home.xml file. I use a little C# code to rewrite all elevation values to 50. This creates a flat terrain with a height of 50. The terrains are placed on a level -50 making the top of the terrain flat with the 0 level. This allows little dips in the terrain below 0 which is otherwise not possible. Of course all terrains are generated as if on level 0 so after each generation I have to move the generated terrains to the -50 level.
Testing with version 1.4.2 I changed the gridsize to 25 to see if a smaller gridsize would result in the same look but with a smaller file size and less elevation points. All terrainGridSizes got different values, none 25. There was no way to reset this, only with manual edits to fix the gridsize values but the damage was done. It resulted in weird surfaces with random spikes and dips back to 0, even with all elevation points set to 50. It ruined my project so I had to retrieve a backup file to try again.
Wishlist option: Set an initial elevation level for all elevation points. That way it is easier for users to create ponds, lakes, and rivers. It's what I do with my C# code but having the option in the TerrainGenerator is obviously much easier.
Now a brain breaker: multiple different rooms in a project. Different rooms are generated with different grid sizes. Then multiple of those rooms are selected to generate a new terrain. What happens with the gridsizes? (By-the-way, that was not what I did in my project to cause the wrong grid sizes.)
---------------------------------------- Dodecagon.nl 1300+ 3D models, manuals, and projects
Joined: Mar 23, 2020
Post Count: 122
Status:
Offline
Re: Terrain Generator plug-in
@Keet So sorry i can't understand the issue ! Do you have files to share so I can test, that is if I know what to test ;-)
If you import a height map and set min -100 e.g. and max 100, it works
---------------------------------------- Windows 64bit | Intel i7 | 8GB Ram | SH3D 7.5 + Plugins
Netherlands
Joined: Apr 8, 2022
Post Count: 1807
Status:
Offline
Re: Terrain Generator plug-in
Draw a simple room. Start TerrainGenerator and set the gridsize to 25. Elevate a few areas and generate the terrain object.
As long as you don't change the gridsize you can re-open the terrain and change it to generate a new terrain. That's good. Checking the Home.xml file revealed that the gridsize was stored as 776 where I expected 25.
Now start the TerrainGenerator again with the same room and change the gridsize to 50. You get a lot of weird spikes and the gridsize value in the Home.xml file changed to 338. Re-testing this I found that if you reset the gridsize back to the 25 I started with, then the terrain is restored to its correct form. But I wanted it regenerated with a gridsize of 50...
So I did some hacking: I manually edited the Home.xml file and set the gridsize to 25. The value that was set in the TerrainGenerator. Opening the project file is no problem. Starting the TerrainGenerator seemed to hang but eventually it came up with the correct terrain. And the gridsize value was again set to 776
What is it with the weird gridsize value in the Home.xml file? I would expect that reopening the room in the TerrainGenerator would do something weird with such a strange value but it had some difficulty with the correct value 25.
Obviously something doesn't work as it is supposed to do. Thoughts: After you changed the gridsize lock it to that room, don't allow it to be changed again, or the better option, recalculate the room for the new gridsize. That is some difficult math because it adds or removes a lot of points. Obviously this can give weird results if you switch the gridsize from (for example) 15 to 99 or 88 to 17. Recalculation might be necessary if rooms with different gridsizes are selected. You would probably need to recalculate all rooms to the largest gridsize of the selected rooms.
The easiest solution is to set a gridsize for the whole project, not for individual rooms, and once a terrain is generated don't allow it to be changed. Any change would require all elevation points to be removed and to start over. A gridsize for the whole project ensures that combined rooms all use the same gridsize. Most users will leave it at 50 anyway.
by-the-way: I didn't use the height-map options. For my current project I must see the home wire frame to create the terrain. But I'm going to give it a try to see how it works over my 25 rooms.
In short: changing the gridsize after the first generation breaks your terrain.
---------------------------------------- Dodecagon.nl 1300+ 3D models, manuals, and projects