Hello all,
First, thanks to everyone who contributes to Panda3D. The marriage of my love for Python and interest in 3D modeling has found Panda3D to be everything I could ask for!
I like to try and solve these issues myself, but I cannot figure out what id going on, the code is so simple and I have not found anyone else having similar issues. I cannot find a reference to a method that might fix this.
I have a simple cube poly that I have UV-mapped a textured with a PNG file. I attempted to play with replacing textures at runtime using setTexture() with another PNG file. When I do this the new texture is overlaid atop the default texture, but is slightly transparent. It also does the same thing with a BMP texture as the overlay.
I have created lights, removed any alpha channels before exporting texture, double checked my materials in Blender, and I have recreated the poly from scratch. I cannot figure out what might be the issue.
import direct.directbase.DirectStart
from pandac.PandaModules import PointLight
from pandac.PandaModules import VBase4
x = loader.loadModel('cube')
x.setScale(3, 3, 3)
x.reparentTo(render)
x.setPos(0,0,-5)
light = PointLight('pointlight')
light.setColor(VBase4(1, 1, 1, 1))
light_node = render.attachNewNode(light)
light_node.setPos(10, 0, 0)
render.setLight(light_node)
base.trackball.node().setPos(0, 60, 0)
tex = loader.loadTexture('tex/wood_log_128.png')
x.setTexture(tex, 1)
run()
Anyone have some word of advice?