當前位置: 首頁>>代碼示例>>Python>>正文


Python LineSegs.setVertexColor方法代碼示例

本文整理匯總了Python中pandac.PandaModules.LineSegs.setVertexColor方法的典型用法代碼示例。如果您正苦於以下問題:Python LineSegs.setVertexColor方法的具體用法?Python LineSegs.setVertexColor怎麽用?Python LineSegs.setVertexColor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pandac.PandaModules.LineSegs的用法示例。


在下文中一共展示了LineSegs.setVertexColor方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __createLine

# 需要導入模塊: from pandac.PandaModules import LineSegs [as 別名]
# 或者: from pandac.PandaModules.LineSegs import setVertexColor [as 別名]
 def __createLine(self, length=1, color=(1,1,1,1), endColor=None):
   LS=LineSegs()
   LS.setColor(*color)
   LS.moveTo(0,0,0)
   LS.drawTo(length*1,0,0)
   node=LS.create()
   if endColor:
     LS.setVertexColor(1,*endColor)
   return node
開發者ID:KillerGoldFisch,項目名稱:panda3d-editor,代碼行數:11,代碼來源:pDirectTree.py

示例2: makeArc

# 需要導入模塊: from pandac.PandaModules import LineSegs [as 別名]
# 或者: from pandac.PandaModules.LineSegs import setVertexColor [as 別名]
 def makeArc(angleDegrees=360, numSteps=16, color=Vec4(1, 1, 1, 1)):
     ls = LineSegs()
     angleRadians = deg2Rad(angleDegrees)
     for i in range(numSteps + 1):
         a = angleRadians * i / numSteps
         y = math.sin(a)
         x = math.cos(a)
         ls.drawTo(x, y, 0)
     node = ls.create()
     if color != Vec4(1, 1, 1, 1):
         for i in range(numSteps + 1):
             ls.setVertexColor(i, color)
         pass
     return NodePath(node)
開發者ID:Fish4,項目名稱:Atlantis-Warfare,代碼行數:16,代碼來源:__init__.py

示例3: createRainDrop

# 需要導入模塊: from pandac.PandaModules import LineSegs [as 別名]
# 或者: from pandac.PandaModules.LineSegs import setVertexColor [as 別名]
 def createRainDrop(self, x=0, y=0, doubleDrop=False, tripleDrop=False):
     # Set up line geometry for rain.
     id = str(uuid.uuid4())
     dummy = NodePath('dummy'+id)
     lineSegs = LineSegs('line'+id)
     if self.tripleDrop:
         lineSegs.setThickness(3.0)
     elif self.doubleDrop:
         lineSegs.setThickness(2.0)
     else:
         lineSegs.setThickness(1.0)
     lineSegs.moveTo(0, 0, 0)
     lineSegs.drawTo(0, 0, self.deltaZ*.1)
     lineGeomNode = lineSegs.create()
     # True: gray; False: white and red.
     if True:
         lineSegs.setVertexColor(0, Vec4(1, 1, 1, .4))
         lineSegs.setVertexColor(1, Vec4(.3, .3, .3, 0))
         pass
     else:
         lineSegs.setVertexColor(0, Vec4(1, 1, 1, .4))
         lineSegs.setVertexColor(1, Vec4(1, 0, 0, 1))
     linePath = dummy.attachNewNode(lineGeomNode)
     linePath.setTransparency(True)
     linePath.reparentTo(render)
     # Add collision node with 'FROM' tag = 'rain'
     pickerNode = CollisionNode('linecnode'+id)
     pickerNode.setTag('FROM', 'rain')
     rayCollider = linePath.attachNewNode(pickerNode)
     # A small collision sphere is attached to the bottom of each rain drop.
     rayCollider.node().addSolid(CollisionSphere(0, 0, 0, .25))
     #base.cTrav.addCollider(rayCollider, collisionHandler)
     # Sequence rain
     Sequence(
         LerpPosInterval(linePath, self.dropDuration, Point3(x, y, self.pt1.z), Point3(x, y, self.pt2.z), blendType='easeIn', fluid=1),
         Parallel(Func(dummy.removeNode), Func(linePath.removeNode))
     ).start()
開發者ID:Fish4,項目名稱:Atlantis-Warfare,代碼行數:39,代碼來源:__init__.py


注:本文中的pandac.PandaModules.LineSegs.setVertexColor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。