当前位置: 首页>>代码示例>>Python>>正文


Python DirectionalLight.set_color方法代码示例

本文整理汇总了Python中panda3d.core.DirectionalLight.set_color方法的典型用法代码示例。如果您正苦于以下问题:Python DirectionalLight.set_color方法的具体用法?Python DirectionalLight.set_color怎么用?Python DirectionalLight.set_color使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在panda3d.core.DirectionalLight的用法示例。


在下文中一共展示了DirectionalLight.set_color方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: add_celestial

# 需要导入模块: from panda3d.core import DirectionalLight [as 别名]
# 或者: from panda3d.core.DirectionalLight import set_color [as 别名]
 def add_celestial(self, azimuth, elevation, color, intensity, radius):
     location = Vec3(to_cartesian(azimuth, elevation, 1000.0 * 255.0 / 256.0))
     if intensity:
         dlight = DirectionalLight('celestial')
         dlight.set_color((color[0] * intensity, color[1] * intensity, color[2] * intensity, 1.0))
         node = self.node.attach_new_node(dlight)
         node.look_at(*(location * -1))
         self.node.set_light(node)
开发者ID:dcwatson,项目名称:pavara,代码行数:10,代码来源:world.py

示例2: createLighting

# 需要导入模块: from panda3d.core import DirectionalLight [as 别名]
# 或者: from panda3d.core.DirectionalLight import set_color [as 别名]
    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)
开发者ID:BarkingMouseStudio,项目名称:python-experiments,代码行数:18,代码来源:app.py

示例3: add_celestial

# 需要导入模块: from panda3d.core import DirectionalLight [as 别名]
# 或者: from panda3d.core.DirectionalLight import set_color [as 别名]
 def add_celestial(self, azimuth, elevation, color, intensity, radius, visible):
     """
     Adds a celestial light source to the scene. If it is a visible celestial, also add a sphere model.
     """
     if not self.camera:
         return
     location = Vec3(to_cartesian(azimuth, elevation, 1000.0 * 255.0 / 256.0))
     if intensity:
         dlight = DirectionalLight('celestial')
         dlight.set_color((color[0] * intensity, color[1] * intensity,
             color[2] * intensity, 1.0))
         node = self.scene.attach_new_node(dlight)
         node.look_at(*(location * -1))
         self.scene.set_light(node)
     if visible:
         if radius <= 2.0:
             samples = 6
         elif radius >= 36.0:
             samples = 40
         else:
             samples = int(round(((1.5 * radius) * (2 / 3.0)) + 3.75))
         celestial = Dome(radius * 1.5, samples, 2, color, 0, location,
             ((-(math.degrees(azimuth))), 90 + math.degrees(elevation), 0))
         self.celestials.attach(celestial)
开发者ID:airvoss,项目名称:pavara,代码行数:26,代码来源:world.py


注:本文中的panda3d.core.DirectionalLight.set_color方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。