本文整理汇总了Python中Camera.Camera.transform方法的典型用法代码示例。如果您正苦于以下问题:Python Camera.transform方法的具体用法?Python Camera.transform怎么用?Python Camera.transform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Camera.Camera
的用法示例。
在下文中一共展示了Camera.transform方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GLWidget
# 需要导入模块: from Camera import Camera [as 别名]
# 或者: from Camera.Camera import transform [as 别名]
#.........这里部分代码省略.........
glTexCoord2f(1.0, 0.0); glVertex2f(offset[0]+ar*size,offset[1])
glTexCoord2f(1.0, 1.0); glVertex2f(offset[0]+ar*size,offset[1]+size)
glTexCoord2f(0.0, 1.0); glVertex2f(offset[0],offset[1]+size)
glEnd()
edgeBlendShader.unuse()
def drawProjectorImage():
glLoadIdentity()
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
gluOrtho2D(0,1 / float(self.height()) * self.width(),0,1)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()
glDisable( GL_DEPTH_TEST )
glDisable( GL_CULL_FACE )
if self.projImagesFullscreen and self.selectedProj != -1:
paintProjectorImage(self.projectors[self.selectedProj],[0.0,0.0],1.0,0.5)
else:
bottom = 0.05
size = 0.2
xOffset = 0.05
proj = self.projectors
paintProjectorImage(proj,[xOffset,bottom],size,1.0)
xOffset += size / proj.aspectRatio + 0.05
glDisable(GL_TEXTURE_2D)
light0 = Light(GL_LIGHT0,Point3D(0.0,-20.0,-20.0))
light1 = Light(GL_LIGHT1,Point3D(0.0,20.0,20.0))
glMatrixMode( GL_PROJECTION )
glLoadIdentity()
self.camera.transform()
glMatrixMode( GL_MODELVIEW )
glLoadIdentity();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
glDepthFunc( GL_LEQUAL );
glEnable( GL_DEPTH_TEST );
colors = { "projA" : [1,0,0],
"projB" : [0,1,0],
"projC" : [0,0,1],
"projC" : [1,1,0] }
glPushMatrix()
glLoadIdentity()
#self.projectors.drawA(self.canvasModel,colors["projA"])
#self.projectors.drawB(self.canvasModel,colors["projB"])
#self.projectors.drawC(self.canvasModel,colors["projC"])
#self.projectors.drawD(self.canvasModel,colors["projD"])
glPopMatrix()
if self.showCanvas:
mode = GLU_FILL
texture = None
if self.selTexture in self.textures:
texture = self.textures[self.selTexture]
shader = self.shaders[str(self.canvasModel.__class__)+"_inv_proj"]
shader.use()
self.canvasModel.shaderSettings(shader)
self.projectors.shaderSettings(shader)
shader.set(proj_multi = ("4f",[[1.0,1.0,1.0,1.0]]))