Beginner question regarding terrain!

"Here is how you create the heightmap object in your jME code:

  1. Create a Texture object.
  2. Load your prepared heightmap image into the texture object.
  3. Create an AbstractHeightMap object from an ImageBasedHeightMap.
    It requires an image from a JME Texture.
  4. Load the heightmap."

im trying to build a simple level/stage for a game sort of like smash bros but is obv going to be very bare-bones for a while. after reading this excerpt from the “Hello Terrain” documentation, I was stumped by “create texture object” and returned to “Hello Asset”, where the loading textures section first talks about creating a material. i word searched the page for “texture object” and nothing came up. i was also hoping to know if i could translate the heightmap terrain such that the “peak” surface area at 255 is able to brought level with where the characters will go at y=0 in the scene graph. if something in my wording makes it seem like im uninformed or confused it is likely because i am. so i wouldn’t be offended by any corrections towards my understanding of these systems. thanks!
128xstagedemo

There are a variety of terrain tests you can look at here:

i will be honest, im not exactly sure what to do with this information

I was stumped by “create texture object”

AbstractHeightMap heightmap = null;
Texture heightMapImage = assetManager.loadTexture(
        "Textures/Terrain/splat/mountains512.png");
heightmap = new ImageBasedHeightMap(heightMapImage.getImage());
heightmap.load();

Where heightMapImage is the Texture object in question.

thank you, trying it now.

Those are all working terrain examples. You could look through them and find one that is similar to what you are trying to do and then figure out how/why it works… and apply that back to your own code.

Caveat: I have not looked at any of those specifically and I do not use JME terrain… but whenever I have to learn something new in JME, the first place I go is the examples.

2 Likes