Author Topic: Flatten certain areas  (Read 6754 times)

0 Members and 1 Guest are viewing this topic.

posfan12

  • World Machine Veteran
  • ***
  • Posts: 48
    • View Profile
Flatten certain areas
« on: August 14, 2015, 04:29:32 AM »
If the slope of a heightmap is less than a certain amount, I would like to completely flatten the terrain, creating a sort of terrace but leaving the rest of the terrain intact. Is this possible in WM?

ilbiffi

  • World Machine Guru
  • ****
  • Posts: 66
    • View Profile
Re: Flatten certain areas
« Reply #1 on: August 14, 2015, 01:08:23 PM »
You've got the terrace filter, otherwise you have to use the slope selector and try one of the available filters.

posfan12

  • World Machine Veteran
  • ***
  • Posts: 48
    • View Profile
Re: Flatten certain areas
« Reply #2 on: August 14, 2015, 10:39:45 PM »
The flat surfaces need to be absolutely flat, though. Can WM do that?

Could you show me exactly what I need to do?
« Last Edit: August 14, 2015, 11:43:57 PM by posfan12 »

Maximum-Dev

  • World Machine Guru
  • ****
  • Posts: 82
    • View Profile
Re: Flatten certain areas
« Reply #3 on: August 15, 2015, 02:24:20 AM »
Select the slopes you dont want to be flattened. Invert it, Combine with a flat land and use the inverted slope selector as a mask for the combiner. You can also limit the height in which this effect happens by using a height selector.

posfan12

  • World Machine Veteran
  • ***
  • Posts: 48
    • View Profile
Re: Flatten certain areas
« Reply #4 on: August 15, 2015, 06:40:05 AM »
I will try that. But how do I round the heights of the affected areas to the nearest 24 units? The unaffected areas should not be rounded.

posfan12

  • World Machine Veteran
  • ***
  • Posts: 48
    • View Profile
Re: Flatten certain areas
« Reply #5 on: August 18, 2015, 11:41:54 AM »
Could someone show me the exact steps to follow with an example? I am very new to WM.

[edit]

I would be willing to pay $50 to get a working example.

Remnant

  • Author
  • World Machine Guru
  • *****
  • Posts: 2311
    • View Profile
    • http://www.world-machine.com/
Re: Flatten certain areas
« Reply #6 on: August 18, 2015, 01:57:50 PM »
I think you might need to more fully describe what you're trying to achieve, because the problem is not fully defined right now -- a big part of figuring out how to achieve a procedural goal is to make sure you've actually fully defined what you want out of the solution.

For example, it would be easy to make a terrain where the heights are rounded to some nearest value using the terrace device, then Choose between that and the original terrain, placing your terraced region only where the slopes are gentle.

But this might not be what you want -- within each gentle region, you'd still have jumps of elevation between one terrace level and the next. I suspect what you really want is to have flattened locations that are at a constant height, with regular terrain around them.

Doing this automatically is hard. if this is the goal, essentially you're looking for an automatic region segmenting and processing tool. There's plenty of edge cases to figure out in this case too -- if you have a very large low-slope area, the average value of the region isn't likely to be anything close to reasonable over the majority of it's area. In any case, there isn't anything too much like this currently in WM. The closest I can think of is using the Height-matching Chooser, but the regions produced will be smooth but not flat, as I've shown in the image attached here.

It might be helpful to tell us what you want this for -- if you're creating a map for a game, for example, you might be best off simply using the Layout Generator to draw those regions by hand; you would be able to set the elevation of the regions exactly to what you want in that case.
-- Stephen Schmitt
- Creator of World Machine

posfan12

  • World Machine Veteran
  • ***
  • Posts: 48
    • View Profile
Re: Flatten certain areas
« Reply #7 on: August 19, 2015, 05:01:21 PM »
I think you might need to more fully describe what you're trying to achieve, because the problem is not fully defined right now -- a big part of figuring out how to achieve a procedural goal is to make sure you've actually fully defined what you want out of the solution.

I'm trying to create some terrain for a Lego town model I'm helping out with.



For example, it would be easy to make a terrain where the heights are rounded to some nearest value using the terrace device, then Choose between that and the original terrain, placing your terraced region only where the slopes are gentle.

