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