Page 1 of 1

How to use OpenGL

Posted: Sat Aug 19, 2017 12:53 am
by Hiddenworlds225
Hello I recently upgraded my sd card to a larger size and I decided that i want to try out OpenGL....But without SIMPLE CODE I seem to not understand, although i'm an experienced programmer myself. Now I looked at forums after forums to get started but when I was looking through the code they created I was like " :shock: ........WHAT DOES THIS EVEN MEAN??????????" Even though it said "Beginner", So thus i'm here.

Basically all that i'm asking is for templates and code-understanding words. But I do know about the samples they give (opt/vc/src) but how the heck should i know what i'm doing, i never touched this stuff :| .

Thanks for the help, if i don't rely for a while don't worry :) , i'm in school.

Re: How to use OpenGL

Posted: Sat Aug 19, 2017 6:43 am
by ghans
Which programming languages do you know ?

ghans

Re: How to use OpenGL

Posted: Wed Aug 23, 2017 3:56 pm
by Hiddenworlds225
Sorry for the long wait my internet died and its provider wouldn't come :( so I'm doing this at school but I know python, c#, lua, and a few others I can't remember because of hunger

Re: How to use OpenGL

Posted: Thu Aug 24, 2017 1:09 pm
by derhass
In my experience, one of the main hurdles for low-level graphic programming is the math. You really need some understanding of linear algebra, matrices and vectors.

And OpenGL is another beast of its own. To make matters worse, there are many different "flavors" of OpenGL. WIth desktop GL, there are the old, legacy ways from 20 years ago, which don't match todays hardware at all, and the modern (with "modern" meaning here just a decade old) way using the programmable pipeline. For embedded devices, like the raspberry pi, there are the OpenGL ES versions, with ES1.x basically using this old stuff, and 2.x being more like modern GL (but way more limited). Now the Pi does "natively" Support ES 1.x and 2.x, and with the new driver stack also desktop GL to a certain extent.

For a beginner, the multitude of options will be very confusion. If you really want to learn OpenGL, I can only recommend learning the modern way, using at least GLES 2.0 or desktop GL 2.0,. Unfortuinately, since GL is 25 years old now, there are lots of internet resources which are now outdated, teaching deprecated GL (for eaxmple, the presence of functions like glBegin, glLoadIdentity or glVertexPointer is a sure sign of outdated code).
For modern desktop GL, I would recommend the follwoing tutorials: The problem here is that these tutorials require OpenGL 3.2 core profile, which the Pi does not support. So I'm sorry, but I can't really recommend any good tutorial at all...

Re: How to use OpenGL

Posted: Thu Aug 24, 2017 11:45 pm
by Hiddenworlds225
Thanks for pointing me in a direction that i can follow! If there is like a command book that is "modern" that I can use, That would be great, because I seem to get better using the code that way. :D :geek: :ugeek:

Re: How to use OpenGL

Posted: Fri Aug 25, 2017 6:35 am
by karrika
If you like Python there is also the Kivy libraries that hide the OpenGL and let you program 3D stuff in Python.

https://www.youtube.com/watch?v=halh-UMpYDU

I am currently experimenting in old fashioned displays like a gyro compass on a vessel. This was run on Kivy and recorded to a video. The design is basically just two rotating disks. The smaller disk rotates 10 times faster than the larger disk. Gives a nice feeling of turning speed.
Image

And a link to the video file of the compass http://79.125.115.174/pics/00_slimCompass.mpg

Re: How to use OpenGL

Posted: Thu Aug 31, 2017 4:18 pm
by Hiddenworlds225
thanks for that ill look into it
:)

Re: How to use OpenGL

Posted: Thu Sep 07, 2017 4:27 am
by Gavinmc42
LdB is trying to do this in the baremetal forum
http://www.mbsoftworks.sk/index.php?pag ... s&series=1
Not sure if there is a nice Linux tut version.

Maybe this
https://github.com/peepo/openGL-RPi-tutorial

Older stuff is the OpenGLES python wrapper
https://pi3d.github.io/html/ReadMe.html ... xplanation

OpenGL is pretty new on Pi's.
Some games work now, maybe look at porting OpenGL games.
Grab a OpenGL game book and see if code compiles?

Re: How to use OpenGL

Posted: Thu Sep 07, 2017 12:01 pm
by Gavinmc42

Re: How to use OpenGL

Posted: Thu Sep 07, 2017 10:45 pm
by paddyg
I attempted to explain 3D graphics with OpenGL(ES2) and pi3d here. As @derhass says: being comfortable with vectors and matrices will help enormously if you want to understand the low level stuff.

Re: How to use OpenGL

Posted: Wed Sep 13, 2017 3:54 pm
by Hiddenworlds225
Thanks guys ill look into them to see if it makes sense to me :)