I have a .ply mesh which looks like a crumped piece of paper when I open it in Paint3D.
But when I load it in Panda3d, I only see white, the colour of the directional light I have (it is the absolute colour of whatever lighting I have and featureless).
The Panda model, in comparison, renders correctly, so it’s a problem with the mesh. This is my code.
#load stuff
import direct.directbase.DirectStart
from panda3d.core import *
x = loader.loadModel('panda')
x.reparentTo(render)
ply_file = "test.ply"
otha = loader.loadModel( convert_path_to_panda_path(ply_file))
otha.reparentTo(render)
#position things
otha.setPos(-330799.84375, -6257419.5, -59.53)
base.trackball.node().setPos(0, 560, 0)
#set the lighting
directionalLight = DirectionalLight('directionalLight')
directionalLight.setColor((1.0, 1.0, 1.0, 1))
directionalLightNP = render.attachNewNode(directionalLight)
directionalLightNP.setHpr(0, -60, 0)
otha.setLightOff()
otha.setLight(directionalLightNP)
x.setLightOff()
x.setLight(directionalLightNP)
I guess there’s something wrong with the mesh, but setting the object colour or using setTexGen(), or setTexture(), all do nothing. Any ideas?