示例#1
0
def axis(vertices, position, angle):
    AXIS_SIZE = 0.1
    transform = Transform(position, angle)
    xaxis = transform.apply_vector(Vec2(AXIS_SIZE, 0.0))
    yaxis = transform.apply_vector(Vec2(0.0, AXIS_SIZE))
    c = position
    cx = c + xaxis
    cx = Vec3(cx.x, cx.y, 0.0)
    cy = c + yaxis
    cy = Vec3(cy.x, cy.y, 0.0)
    c = Vec3(position.x, position.y, 0.0)
    xcolor = Vec3(0.5, 0.0, 0.0)
    ycolor = Vec3(0.0, 0.5, 0.0)

    vertices.append((c, xcolor))
    vertices.append((cx, xcolor))
    vertices.append((c, ycolor))
    vertices.append((cy, ycolor))