本文整理汇总了Python中Code.RenderingPipeline.RenderingPipeline.removeLight方法的典型用法代码示例。如果您正苦于以下问题:Python RenderingPipeline.removeLight方法的具体用法?Python RenderingPipeline.removeLight怎么用?Python RenderingPipeline.removeLight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Code.RenderingPipeline.RenderingPipeline
的用法示例。
在下文中一共展示了RenderingPipeline.removeLight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Main
# 需要导入模块: from Code.RenderingPipeline import RenderingPipeline [as 别名]
# 或者: from Code.RenderingPipeline.RenderingPipeline import removeLight [as 别名]
#.........这里部分代码省略.........
# Show loading screen a bit
if True:
self.doMethodLater(0.5, self.loadScene, "Load Scene")
else:
self.loadScene()
def addDemoLight(self):
""" Spawns a new light at a random position with a random color """
randomRadius = 40.0
light = SpotLight()
spot = Vec3( (random()-0.5) * randomRadius, (random()-0.5) * randomRadius, 22)
# spot = self.cam.getPos(self.render)
light.setPos(spot)
light.lookAt(Vec3(spot.x,spot.y,0))
# print "pos is", spot,"look at",Vec3(spot.x,spot.y,0)
light.setColor(Vec3( random(), random(), random()) * 0.2)
# light.setColor(Vec3( 1.0, 0.5, 0.3) * 0.05)
light.setNearFar(1.0, 50)
light.setFov(140)
light.setIESProfile("SoftArrow")
# light.setIESProfileIndex(randint(0, 30))
light.setShadowMapResolution(2048)
# light.attachDebugNode(render)
light.setCastsShadows(True)
self.renderPipeline.addLight(light)
self.demoLights.append(light)
def removeDemoLight(self):
""" Removes the last added demo light if present """
if len(self.demoLights) > 0:
self.renderPipeline.removeLight(self.demoLights[-1])
del self.demoLights[-1]
def update(self, task):
""" Main update task """
for idx, light in enumerate(self.movingLights):
light.setZ(math.sin(idx +globalClock.getFrameTime())*2.0 + 10)
# light.setZ(5)
# import time
# time.sleep(0.2)
# globalClock.setMode(ClockObject.MLimited)
# globalClock.setFrameRate(10)
# Uncomment for party mode :-)
# self.removeDemoLight()
# self.addDemoLight()
return task.cont
def loadScene(self, task=None):
""" Starts loading the scene, this is done async """
# Load scene from disk
self.debug("Loading Scene '" + self.sceneSource + "'")
self.loader.loadModel(self.sceneSource, callback = self.onSceneLoaded)
def onSceneLoaded(self, scene):
""" Callback which gets called after the scene got loaded """