def draw_object():
    glMatrixMode(GL_MODELVIEW)
    glPushMatrix()
    glScale(scale, scale, scale)
    glMultMatrixf(m.column_major(q.matrix(rotation)))
    glPolygonMode(GL_FRONT_AND_BACK, GL_LINE)
    glCallList(display_list)
    glPopMatrix()
示例#2
0
def draw_object():
	glMatrixMode(GL_MODELVIEW)
	glPushMatrix()
	glScale(scale, scale, scale)
	glMultMatrixf(m.column_major(q.matrix(rotation)))
	
	glCallList(object_list_id)
	
	glPopMatrix()
def draw_object():
    glVertexPointer(3, GL_FLOAT, 0, verticies)
    glTexCoordPointer(3, GL_FLOAT, 0, tex_coords)
    glNormalPointer(GL_FLOAT, 0, normals)
    glColorPointer(3, GL_FLOAT, 0, colors)

    glMatrixMode(GL_MODELVIEW)
    glPushMatrix()
    glScale(scale, scale, scale)
    glMultMatrixf(m.column_major(q.matrix(rotation)))

    offset = 0
    for size in sizes:
        glDrawElements(GL_TRIANGLE_STRIP, size, GL_UNSIGNED_INT,
                       indicies[offset:offset + size])
        offset += size

    glPopMatrix()
def draw_object():
    glVertexPointer(3, GL_FLOAT, record_len, vertex_offset)
    glTexCoordPointer(3, GL_FLOAT, record_len, tex_coord_offset)
    glNormalPointer(GL_FLOAT, record_len, normal_offset)
    glColorPointer(3, GL_FLOAT, record_len, color_offset)

    glMatrixMode(GL_MODELVIEW)
    glPushMatrix()
    glScale(scale, scale, scale)
    glMultMatrixf(m.column_major(q.matrix(rotation)))

    offset = 0
    for size in sizes:
        glDrawElements(GL_TRIANGLE_STRIP, size, GL_UNSIGNED_INT,
                       c_void_p(offset))
        offset += size * uint_size

    glPopMatrix()
示例#5
0
def draw_object():
    glMatrixMode(GL_MODELVIEW)
    glPushMatrix()
    glScale(scale, scale, scale)
    glMultMatrixf(m.column_major(q.matrix(rotation)))

    offset = 0
    for size in sizes:
        glBegin(GL_TRIANGLE_STRIP)
        for i in range(offset, offset + size):
            index = indicies[i]
            glColor3f(*colors[index])
            glNormal3f(*normals[index])
            glTexCoord3f(*tex_coords[index])
            glVertex3f(*verticies[index])
        glEnd()
        offset += size

    glPopMatrix()
示例#6
0
def draw_object():
    glVertexAttribPointer(locations[b"vertex"], 3, GL_FLOAT, False, record_len,
                          vertex_offset)
    glVertexAttribPointer(locations[b"tex_coord"], 3, GL_FLOAT, False,
                          record_len, tex_coord_offset)
    glVertexAttribPointer(locations[b"normal"], 3, GL_FLOAT, False, record_len,
                          normal_offset)
    glVertexAttribPointer(locations[b"color"], 3, GL_FLOAT, False, record_len,
                          color_offset)

    glMatrixMode(GL_MODELVIEW)
    glPushMatrix()
    glScale(scale, scale, scale)
    glMultMatrixf(m.column_major(q.matrix(rotation)))

    offset = 0
    for size in sizes:
        glDrawElements(GL_TRIANGLE_STRIP, size, GL_UNSIGNED_INT,
                       c_void_p(offset))
        offset += size * uint_size

    glPopMatrix()
def c_matrix(matrix):
    return (c_float * 16)(*m.column_major(matrix))