When I run this code I get strange random stuff on the bottom row of the heightmap.
The png is completely black and 257x257 (the png doesn’t seem to be the problem)
If I take out the code to display the yugo model the heightmap suddenly appears as it should.
If I replace the yugo with another model from the internet I get a similar effect. (though not the same, the problem seems worse the more complex the model)
If I replace the yugo with one of the built in objects such as the panda the heightmap is normal.
I would love to get this to work so please tell me if you know if there is a workaround or if I need to start looking at the PGMM code?
I mentioned the problem on irc the other day as _mega but couldn’t define it well enough.
from direct.directbase import DirectStart from pandac.PandaModules import Filename,Point2, TextureStage from libpgmm import PGMM p1 = loader.loadModel("obj/yugo/yugo") p1.setScale(10.5,10.5,10.5) p1.setPos(100.0, 300.0, 0.0) p1.reparentTo(render) tmp=PGMM("myTerrain") tmp.setSz(100) tmp.setBlockSize(64) tmp.setFactor(100) tmp.setMinLevel(1) tmp.setHeightfield(Filename("map/out/out0x0.png")) tmp.generate() tmp.reparentTo(render) run()
oh yeah, the problem also disappears if I place the terrain loading before the model loading, but I can’t do that in the project I’m doing.