demo_3d.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:joysix 作者: niberger 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号