TerrainEditor plugin - Heightmap

I am new to jMonkey and so far I’m very impressed. I have been going through some of the tutorials and everything has been easy to understand and walkthrough but I do have a question concerning “Tutorial (10) - Hello Terrain”. The following text can be found under the “What is Texture Splatting?” section:

"The jMonkeyEngine SDK comes with a TerrainEditor plugin. Using the TerrainEditor plugin, you can sculpt the terrain with the mouse, and save the result as heightmap. You can paint textures on the terrain and the plugin saves the resulting splat textures as alphamap(s). The following paragraphs describe the manual process for you. You can choose to create the terrain by hand, or using the TerrainEditor plugin. "

  • How do you save a terrain as a heightmap?
  • If this isn’t possible are there any steps for using a heightmap to create a terrain in the SceneComposer?

Using JME 3.0 Stable. I have tried searching the forums but IE locks up on me during the search.

I don’t know anything about your real question but regarding the forum search: it’s pretty broken. However, google has indexed the site pretty well so as long as you put site:jonkeyengine.com as part of your search then you can search things on the forum and wiki through regular google.

1 Like

That tutorial might be worded a little to specifically by using the term “heightmap”. The editor saves the actual terrain, not a height map. So when you save your scene that has terrain in it, just load the scene and your terrain will be there.
The terrain editor allows you to generate terrain based on a heightmap image. Just right-click on a node in the scene composer or in the terrain editor, select ‘New Spatial… → Terrain…’ and import a height map in the wizard.

Thanks for the quick replies.

The use of the term “heightmap” in this context made me think it could be saved to an image file external of the .j3o file. Thanks for clarifying that.

Never even noticed the “Image Based” option in the Terrain Wizard. Thanks for pointing that out.

I am playing with the heightmap import a little and getting odd results. 2 of the sides of the terrain drop down as though there is a black line down 2 of the sides of the heightmap. I tried expanding and reducing the size of my heightmap image by 1 incase the image actually need to be 255 or 257 but it didn’t affect it.

Here are my steps:

Creating Heightmap (Simple island):

  • Open paint and set image size to 256 x 256
  • Fill the entire area with RGB(45, 45, 45)
  • Use the rounded square to make an interior space and filled it with RGB(51, 51, 51)

Creating Terrain

  • Open scene file
  • Create new terrain using the above file and default Terrain Wizard settings

Technically you want a 257x257 heightmap to cover every point in the height field of the terrain. Double check that your image is actually that size

That worked. I was certain I tried that but obviously not. Thanks again.

That happens. Glad it’s working now.