本文整理汇总了Python中panda3d.core.PointLight.showFrustum方法的典型用法代码示例。如果您正苦于以下问题:Python PointLight.showFrustum方法的具体用法?Python PointLight.showFrustum怎么用?Python PointLight.showFrustum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类panda3d.core.PointLight
的用法示例。
在下文中一共展示了PointLight.showFrustum方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: initLights
# 需要导入模块: from panda3d.core import PointLight [as 别名]
# 或者: from panda3d.core.PointLight import showFrustum [as 别名]
def initLights(self):
# Create some lighting
#self.environ.ls()
#print(self.environ.findAllMatches("**/Spot"))
ambientLight = AmbientLight("ambientLight")
ambientLight.setColor(Vec4(0.8, 0.8, 0.8, 0.65))
"""
directionalLight = DirectionalLight("directionalLight")
directionalLight.setDirection(Vec3(-10, -10, 5))
directionalLight.showFrustum()
directionalLight.setColor(Vec4(1, 1, 1, 1))
directionalLight.setSpecularColor(Vec4(1, 1, 1, 1))
dirnp = render.attachNewNode(directionalLight)
dirnp.setPos(10, 0, 6)
"""
plight1 = PointLight('plight1')
plight1.setColor(VBase4(1, 1, 1, 1))
plight1.showFrustum()
#plight1.setShadowCaster(True)
plnp1 = render.attachNewNode(plight1)
plnp1.setPos(26.71, -33.2, 26)
plight2 = PointLight('plight2')
plight2.setColor(VBase4(1, 1, 1, 1))
plight2.showFrustum()
plnp2 = render.attachNewNode(plight2)
plnp2.setPos(-25, 25, 25)
slight = Spotlight('slight')
slight.setColor(VBase4(1, 1, 1, 1))
lens = PerspectiveLens()
lens.setFilmSize(1, 1) # Or whatever is appropriate for your scene
slight.setLens(lens)
slight.setShadowCaster(True, 512, 512)
slight.showFrustum()
slnp = render.attachNewNode(slight)
slnp.setPos(0, 0, 100)
slnp.lookAt(Vec3(0,0,0))
render.setLight(slnp)
render.setLight(plnp1)
render.setLight(plnp2)
#render.setLight(render.attachNewNode(ambientLight))
#render.setLight(dirnp)
render.setShaderAuto()
#render.setLight(render.attachNewNode(directionalLight))
"""