Hiddenworlds225
Posts: 8
Joined: Tue Jul 04, 2017 8:26 pm

How to use OpenGL

Sat Aug 19, 2017 12:53 am

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.

ghans
Posts: 7435
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: How to use OpenGL

Sat Aug 19, 2017 6:43 am

Which programming languages do you know ?

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Hiddenworlds225
Posts: 8
Joined: Tue Jul 04, 2017 8:26 pm

Re: How to use OpenGL

Wed Aug 23, 2017 3:56 pm

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

User avatar
derhass
Posts: 32
Joined: Thu Aug 09, 2012 4:33 pm
Location: Germany
Contact: Website

Re: How to use OpenGL

Thu Aug 24, 2017 1:09 pm

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...
"Perfection is attained not when there is nothing more to add, but when there is nothing more to remove." -- Antoine de Saint Exupéry

Hiddenworlds225
Posts: 8
Joined: Tue Jul 04, 2017 8:26 pm

Re: How to use OpenGL

Thu Aug 24, 2017 11:45 pm

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:

User avatar
karrika
Posts: 952
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: How to use OpenGL

Fri Aug 25, 2017 6:35 am

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

Hiddenworlds225
Posts: 8
Joined: Tue Jul 04, 2017 8:26 pm

Re: How to use OpenGL

Thu Aug 31, 2017 4:18 pm

thanks for that ill look into it
:)

User avatar
Gavinmc42
Posts: 1552
Joined: Wed Aug 28, 2013 3:31 am

Re: How to use OpenGL

Thu Sep 07, 2017 4:27 am

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?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
Gavinmc42
Posts: 1552
Joined: Wed Aug 28, 2013 3:31 am

Re: How to use OpenGL

Thu Sep 07, 2017 12:01 pm

I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
paddyg
Posts: 2013
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: How to use OpenGL

Thu Sep 07, 2017 10:45 pm

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.
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

Hiddenworlds225
Posts: 8
Joined: Tue Jul 04, 2017 8:26 pm

Re: How to use OpenGL

Wed Sep 13, 2017 3:54 pm

Thanks guys ill look into them to see if it makes sense to me :)

Return to “OpenGLES”

Who is online

Users browsing this forum: No registered users and 1 guest