目录
顶点和线的方式
import numpy as np
from PyQt5 import QtWidgets
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton
from OpenGL.GL import *
from OpenGL.GLU import *
import sys
import math
class OpenGLWidget(QtWidgets.QOpenGLWidget):
def __init__(self, parent=None):
super(OpenGLWidget, self).__init__(parent)
self.is_perspective = True # 默认使用正投影
self.setFocusPolicy(Qt.StrongFocus)
self.translation = [0.0, 0.0, -5.0]