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


Python BGL.glVertex2i方法代碼示例

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


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

示例1: DrawBox

# 需要導入模塊: from Blender import BGL [as 別名]
# 或者: from Blender.BGL import glVertex2i [as 別名]
def DrawBox(x, y, w, h):
    BGL.glBegin(BGL.GL_LINE_LOOP)
    BGL.glVertex2i(x,y)
    BGL.glVertex2i(x+w,y)
    BGL.glVertex2i(x+w,y-h)
    BGL.glVertex2i(x,y-h)
    BGL.glEnd()
開發者ID:cmcsun,項目名稱:csc427project2,代碼行數:9,代碼來源:x_export.py

示例2: drawcorner

# 需要導入模塊: from Blender import BGL [as 別名]
# 或者: from Blender.BGL import glVertex2i [as 別名]
	def drawcorner(self):


		BGL.glBegin(BGL.GL_LINES)

		BGL.glColor3f(self.col[0],self.col[1],self.col[2])

		BGL.glVertex2i(self.x+4*self.xflip,self.y+1*self.yflip)
		BGL.glVertex2i(self.x+8*self.xflip,self.y+1*self.yflip)

		BGL.glVertex2i(self.x+3*self.xflip,self.y+2*self.yflip)
		BGL.glVertex2i(self.x+8*self.xflip,self.y+2*self.yflip)

		BGL.glVertex2i(self.x+2*self.xflip,self.y+3*self.yflip)
		BGL.glVertex2i(self.x+8*self.xflip,self.y+3*self.yflip)

		BGL.glVertex2i(self.x+1*self.xflip,self.y+4*self.yflip)
		BGL.glVertex2i(self.x+8*self.xflip,self.y+4*self.yflip)

		# change colour for border, if needed

		BGL.glColor3f(self.bcol[0],self.bcol[1],self.bcol[2])

		BGL.glVertex2i(self.x+5*self.xflip,self.y)
		BGL.glVertex2i(self.x+8*self.xflip,self.y)

		BGL.glVertex2i(self.x+5*self.xflip,self.y)
		BGL.glVertex2i(self.x,self.y+5*self.yflip)


		BGL.glVertex2i(self.x,self.y+5*self.yflip)
		BGL.glVertex2i(self.x,self.y+8*self.yflip)

		BGL.glEnd()
開發者ID:duststorm,項目名稱:lodpbr,代碼行數:36,代碼來源:goo.py

示例3: coversides

# 需要導入模塊: from Blender import BGL [as 別名]
# 或者: from Blender.BGL import glVertex2i [as 別名]
	def coversides(self):

		##   This function draws lines to cover up border lines designated by the sides arguement.

		BGL.glColor3f(self.col[0],self.col[1],self.col[2])

		if self.sides[0]:			# left border

			BGL.glBegin(BGL.GL_LINES)

			BGL.glVertex2i(self.left,self.base+1)
			BGL.glVertex2i(self.left,self.top)

			BGL.glEnd()

		if self.sides[1]:			# top border

			BGL.glBegin(BGL.GL_LINES)

			BGL.glVertex2i(self.left+1,self.top)
			BGL.glVertex2i(self.right,self.top)

			BGL.glEnd()

		if self.sides[2]:			# right border

			BGL.glBegin(BGL.GL_LINES)

			BGL.glVertex2i(self.right,self.base+1)
			BGL.glVertex2i(self.right,self.top)

			BGL.glEnd()

		if self.sides[3]:			# base border

			BGL.glBegin(BGL.GL_LINES)

			BGL.glVertex2i(self.left+1,self.base)
			BGL.glVertex2i(self.right,self.base)

			BGL.glEnd()
開發者ID:duststorm,項目名稱:lodpbr,代碼行數:43,代碼來源:goo.py

示例4: drawpanel

# 需要導入模塊: from Blender import BGL [as 別名]
# 或者: from Blender.BGL import glVertex2i [as 別名]
	def drawpanel(self):

		##   Draw the main part of the panel.
		BGL.glColor3f(self.col[0],self.col[1],self.col[2])

		BGL.glRecti(self.left+5,self.base,self.right-5,self.top)			##   Large middle bit.
		BGL.glRecti(self.left,self.base+4,self.left+8,self.top-4)			##   Left small side strip.
		BGL.glRecti(self.right-8,self.base+4,self.right,self.top-4)		##   Right small side strip.

		##   Draw the borders.
		BGL.glColor3f(self.bcol[0],self.bcol[1],self.bcol[2])			##   Change to border colour.

		BGL.glBegin(BGL.GL_LINES)

		BGL.glVertex2i(self.left+6,self.base)						##   Base border.
		BGL.glVertex2i(self.right-6,self.base)

		BGL.glVertex2i(self.left+6,self.top)						##   Top border.
		BGL.glVertex2i(self.right-6,self.top)

		BGL.glVertex2i(self.left,self.base+6)						##   Left border.
		BGL.glVertex2i(self.left,self.top-6)

		BGL.glVertex2i(self.right,self.base+6)						##   Right border.
		BGL.glVertex2i(self.right,self.top-6)

		BGL.glEnd()
開發者ID:duststorm,項目名稱:lodpbr,代碼行數:29,代碼來源:goo.py

示例5: Draw_Border

# 需要導入模塊: from Blender import BGL [as 別名]
# 或者: from Blender.BGL import glVertex2i [as 別名]
def Draw_Border(X1,Y1,X2,Y2): # X1,Y1 = Top Left X2,Y2 = Bottom Right
    """
    Draw a border given a top left corner (X1, X2) and bottom right (X2, Y2)
    """
    INDENT = 3
    
    BGL.glColor3f(1.0,1.0,1.0)
    BGL.glBegin(BGL.GL_LINES)
    BGL.glVertex2i(X1+INDENT,Y1-INDENT)     #top line
    BGL.glVertex2i(X2-INDENT,Y1-INDENT)
    
    BGL.glVertex2i(X1+INDENT,Y1-INDENT)     #left line
    BGL.glVertex2i(X1+INDENT,Y2+INDENT)
    BGL.glEnd()
    
    BGL.glColor3f(0.5,0.5,0.5)
    BGL.glBegin(BGL.GL_LINES)
    BGL.glVertex2i(X2-INDENT,Y1-INDENT)     #Right line
    BGL.glVertex2i(X2-INDENT,Y2+INDENT)
    
    BGL.glVertex2i(X1+INDENT,Y2+INDENT)     #bottom line
    BGL.glVertex2i(X2-INDENT,Y2+INDENT)
    BGL.glEnd()
開發者ID:AndyMidNite,項目名稱:mogens,代碼行數:25,代碼來源:Main.py


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