def __init__(self, win_width = 640, win_height = 480):
pygame.init()
self.screen = pygame.display.set_mode((win_width, win_height))
pygame.display.set_caption("JoySix Cube Demo")
self.clock = pygame.time.Clock()
self.vertices = [
[-1,1,-1],
[1,1,-1],
[1,-1,-1],
[-1,-1,-1],
[-1,1,1],
[1,1,1],
[1,-1,1],
[-1,-1,1]
]
# Define the vertices that compose each of the 6 faces. These numbers are
# indices to the vertices list defined above.
self.faces = [(0,1,2,3),(1,5,6,2),(5,4,7,6),(4,0,3,7),(0,4,5,1),(3,2,6,7)]
# Define colors for each face
self.colors = [(255,0,255),(255,0,0),(0,255,0),(0,0,255),(0,255,255),(255,255,0)]
self.angle = 0
self.joystick = joystick.Joystick()
评论列表
文章目录