Ask Your Question
3

What is the procedure for installing freeglut for python 3.6 without any cost?

asked 2023-07-10 22:57:44 +0000

huitzilopochtli gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
3

answered 2023-07-10 23:06:01 +0000

pufferfish gravatar image
  1. Download the necessary files:

  2. Install PyOpenGL by running the following command on the command prompt with administrative privileges:

    pip install PyOpenGL

  3. Extract the downloaded freeglut runtime binary files to a folder.

  4. Copy the freeglut.dll file from the bin folder to the Python36 folder:

    C:\Python36

  5. Copy the glut.dll and glut32.dll files from the bin folder to the Windows System32 folder:

    C:\Windows\System32

  6. To test the installation, run this Python code:

from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *

def draw():
    glClear(GL_COLOR_BUFFER_BIT)
    glutSolidTeapot(0.5)
    glFlush()

glutInit()
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB)
glutInitWindowSize(250, 250)
glutInitWindowPosition(100, 100)
glutCreateWindow(b"Teapot")
glutDisplayFunc(draw)
glClearColor(0.0,1.0,0.0,0.0)
gluOrtho2D(-1.0,1.0,-1.0,1.0)
glutMainLoop()

This should open a window with a teapot. If it works correctly, then the installation was successful.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-07-10 22:57:44 +0000

Seen: 9 times

Last updated: Jul 10 '23