全代码展示,讲解看下篇博客
exe免费纯享版地址:https://download.csdn.net/download/jianmuhuayi/26050493
import pygame
from pygame.locals import *
from sys import exit
from math import cos,sin,tan,radians
pygame.init()
p={}
width=600
color=(0,0,0)
fov=70
focus=(width/2)/tan(radians(fov/2))
screen = pygame.display.set_mode((width, width), 0,0)
screen.fill((255,255,255))
pygame.display.set_caption('3D project')
pygame.mouse.set_visible(False)
pygame.event.set_grab(True)
p['pa']=[-500,-500,800]
p['pb']=[-500,500,800]
p['pc']=[500,500,800]
p['pd']=[500,-500,800]
p['pe']=[-500,-500,1800]
p['pf']=[-500,500,1800]
p['pg']=[500,500,1800]
p['ph']=[500,-500,1800]
def rotatex(angle_x):
for coordinate in p.values():
coordinate_z_new&#