HeightfieldTesselator texturing problems [SOLVED]

When trying to put a texture on a heightfieldtesselator-generated terrain i just get the main color but no details…

code that doesnt work like i want it to:

from pandac.PandaModules import HeightfieldTesselator, Filename
import direct.directbase.DirectStart
terrain = HeightfieldTesselator("myDynamicTerrain")
terrain.setHeightfield(Filename("res/desert/desertmap_heightfield.png"))
tex=loader.loadTexture('res/desert/desertmap_texture.png')

root = terrain.generate()
root.setTexture(tex)
root.reparentTo(render)

run()

code which works with geomip:

from pandac.PandaModules import Filename
from pandac.PandaModules import GeoMipTerrain
import direct.directbase.DirectStart

terrain = GeoMipTerrain("myDynamicTerrain")
terrain.setHeightfield(Filename("res/desert/desertmap_heightfieldhd.png"))
tex=loader.loadTexture('res/desert/desertmap_texture.png')
terrain.setBruteforce(True)

root=terrain.getRoot()
terrain.generate()
root.setTexture(tex)
root.flattenStrong()
root.setSz(255)
root.reparentTo(render)

run()

What am I doing wrong?

The HeightfieldTesselator does not support generating texture coordinates, I think. This page may be helpful:
panda3d.org/manual/index.php/A … oordinates

Now it works for me. Thanks alot.

My new code:

from pandac.PandaModules import HeightfieldTesselator, Filename, TextureStage, TexGenAttrib

import direct.directbase.DirectStart
# Set up the GeoMipTerrain
terrain = HeightfieldTesselator("myDynamicTerrain")
terrain.setHeightfield(Filename("../res/desert/desertmap_heightfield.png"))
tex = loader.loadTexture('../res/desert/desertmap_texture.png')

root = terrain.generate()
root.setTexGen(TextureStage.getDefault(), TexGenAttrib.MWorldPosition)
root.setTexScale(TextureStage.getDefault(), 1.0/1024, 1.0/1024) #my heightfield is 1024x1024
root.setTexture(tex)
root.reparentTo(render)

run()