Example #1
0
  def draw(self):
    glBindTexture(GL_TEXTURE_2D, self.textureBall)
    glEnable(GL_TEXTURE_2D)
##    glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, self.color)
      
    glMultMatrixd(vectormath.extractMatrix(self.body))
    #glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, self.color)
    gluSphere(self.q, self.geom.getRadius(), 32, 32)
    glDisable(GL_TEXTURE_2D)
Example #2
0
    def draw(self):
        glBindTexture(GL_TEXTURE_2D, self.textureBall)
        glEnable(GL_TEXTURE_2D)
        ##    glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, self.color)

        glMultMatrixd(vectormath.extractMatrix(self.body))
        #glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, self.color)
        gluSphere(self.q, self.geom.getRadius(), 32, 32)
        glDisable(GL_TEXTURE_2D)
Example #3
0
  def draw(self):
    glMultMatrixd(vectormath.extractMatrix(self.body))
    sx, sy, sz = self.geom.getLengths()
    glScalef(sx, sy, sz)

##    glPushMatrix()
##    glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, (1, 0, 0))
##    
##    glTranslate(0.0, 0.5, 0.0)
##    glRotatef(180.0, 0.0, 1.0, 0.0)
##    gluCylinder(self.q, 0.2, 0.0, 1.0, 32, 32)
##    glRotatef(180.0, 0.0, 1.0, 0.0)
##    gluDisk(self.q, 0.0, 0.2, 32, 32)
##    glPopMatrix()
    
    glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, self.color)
    renderCube(1.0)
Example #4
0
    def draw(self):
        glMultMatrixd(vectormath.extractMatrix(self.body))
        sx, sy, sz = self.geom.getLengths()
        glScalef(sx, sy, sz)

        ##    glPushMatrix()
        ##    glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, (1, 0, 0))
        ##
        ##    glTranslate(0.0, 0.5, 0.0)
        ##    glRotatef(180.0, 0.0, 1.0, 0.0)
        ##    gluCylinder(self.q, 0.2, 0.0, 1.0, 32, 32)
        ##    glRotatef(180.0, 0.0, 1.0, 0.0)
        ##    gluDisk(self.q, 0.0, 0.2, 32, 32)
        ##    glPopMatrix()

        glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, self.color)
        renderCube(1.0)