예제 #1
0
    def createLighting(self):
        light = DirectionalLight("light")
        light.setColor(VBase4(0.2, 0.2, 0.2, 1))

        np = self.render.attachNewNode(light)
        np.setPos(10, -10, 20)
        np.lookAt(0, 0, 0)

        self.render.setLight(np)

        light = AmbientLight("ambient")
        light.setColor(VBase4(0.4, 0.4, 0.4, 1))

        np = self.render.attachNewNode(light)

        self.render.setLight(np)
예제 #2
0
    def createLighting(self):
        light = DirectionalLight('light')
        light.set_color(VBase4(0.2, 0.2, 0.2, 1))

        np = self.render.attach_new_node(light)
        np.setPos(0, -200, 0)
        np.lookAt(0, 0, 0)

        self.render.set_light(np)

        light = AmbientLight('ambient')
        light.set_color(VBase4(0.4, 0.4, 0.4, 1))

        np = self.render.attachNewNode(light)

        self.render.setLight(np)
예제 #3
0
    def createLighting(self):
        light = DirectionalLight("light")
        light.setColor(VBase4(0.4, 0.4, 0.4, 1))
        light.setShadowCaster(True)
        light.getLens().setNearFar(100.0, 400.0)
        light.getLens().setFilmSize(400, 400)
        # light.showFrustum()

        np = self.render.attachNewNode(light)
        np.setPos(100, -100, 200)
        np.lookAt(0, 0, -100)

        self.render.setLight(np)

        light = AmbientLight("ambient")
        light.setColor(VBase4(0.2, 0.2, 0.2, 1))

        np = self.render.attachNewNode(light)

        self.render.setLight(np)