pyopengl

PyOpenGL glutInit NullFunctionError

浪尽此生 提交于 2019-11-27 19:25:35
I am running Anaconda Python 2.7 on a Win7 x64 machine and used pip install PyOpenGL PyOpenGL_accelerate at the Anaconda command line to install PyOpenGL. I have some code (not my own I must confess) that makes use of glutInit import sys import math import numpy import OpenGL from OpenGL.GL import * from OpenGL.GLUT import * import Image import linkage # ... a whole load of definitions etc ... glutInit(sys.argv) glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB) glutInitWindowSize(600, 600) glutCreateWindow('linkage') init() initWindow() glutIdleFunc(idle) glutMainLoop() I run by entering the

How do I use gluLookAt properly?

吃可爱长大的小学妹 提交于 2019-11-27 12:26:54
问题 I don't want to get into complex trigonometry to calculate rotations and things like that for my 3D world so gluLookAt seems like a nice alternative. According to the documentation all I need to do is place 3 coordinates for the cameras position, three for what I should be looking at and an "up" position. The last made no sense until I assumed it had to be at right angles with the line of sight in the direction the top of the screen should be. It doesn't work like that at all. I have some

How to specify buffer offset with PyOpenGL

倖福魔咒の 提交于 2019-11-27 07:01:00
问题 What is the PyOpenGL equivalent of #define BUFFER_OFFSET(i) (reinterpret_cast<void*>(i)) glDrawElements(GL_TRIANGLE_STRIP, count, GL_UNSIGNED_SHORT, BUFFER_OFFSET(offset)) If the offset is 0, then glDrawElements(GL_TRIANGLE_STRIP, count, GL_UNSIGNED_SHORT, None) works, but I can not figure out how to specify a non-zero offset into a buffer object. 回答1: You're supposed to pass a ctypes void pointer, which can constructed by : ctypes.c_void_p(offset) There seems to be a more PyOpenGL specific

Why does my OpenGL Phong shader behave like a flat shader?

点点圈 提交于 2019-11-26 23:56:42
问题 I've been learning OpenGL for the past couple of weeks and I've run into some trouble implementing a Phong shader. It appears to do no interpolation between vertexes despite my use of the smooth qualifier. Am I missing something here? To give credit where credit is due, the code for the vertex and fragment shaders cribs heavily from the OpenGL SuperBible Fifth Edition. I would highly recommend this book! Vertex Shader: #version 330 in vec4 vVertex; in vec3 vNormal; uniform mat4 mvpMatrix; //

Python - No handlers could be found for logger “OpenGL.error”

只愿长相守 提交于 2019-11-26 20:10:58
Okay, what is it, and why does it occur on Win2003 server, but not on WinXP. It doesn't seem to affect my application at all, but I get this error message when I close the application. And it's annoying (as errors messages should be). I am using pyOpenGl and wxPython to do the graphics stuff. Unfortunately, I'm a C# programmer that has taken over this Python app, and I had to learn Python to do it. I can supply code and version numbers etc, but I'm still learning the technical stuff, so any help would be appreciated. Python 2.5, wxPython and pyOpenGL Kozyarchuk Looks like OpenGL is trying to

Python - No handlers could be found for logger “OpenGL.error”

余生颓废 提交于 2019-11-26 07:32:46
问题 Okay, what is it, and why does it occur on Win2003 server, but not on WinXP. It doesn\'t seem to affect my application at all, but I get this error message when I close the application. And it\'s annoying (as errors messages should be). I am using pyOpenGl and wxPython to do the graphics stuff. Unfortunately, I\'m a C# programmer that has taken over this Python app, and I had to learn Python to do it. I can supply code and version numbers etc, but I\'m still learning the technical stuff, so