当前位置: 首页>>代码示例>>Python>>正文


Python ParticleEffect.setH方法代码示例

本文整理汇总了Python中direct.particles.ParticleEffect.ParticleEffect.setH方法的典型用法代码示例。如果您正苦于以下问题:Python ParticleEffect.setH方法的具体用法?Python ParticleEffect.setH怎么用?Python ParticleEffect.setH使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在direct.particles.ParticleEffect.ParticleEffect的用法示例。


在下文中一共展示了ParticleEffect.setH方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: createEnvironment

# 需要导入模块: from direct.particles.ParticleEffect import ParticleEffect [as 别名]
# 或者: from direct.particles.ParticleEffect.ParticleEffect import setH [as 别名]
 def createEnvironment(self):
     # Loads aquarium and sets it so player is stuck in it.
     
     self.enviroNode = render.attachNewNode( "EnviroNode" )
     self.enviroNode.setScale(1)
     self.enviroNode.setPosHpr(0,0,-30,  0,0,0)
     # Load second fish example
     self.fish2 = loader.loadModel("Models/clownFishModel.egg")
     self.fish2 = Actor('Models/clownFishModel.egg', {'swimming':'Models/clownFishAnim.egg'})
     self.fish2.loop('swimming')
     self.fish2.reparentTo(self.enviroNode)
     ##self.fish2Tex = loader.loadTexture("Textures/red.tif")
     ##self.fish2.setTexture(self.fish2Tex, 1)
     self.fish2.setScale(.7)
     self.fish2.setPos(50, 164.8, 44.15)
     ## self.fish2.place()
     # Sequences for Fish2 movement
     self.fish2PosInterval1 = self.fish2.posInterval(10,Point3(-50, 0, 70),startPos=Point3(50,0, 70))
     self.fish2PosInterval2 = self.fish2.posInterval(10,Point3(50, 0, 70),startPos=Point3(-50, 0, 70))
     self.fish2HprInterval1 = self.fish2.hprInterval(3,Point3(180, 0, 0),startHpr=Point3(0, 0, 0))
     self.fish2HprInterval2 = self.fish2.hprInterval(3,Point3(0, 0, 0),startHpr=Point3(180, 0, 0))
     self.fish2move = Sequence(self.fish2PosInterval2, self.fish2HprInterval1, self.fish2PosInterval1, self.fish2HprInterval2, name="fish2move")        
     self.fish2move.loop()
     
     # Load third fish example
     self.fish3 = loader.loadModel("Models/smallSchoolFishModel.egg")
     self.fish3 = Actor('Models/smallSchoolFishModel.egg', {'swimming':'Models/smallSchoolFishAnim.egg'})
     self.fish3.loop('swimming')
     self.fish3.reparentTo(self.enviroNode)
     ## self.fish3Tex = loader.loadTexture("Textures/red.tif")
     ## self.fish3.setTexture(self.fish3Tex, 1)
     self.fish3.setScale(1.5)
     self.fish3.setPos(230, 50, 15)
     ## self.fish3.setHpr(0, 0, 0)
     ## self.fish3.place()
     # Sequences for Fish3 Movement
     self.fish3PosInterval1 = self.fish3.posInterval(10,Point3(230, 50, 25),startPos=Point3(150,50, 30))
     self.fish3PosInterval2 = self.fish3.posInterval(10,Point3(150, 50, 30),startPos=Point3(230, 50, 15))
     self.fish3HprInterval1 = self.fish3.hprInterval(3,Point3(180, 0, 0),startHpr=Point3(0, 0, 0))
     self.fish3HprInterval2 = self.fish3.hprInterval(3,Point3(0, 0, 0),startHpr=Point3(180, 0, 0))
     self.fish3move = Sequence(self.fish3PosInterval2, self.fish3HprInterval1, self.fish3PosInterval1, self.fish3HprInterval2, name="fish3move")        
     self.fish3move.loop()
     
     # Load fourth fish example
     self.fish4 = loader.loadModel("Models/lionFishModel.egg")
     self.fish4 = Actor('Models/lionFishModel.egg', {'swimming':'Models/lionFishAnim.egg'})
     self.fish4.loop('swimming')
     self.fish4.reparentTo(self.enviroNode)
     self.fish4Tex = loader.loadTexture("Textures/red.tif")
     self.fish4.setTexture(self.fish4Tex, 1)
     self.fish4.setScale(.8)
     self.fish4.setPos(55, -70, 135)
     ## self.fish4.place()
     # Sequence for fish4 Movement
     self.fish4PosInterval1 = self.fish4.posInterval(10,Point3(55, -70, 135),startPos=Point3(75, -30, 135))
     self.fish4PosInterval2 = self.fish4.posInterval(10,Point3(75, -30, 135),startPos=Point3(55, -70, 135))
     self.fish4HprInterval1 = self.fish4.hprInterval(3,Point3(180, 0, 0),startHpr=Point3(0, 0, 0))
     self.fish4HprInterval2 = self.fish4.hprInterval(3,Point3(0, 0, 0),startHpr=Point3(180, 0, 0))
     self.fish4move = Sequence(self.fish4PosInterval2, self.fish4HprInterval1, self.fish4PosInterval1, self.fish4HprInterval2, name="fish4move")        
     self.fish4move.loop()
     
     
     #Load Shrimp
     self.fish5 = loader.loadModel("Models/cleanerShrimpModel.egg")
     self.fish5 = Actor('Models/cleanerShrimpModel.egg', {'swimming':'Models/cleanerShrimpAnim.egg'})
     self.fish5.loop('swimming')
     self.fish5.reparentTo(self.enviroNode)
     ## self.fish5Tex = loader.loadTexture("Textures/red.tif")
     ## self.fish5.setTexture(self.fish5Tex, 1)
     self.fish5.setScale(.5)
     self.fish5.setPos(-230, -140, 4)
     ## self.fish5.setHpr(0, 0, 0)
     # Sequence for shrimp Movement
     self.fish5PosInterval1 = self.fish5.posInterval(10,Point3(-230, -140, 4),startPos=Point3(200, -140, 4))
     self.fish5PosInterval2 = self.fish5.posInterval(10,Point3(200, -140, 4),startPos=Point3(-230, -140, 4))
     self.fish5HprInterval1 = self.fish5.hprInterval(3,Point3(180, 0, 0),startHpr=Point3(0, 0, 0))
     self.fish5HprInterval2 = self.fish5.hprInterval(3,Point3(0, 0, 0),startHpr=Point3(-180, 0, 0))
     self.fish5move = Sequence(self.fish5PosInterval2, self.fish5HprInterval1, self.fish5PosInterval1, self.fish4HprInterval2, name="fish5move")        
     self.fish5move.loop()
     
     #Load Seahorse
     self.fish6 = loader.loadModel("Models/seaHorseModel.egg")
     self.fish6 = Actor('Models/seaHorseModel.egg', {'floating':'Models/seaHorseAnim.egg'})
     self.fish6.loop('floating')
     self.fish6.reparentTo(self.enviroNode)
     self.fish6.setScale(.9)
     self.fish6.setPos(282,160,58)
     self.fish6.setHpr(90, 0, 0)
     ## self.fish6.place()
     
     # Loading in the first Toy Model
     self.toy1 = loader.loadModel("Models/car1.egg")
     self.toy1.reparentTo(self.enviroNode)
     ## self.toy1Tex = loader.loadTexture("Textures/car1_unwrap.png")
     ## self.toy1.setTexture(self.toy1Tex, 1)
     self.toy1.setScale(.5)
     self.toy1.setPos(-286.7, -73.5,12)
     self.toy1.setHpr(90, 0, 0)
     ## self.toy1.place()
     
#.........这里部分代码省略.........
开发者ID:mitchellvitez,项目名称:Bubble-Bonanza,代码行数:103,代码来源:fish_tank_final_computerVersion.py


注:本文中的direct.particles.ParticleEffect.ParticleEffect.setH方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。