GeoMipTerrain totally Flat Issue

Hello,
i try to build a Terrain using GeoMipTerrain class and a heightmap - works as expected, except that the terrain is totally flat :slight_smile:

This is my code to generate the Terrain and attach it to the Scene Graph:

    // Create Terrain
    GeoMipTerrain *terrain = new GeoMipTerrain( "TestTerrain" );
    terrain->set_heightfield( string( "heightmap256.png" ));
    terrain->set_near( 40 );
    terrain->set_far( 100 );
    terrain->set_focal_point( m_Window->get_camera(0) );
    terrain->get_root().reparent_to( m_Window->get_render() );
    terrain->get_root().set_render_mode_wireframe();
    terrain->generate();

Any ideas what i’ve did wrong?

Thanks,
Egon

Hello.
You should post stuff like this in the “C++ coding using Panda3D”.
Lets see, your png’s name is “heightmap256”. Does that mean you used a 256x256 size? For heightmaps it should be power-of-two + 1. In this case 257x257.
And also try

terrain->set_sz( 100 ); 

or something

panda3d.org/manual/index.php/G … MipMapping

You mean this:

    terrain->get_root().set_sz( 100 );

Right

Hello,
thank you for your help - setting the z scale solved my problem. Sorry for having overseen this in the documentation which clearly solves the problem if you just follow the instructions :frowning:

Egon