Hi, I share this .blends: https://drive.google.com/file/d/0B3GouQIyoCmrNFNnVGljd0RfTEE/view?usp=sharing
to see different ways to draw a triangle with bgl and shade it with a GLSL shader.
Thanks for the help of HG1.
- Immediate mode
- Using glGenList, glNewList, glCallList
- With glDrawElements (Vertex Arrays) (the most modern way. Except vbo that aren’t supported in bgl)
- With glDrawArrays (Vertex Arrays)
This can of course be used to draw more complex polygons with better shaders
For noobs like me
More infos here: http://www.songho.ca/opengl/gl_vertexarray.html
EDIT: A shaded sphere: https://drive.google.com/file/d/0B3GouQIyoCmrbTRGWDlKRmdGNzg/view?usp=sharing (with just a simplified diffuse) The original model of the sphere is hidden (alt+H to unhide). The sphere is in fact a subdivided cube to have only quads.
EDIT2: movingSphere: https://drive.google.com/file/d/0B3GouQIyoCmrV25wQ3gzaFRxb1U/view?usp=sharing