jonwright / pyopengltk

OpenGL frame for Python/Tkinter via ctypes and pyopengl
MIT License
54 stars 13 forks source link

Errors when using F3D #34

Closed JPLost closed 4 months ago

JPLost commented 4 months ago

Hello, could you kindly check this error list I got and see if it is relevant error? I'm trying to implement F3D viewer via Opengl Frame. It runs the window separately, but does not pack it to root frame. Attached you will find the zip-file with the .py-code attached.

kuva

LanPTR3D.zip

JPLost commented 4 months ago

Correct solution was:


        def __init__(self):
            super().__init__()
            self.mEngine = None

        # Initialize F3D
        def initgl(self):
            self.mEngine = f3d.Engine(f3d.Window.Type.EXTERNAL)
            self.mEngine.loader.load_geometry(f3d.Mesh(
                    points=[0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0],
                    face_sides=[3],
                    face_indices=[0, 1, 2],
                    )
                )

        def redraw(self):
            self.mEngine.window.render()