But this might not be what you want -- within each gentle region, you'd still have jumps of elevation between one terrace level and the next. I suspect what you really want is to have flattened locations that are at a constant height, with regular terrain around them.

The jumps are okay. They will eventually be hidden under Lego which are already blocky to begin with.

There's plenty of edge cases to figure out in this case too -- if you have a very large low-slope area, the average value of the region isn't likely to be anything close to reasonable over the majority of it's area.

I don't want large regions with identical elevation necessarily. It's okay if the height varies as long as it's level.

It might be helpful to tell us what you want this for -- if you're creating a map for a game, for example, you might be best off simply using the Layout Generator to draw those regions by hand; you would be able to set the elevation of the regions exactly to what you want in that case.

I ultimately want the flat areas to have the little connector studs placed on them. (I can do this later using a procedural POV-Ray script.) But I don't want to sacrifice the smoothness of the terrain in other areas I'm unlikely to build on. Otherwise I would just convert the model directly into Lego bricks using another converter that performs this task.

Could you post the WM file for the image you attached? I am having trouble understanding what is going on in it.
« Last Edit: August 21, 2015, 03:51:13 PM by posfan12 »

posfan12

  • World Machine Veteran
  • ***
  • Posts: 48
    • View Profile
Re: Flatten certain areas
« Reply #8 on: August 19, 2015, 05:26:44 PM »
How about this:

What if I were to (auto) select all regions with a low slope and set their height to zero. Then export that mesh as Model A.

Next, perform the inverse operation on the original height map and export it as Model B. I can then use a mesh-to-brick converter on Model B to output the square bricks I need.

Will that work?

Remnant

  • Author
  • World Machine Guru
  • *****
  • Posts: 2311
    • View Profile
    • http://www.world-machine.com/
Re: Flatten certain areas
« Reply #9 on: August 19, 2015, 05:49:35 PM »
OK, The good news is that I think what you want is actually the easier scenario.

Take a look at the world attached here and see if it does what you want. If you need the flat areas to have a finer number of flat terraces, simply increase the number of terraces.
-- Stephen Schmitt
- Creator of World Machine

posfan12

  • World Machine Veteran
  • ***
  • Posts: 48
    • View Profile
Re: Flatten certain areas
« Reply #10 on: August 19, 2015, 06:39:49 PM »
Thanks! A couple of questions:

1. I need the terraces at exact heights, for instance every 24 units. (The actual value depends on the final XZ dimensions of the map.) How do you do this?
2. What's the best method to tweak/polish the final mesh? There are a few areas that could be raised or lowered a bit. Is there a smudge tool?

[edit]

3. And what do I do about my other suggestion in Reply #8?
« Last Edit: August 20, 2015, 01:30:54 PM by posfan12 »

posfan12

  • World Machine Veteran
  • ***
  • Posts: 48
    • View Profile
Re: Flatten certain areas
« Reply #11 on: August 21, 2015, 03:35:19 PM »
I tried a different tack and combined the WM terrain with Lego parts. The result is not so great however.






I'm also still not sure what "Number of Terraces" means. Is it the number of terraces per 1 unit of height? What is the unit of measure?
« Last Edit: August 21, 2015, 04:18:52 PM by posfan12 »

ilbiffi

  • World Machine Guru
  • ****
  • Posts: 66
    • View Profile
Re: Flatten certain areas
« Reply #12 on: August 21, 2015, 11:51:20 PM »
You have to experiment a bit more, I don't have the program on this pc, but I can tell you can set the units of measure in the preferences, it's either meters or wm units.
You can also set how much tall will be the highest object in your project, the default is around 2200 meters if I'm right.
Once you know this then if you make a mountain at the highest height you can set the number of terraces according to the desired height of each step. So let's say you want to use wm units as the unit of measure, then you know that if a mountain is 1000 units tall, and you apply a terrace with 10 steps then each step will be 100 units tall.
Of course you can apply the terrace to only a certain portion of your terrain, for example by using the height selector you can decide that the terrace will be applied from unit 238 to unit 528, in that case if your terrace still has 10 steps each step will be 29 units tall.

posfan12

  • World Machine Veteran
  • ***
  • Posts: 48
    • View Profile
Re: Flatten certain areas
« Reply #13 on: August 22, 2015, 09:00:59 PM »
Thanks for the explanation. Switching to WM units made everything make more sense.