0

I'm on to a very new 3D video Game project using Panda3D, and i try to understand the basics of terrain loading, that's why i tried the Panda3D tutorial ( https://www.panda3d.org/manual/index.php/Geometrical_MipMapping), telling to type this in Python :

terrain = GeoMipTerrain("mySimpleTerrain")
terrain.setHeightfield("yourHeightField.png")
#terrain.setBruteforce(True)
terrain.getRoot().reparentTo(render)
terrain.generate()

which i did, though i have a :

Name Error : Name " GeoMipTerrain " is not defined 

It is said in the Panda3D manual that GeoMipMap is included in Panda3D since 1.5.1 so i should be juste fine, they just don't say if we must import a specific module or what. That's why i tried to look what module or thing was necessary to load before requesting such a command, but i found no result, that's why i require your help.

Arthur Dy
  • 1
  • 2

2 Answers2

1

You need to import the class before you can use it in Python:

from panda3d.core import GeoMipTerrain

You can also choose to import everything under the panda3d.core namespace instead of importing classes individually:

from panda3d.core import *

It is also available under pandac.PandaModules, however, this is deprecated, and should not be used.

rdb
  • 1,488
  • 1
  • 14
  • 24
0

It's ok i found how on someone's code, it's :

from pandac.PandaModules import GeoMipTerrain
Arthur Dy
  • 1
  • 2