本文整理汇总了Python中panda3d.core.PointLight.setPoint方法的典型用法代码示例。如果您正苦于以下问题:Python PointLight.setPoint方法的具体用法?Python PointLight.setPoint怎么用?Python PointLight.setPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类panda3d.core.PointLight
的用法示例。
在下文中一共展示了PointLight.setPoint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: readLights
# 需要导入模块: from panda3d.core import PointLight [as 别名]
# 或者: from panda3d.core.PointLight import setPoint [as 别名]
def readLights(self,light_data):
self.lights = []
i = 0
for light in light_data:
name = '%s light %d' % (light['type'], i )
pl = None
if light['type'] == 'point':
pl = PointLight( name )
pl.setPoint(Point3(*light['pos']))
pl.setColor(Vec4(*light['color']) )
elif light['type'] == 'directional':
pl = DirectionalLight( name )
pl.setColor(Vec4(*light['color']) )
elif light['type'] == 'ambient':
pl = AmbientLight( name )
pl.setColor(Vec4(*light['color']) )
#not implemented
#elif light['type'] == 'spotlight':
# pl = Spotlight( name )
#if it's allright
if pl != None:
self.lights.append(NodePath(pl))
i += 1
示例2: activateStar
# 需要导入模块: from panda3d.core import PointLight [as 别名]
# 或者: from panda3d.core.PointLight import setPoint [as 别名]
def activateStar(self, player):
'''
Activates a constructed dead star object, starting the lifetime counter with the assigned default value while
the Game Engine calls the graphic engine to display the corresponding animation.
@param player, the player who has activated the star
'''
self.lifetime = LIFETIME
self.stage = 1
self.activated = True
self.radius = MAX_STAR_RADIUS
self.player = player
self.timer_task = taskMgr.doMethodLater(1, self.trackStarLife, 'starLifeTick')
player.selected_star = self
# point_light = PointLight("starLight")
# point_light.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
# pt_node = render.attachNewNode(point_light)
## pt_node.setHpr(60, 0, 90)
# pt_node.setPos(Vec3(0, 0, -40.0))
# render.setLight(pt_node)
point_light = PointLight("starLight")
point_light.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
point_light.setPoint(Point3(0, 0, 0))
pt_node = self.point_path.attachNewNode(point_light)
# pt_node.setHpr(60, 0, 90)
render.setLight(pt_node)
'''TODO : display star birth animation '''
star_created_sound = base.loader.loadSfx("sound/effects/star/starCreation1.wav")
star_created_sound.setVolume(0.6)
star_created_sound.play()
# base.sfxManagerList[0].update()
# SphericalBody.star_created_sound1.play()
#SphericalBody.star_created_sound2.play()
self.radius = MAX_STAR_RADIUS
self.model_path.setScale(self.radius)
self.model_path.setTexture(self.flare_ts, SphericalBody.star_stage1_tex)
self._activateSunflare()