本文整理汇总了Python中panda3d.core.DirectionalLight.getLens方法的典型用法代码示例。如果您正苦于以下问题:Python DirectionalLight.getLens方法的具体用法?Python DirectionalLight.getLens怎么用?Python DirectionalLight.getLens使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类panda3d.core.DirectionalLight
的用法示例。
在下文中一共展示了DirectionalLight.getLens方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createLighting
# 需要导入模块: from panda3d.core import DirectionalLight [as 别名]
# 或者: from panda3d.core.DirectionalLight import getLens [as 别名]
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)
示例2: createLights
# 需要导入模块: from panda3d.core import DirectionalLight [as 别名]
# 或者: from panda3d.core.DirectionalLight import getLens [as 别名]
def createLights(self):
"""Create an ambient light and a spotlight for shadows"""
self.render.clearLight()
alight = AmbientLight("ambientLight")
alight.setColor(Vec4(0.7, 0.7, 0.7, 1))
alightNP = self.worldRender.attachNewNode(alight)
self.worldRender.setLight(alightNP)
# Create a directional light for shadows
dlight = DirectionalLight("dLight")
dlight.setColor(Vec4(0.6, 0.6, 0.6, 1))
dlight.setShadowCaster(True, 1024, 1024)
dlight.getLens().setNearFar(1, 15)
dlight.getLens().setFilmSize(128, 128)
dlightNP = self.worldRender.attachNewNode(dlight)
dlightNP.setPos(0, 0, 10)
dlightNP.lookAt(0, 0, 0)
self.worldRender.setLight(dlightNP)