目录
画多个物体,x y 位置,半径,长度
self.drawCylinder(-2, 0)
self.drawCylinder(2, 0)
def drawCylinder(self, x, y):
glColor3f(1, 0, 0)
num_steps = 32
radius = 0.05
height = 3
完整代码:
from OpenGL.raw.GLU import gluPerspective
from PyQt5.QtWidgets import QApplication, QMainWindow, QOpenGLWidget
from PyQt5.QtCore import Qt, QPoint
from PyQt5.QtGui import QMouseEvent, QWheelEvent
from OpenGL.GL import *
import sys
import math