Giter Club home page Giter Club logo

python-opengl-tutorial's Introduction

opengl-tutorial

a Python opengl-tutorial base on PyOpenGL.

中文说明可以看这里

All content were follow http://www.opengl-tutorial.org/
You also can find C implemention here: https://github.com/opengl-tutorials/ogl

table of content

  1. tu_00_glfw_window_sample : GLFW Version Colored cube.
    orginal tutorial => http://www.opengl-tutorial.org/beginners-tutorials/tutorial-4-a-colored-cube/

PyOpenGL

  1. tu_01_color_cube : GLUT Version Colored cube.
    orginal tutorial => http://www.opengl-tutorial.org/beginners-tutorials/tutorial-4-a-colored-cube/

PyOpenGL

  1. tu_02_texture_without_normal: basic rendering with texture.
    orginal tutorial => http://www.opengl-tutorial.org/beginners-tutorials/tutorial-5-a-textured-cube/

PyOpenGL

  1. tu_03_loadobj : load mesh information from wavefont obj file:
    orginal tutorial => http://www.opengl-tutorial.org/beginners-tutorials/tutorial-7-model-loading/ PyOpenGL

  2. tu_04_vbo : use VBO
    orginal tutorial => http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-9-vbo-indexing/

PyOpenGL

  1. tu_05_input : add viewport control with keyboard and mouse
    orginal tutorial => http://www.opengl-tutorial.org/beginners-tutorials/tutorial-6-keyboard-and-mouse/ PyOpenGL

  2. tu_06_multobjs: draw multi mesh objects in same window

PyOpenGL

  1. tu_07_basic_shading : basic shading with light and normals
    orginal tutorial => http://www.opengl-tutorial.org/beginners-tutorials/tutorial-8-basic-shading/

PyOpenGL

  1. tu_08_transparency : transparency
    orginal tutorial => http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-10-transparency/

PyOpenGL

  1. tu_09_draw_text: Draw text in openGL
    orginal tutorial => http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-11-2d-text/

PyOpenGL

  1. tu_10_normal_mapping : Normal Mapping
    orginal tutorial => http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-13-normal-mapping/

PyOpenGL

python-opengl-tutorial's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

python-opengl-tutorial's Issues

"'NumberHandler' object has no attribute 'arrayByteCount'" Error

Describe the bug
When I run those demos , only tu1 and tu2 could work. the left demo report error .

Expected behavior
here is my error report

Traceback (most recent call last):
  File "src\wrapper.pyx", line 66, in OpenGL_accelerate.wrapper.CArgCalculatorElement.c_call
  File "D:\Anaconda3\lib\site-packages\OpenGL\GL\images.py", line 499, in __call__
    return arraydatatype.ArrayDatatype.arrayByteCount(arg)
  File "src\arraydatatype.pyx", line 257, in OpenGL_accelerate.arraydatatype.ArrayDatatype.arrayByteCount
AttributeError: ("'NumberHandler' object has no attribute 'arrayByteCount'", 6, <OpenGL.platform.baseplatform.glCompressedTexImage2D object at 0x000000000BD590D8>)

Desktop (please complete the following information):

  • OS: windows 7 sp1
  • python37

I had fix some grammar error . but I had no idea about this error. Any suggestion?

Unable to run the glfw examples on mac os 13.6.3 (m1 chip)

Describe the bug

On my macbook pro running mac os 13.6.3 (m1 chip) I ran the first tutorial file tu_00....py

I had an error related to glfw that I fixed by adding these two limnes that apparently are common for mac os:

glfw.window_hint(glfw.OPENGL_PROFILE,glfw.OPENGL_CORE_PROFILE)
glfw.window_hint(glfw.OPENGL_FORWARD_COMPAT, GL_TRUE);

After these lines teh code ran, but no window was open and at the same time the window generated by glfw seem correct
(I did not catch any error in glfw calls)

To Reproduce
Steps to reproduce the behavior:

  1. Add these lines to the tu_00...py
    glfw.window_hint(glfw.OPENGL_PROFILE,glfw.OPENGL_CORE_PROFILE)
    glfw.window_hint(glfw.OPENGL_FORWARD_COMPAT, GL_TRUE);
  2. run on a mac running 13.6.3 (m1 chip)

Expected behavior

The glfw window is not created, but no error is reported

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: macbook pro Mac OS 13.6.3 (m1 chip)

thank you
Tiberiu

Error while running tutorial 10

@jcteng Do you have any idea what the problem is?

Traceback (most recent call last):
  File "tu_10_normal_mapping.py", line 258, in <module>
    textureName=["resources/tu10/diffuse.DDS", "resources/tu10/normal.bmp", "resources/tu10/specular.DDS"]))
  File "/data/wanggu/PoseEst/python-opengl-tutorial/utils/meshViewer.py", line 19, in add_mesh
    self.meshes.append(meshWithRender.makeContext())
  File "/data/wanggu/PoseEst/python-opengl-tutorial/utils/meshViewer.py", line 79, in makeContext
    self.loadTexture()
  File "tu_10_normal_mapping.py", line 168, in loadTexture
    DiffuseTexture = textureLoader(self.textureName[0])
  File "/data/wanggu/PoseEst/python-opengl-tutorial/utils/textureLoader.py", line 94, in __init__
    self.loadDDS(fname)
  File "/data/wanggu/PoseEst/python-opengl-tutorial/utils/textureLoader.py", line 61, in loadDDS
    ddsbuffer[offset:offset + size])
  File "latebind.pyx", line 32, in OpenGL_accelerate.latebind.LateBind.__call__ (src/latebind.c:989)
  File "wrapper.pyx", line 303, in OpenGL_accelerate.wrapper.Wrapper.__call__ (src/wrapper.c:6338)
  File "wrapper.pyx", line 88, in OpenGL_accelerate.wrapper.CArgCalculator.c_call (src/wrapper.c:2984)
  File "wrapper.pyx", line 69, in OpenGL_accelerate.wrapper.CArgCalculatorElement.c_call (src/wrapper.c:2536)
  File "wrapper.pyx", line 66, in OpenGL_accelerate.wrapper.CArgCalculatorElement.c_call (src/wrapper.c:2463)
  File "/data/wanggu/anaconda3/envs/py27/lib/python2.7/site-packages/OpenGL/GL/images.py", line 500, in __call__
    return arrays.ArrayType.arrayByteCount( arg )
AttributeError: ("'module' object has no attribute 'ArrayType'", 6, <OpenGL.platform.baseplatform.glCompressedTexImage2D object at 0x7f4a5e83b8c0>)

AttributeError: 'module' object has no attribute 'vec3'

Hello,

Thanks for your work, it's great effort! Btw, i've a issue when trying to execute the Shading program i get to see error as below

"AttributeError: 'module' object has no attribute 'vec3'"

I'm on Ubuntu 18.04 with Python 2.7. And also most sample tut's are not executing on GLES 3.3. is there any way to fix it up? Please do look into this issue. and help me asap.

Regards,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.