PyOpenGL - Python Wiki
文章推薦指數: 80 %
GLUT import * # The display() method does all the work; it has to call the appropriate # OpenGL functions to actually display something. def ... Search: PyOpenGL PyOpenGL FrontPageRecentChangesFindPageHelpContentsPyOpenGL Page ImmutablePageCommentsInfoAttachments MoreActions: RawText PrintView DeleteCache ------------------------ CheckSpelling LikePages LocalSiteMap ------------------------ RenamePage DeletePage ------------------------ ------------------------ RemoveSpam Reverttothisrevision ------------------------ SlideShow User Login PyOpenGL PyOpenGLisalargePythonpackagethatwrapsmost(uptoversion1.2)oftheOpenGLAPI.However,itdoesn'ttrytocleanuptheAPIandpresentamorePythonicinterface,soitwon'tsaveyou(or,moreimportantly,me)fromhavingtolearnthedetailsofOpenGL.ItdoesabstracttheAPIsoyoucallglColorinplaceofglColor3b,glColor3d,glColor3f,glColor3i,glColor3s,...Here'stheskeletonforaprogramthatdisplayssomething::importsys fromOpenGL.GLimport* fromOpenGL.GLUimport* fromOpenGL.GLUTimport* #Thedisplay()methoddoesallthework;ithastocalltheappropriate #OpenGLfunctionstoactuallydisplaysomething. defdisplay(): #Clearthecoloranddepthbuffers glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) #...renderstuffinhere... #Itwillgotoanoff-screenframebuffer. #Copytheoff-screenbuffertothescreen. glutSwapBuffers() glutInit(sys.argv) #Createadouble-bufferRGBAwindow.(Single-bufferingispossible. #Soiscreatinganindex-modewindow.) glutInitDisplayMode(GLUT_RGBA|GLUT_DOUBLE|GLUT_DEPTH) #Createawindow,settingitstitle glutCreateWindow('interactive') #Setthedisplaycallback.Youcansetothercallbacksforkeyboardand #mouseevents. glutDisplayFunc(display) #RuntheGLUTmainloopuntiltheuserclosesthewindow. glutMainLoop()PyOpenGL(lastedited2008-11-1514:01:06bylocalhost) MoinMoinPoweredPythonPoweredGPLlicensedValidHTML4.01 Unabletoeditthepage?SeetheFrontPageforinstructions.
延伸文章資訊
- 1PyOpenGL · PyPI
GLUT (FreeGLUT). GLExtrusion library (libgle). GLU (normally available on any OpenGL-capable mach...
- 2python-opengl/glut-cube.py at master - GitHub
An open access book on Python, OpenGL and Scientific Visualization, Nicolas P. Rougier, 2018 - py...
- 3pyOpenGL GLUT window function doesn't close properly
PyOpenGL uses freeglut. You have to give freeglut the chance to close the window. glutDestroyWind...
- 4Python GLUT.glutInit方法代碼示例- 純淨天空
本文整理匯總了Python中OpenGL.GLUT.glutInit方法的典型用法代碼示例。如果您正苦於以下問題:Python GLUT.glutInit方法的具體用法?Python GLUT....
- 5PyOpenGL - Python Wiki
GLUT import * # The display() method does all the work; it has to call the appropriate # OpenGL f...