Hello, I have the following problem:
setColor(r, g, b, a)
doesn’t work as it is described in the following instruction:
I made the following observations:
-
Parameter “
a
” doesn’t produce any change. So fora=0.0
anda=1.0
I get the same output. -
setColor(r, g, b, a)
basically works the same way assetColorScale(r, g, b, a)
should work (setColor()
does not override the model color, instead, it adds an additional layer on top of it). -
In
setColorScale(r, g, b, a)
parameter “a” doesn’t seem to have any influence on the output eather.
So, as an example I have tried to load the panda-model.egg
using several different options:
self.actor.setColor(0, 1, 0, 1.0)
self.actor.setColor(0, 1, 0, 0.5)
self.actor.setColor(0, 1, 0, 0.0)
self.actor.setColorScale(0, 1, 0, 1.0)
self.actor.setColorScale(0, 1, 0, 0.5)
self.actor.setColorScale(0, 1, 0, 0.0)
and got the same output in all those cases:
Does anyone has an idea why is it so? Is it a bug, or am I doing something completely wrong? Thanks in advance!
Here is a sample code I used to test those options:
from direct.showbase.ShowBase import ShowBase
from direct.actor.Actor import Actor
class Environment(ShowBase):
def __init__(self):
ShowBase.__init__(self)
self.cam.setY(-3000)
self.cam.setZ(200)
self.actor = Actor("models/panda-model")
self.actor.reparentTo(self.render)
self.actor.setPos(0, 50, 0)
self.actor.setColor(0, 1, 0, 1.0)
#self.actor.setColor(0, 1, 0, 0.5)
#self.actor.setColor(0, 1, 0, 0.0)
#self.actor.setColorScale(0, 1, 0, 1.0)
#self.actor.setColorScale(0, 1, 0, 0.5)
#self.actor.setColorScale(0, 1, 0, 0.0)
env = Environment()
env.run()