1. import os
  2.  
  3. from PyQt5.QtCore import Qt, QUrl
  4. from PyQt5.QtWidgets import QApplication
  5. from PyQt5.QtWebEngineWidgets import QWebEngineView
  6.  
  7.  
  8. class Main(QWebEngineView):
  9.  
  10.     def __init__(self):
  11.         super().__init__()
  12.  
  13.         self.setWindowTitle('three.js webgl - GLTFloader')
  14.         self.resize(1024, 768)
  15.  
  16.         self.page().setBackgroundColor(Qt.black)
  17.  
  18.         u = QUrl.fromLocalFile(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'app', 'webgl_loader_gltf.html'))
  19.         self.load(u)
  20.  
  21.         self.show()
  22.  
  23.  
  24. if __name__ == '__main__':
  25.     import sys
  26.     app = QApplication(sys.argv)
  27.     main = Main()
  28.     sys.exit(app.exec())
  29.  
[raw code]