| ENTRY | DOWNLOAD | MANUAL | ONGOING | |
addLight(), setMaterial(), unsetMaterial()Define the shading of an element. Shading results from the general lighting situation and the kind of surface materials that are assigned to the various elements in the scene. The class reference elaborates on Lights and Materials.
<world>.addLight(lightobj)
<sprite>.addLight(lightobj) <tag>.addLight(lightobj)
<world>.setMaterial(materialobj)
<sprite>.setMaterial(materialobj) <tag>.setMaterial(materialobj)
<world>.unsetMaterial(materialobj)
<sprite>.unsetMaterial(materialobj) <tag>.unsetMaterial(materialobj)
Relevant examples: shading.py In Context
def onSetup(self):
whitematerial = MaterialWhite('matWhite')
globallight = LightBlue('blu',
pos=(-2.0, 5.0, 0.0, 1.0), dir=(0.0, -1.0, 0.0))
self.addLight(globallight)
sp = Sphere(self, 'sph1')
sp.setMaterial(whitematerial)
|
|
|
Initiated by Stephan Hechenberger Thanks to CADRE's 103 |
|