This is an issue that I have been having for some days and have not found a solution under various Python, VTK and OpenGl versions . I have tried many things - too many to list. I saw this under anaconda but have now given up on that to try a fresh install running Python from the command prompt. I have reduced my system to what I think is the simplest level in order to isolate the issue :
So I am running Python 3.8 with VTK 9.0.1 and PyOpenGL 3.1.5 with PyOpenGL-accelerate 3.1.5
It seems that VTK does not work with Python 3.9 yet.
Running a simple example (below) I get the following error when the command window.Render() is executed :
2020-11-06 17:14:33.758 ( 0.313s) [ ]vtkWin32OpenGLRenderWin:635 ERR| vtkWin32OpenGLRenderWindow (0000020DA5C81D40): failed to get wglChoosePixelFormatARB
2020-11-06 17:14:33.790 ( 0.345s) [ ]vtkWin32OpenGLRenderWin:713 ERR| vtkWin32OpenGLRenderWindow (0000020DA5C81D40): failed to get valid pixel format.
2020-11-06 17:14:33.802 ( 0.357s) [ ]vtkOpenGLRenderWindow.c:569 ERR| vtkWin32OpenGLRenderWindow (0000020DA5C81D40): GLEW could not be initialized: Missing GL version
This message is now very familiar to me !! but what does it mean ?
.
Is this a graphics card compatibility issue ? How can I check and what can I do to fix that ??
What can I do to move on ? What other information do I need to supply ?
Script :
import vtk
import time
cone = vtk.vtkConeSource()
mapper = vtk.vtkPolyDataMapper()
mapper.SetInputConnection(cone.GetOutputPort())
actor = vtk.vtkActor()
actor.SetMapper(mapper)
renderer = vtk.vtkRenderer()
renderer.AddActor(actor)
renderer.ResetCamera()
camera = renderer.GetActiveCamera()
window = vtk.vtkRenderWindow()
window.AddRenderer(renderer)
azimuth = 0
while 1:
window.Render()
if azimuth >= 360:
azimuth = 0
azimuth += 0.1
camera.Azimuth(azimuth)
time.sleep(0.1)
Thank in anticipation - Jerry