本文整理匯總了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))
"""