21

This is a serious question, I am "stuck" at this point between understanding it and not at all. I got very confused with the time reading different resources and would like someone to point me in the right direction.

I am working with Android platform, until now I have used the Canvas, some OpenGL ES 1.0, but mostly through engines or already built code to try and understand it.

My goal is to ACTUALLY understand OpenGL ES 2.0. I do not want to go straight to the complicated stuff and start with easy stuff, but I just don't get how to do it. I can get a square, and I can set up a camera and matrices; to tell you the truth I really don't understand the whole matrix system and how it works, if I am right it was a fixed-function-pipeline which you didn't need to change in OpenGL ES 1.0 but now it's a programmable-pipeline which you have to set up on your own.

I do not get how to use the coordinate system, I know that the origin is the center of the device and each turn to the edge is 1, so from center to left it would be negative 1.

There were some ways however to make it into a different coordinate system, maybe just use proportions or multiply matrices to set the coordination to something that I was used to from the Canvas.

Basically what I need help with is how do I progress from here? I feel as if I got to somewhere, but I am still nowhere.

I really need some advises on how to properly use OpenGL ES 2.0, for now all I am planning on is a simple 2D game, maybe side scroll-er too so I will have to mess with the camera matrices.

Thank you for your time, I will greatly appreciate any help.

*I am less interested in the transformation matrices since I do not think that 2D game would really use that, maybe only when I mirror the character's sprite so it would look as if he is walking in a different direction, but I'm pretty sure this is possible to be made simple by changing the coordination and width.

Patt Mehta
  • 4,110
  • 1
  • 23
  • 47
Baruch
  • 1,618
  • 5
  • 23
  • 42
  • If you are doing a 2D game, why do you want to use OpenGL ES 2.0? (I'm hoping you know why) Have you considered using the AndEngine? http://www.andengine.org/ – HalR Apr 13 '13 at 02:48
  • 1
    I want to use the OpenGL ES 2.0 since it is good for my future projects, and since i the game that i am planning to work on currently is 2d i was thinking why not start it out using the Open GL es 2.0 library and learn from it, i did use andengine, but you dont really need to "know" openGL ES to use it, and if i am not mistaken it uses 1.0/1.1. and long story short, i want to start it out as a simple project and maybe end up with a big engine that will be able to create games in 3d and 2d. – Baruch Apr 13 '13 at 02:56
  • Also, as for the matrices and transformations, a strong education in Math is pretty useful. – HalR Apr 13 '13 at 03:04
  • 4
    I prefer using OpenGL ES 2.0 directly since i will learn it this way and not just another engine, because eventually i want to make my own engine, and i want it to be based directly on OpenGL ES 2.0 and be made around my needs on the time if you understand what i mean, and as for transformation, I am pretty good for math and always try to find a way to improve and learn more about it too, but as for now, a 2d game doesnt really use it that much so im keeping it for later. – Baruch Apr 13 '13 at 17:28
  • and to be more specific, the main thing i want to learn right now is use of camera in 2d space, and how to change the view and add gui in the opengl game – Baruch Apr 13 '13 at 17:38

7 Answers7

8

There is a lack of decent openGL ES 2.0 Android / Java specific tutorials out there, but they are out there somewhere.

Check this one out, should help you :-)

http://www.learnopengles.com/android-lesson-one-getting-started/

For making a 2d game with OGL, you will basically ignore the z axis and just work with x and y. It is confusing at first, but stick with it.

Good luck.

Zippy
  • 3,826
  • 5
  • 43
  • 96
  • I found this book from Pragmatic Programmers excellent in learning how to use OpenGLES2.0. It was share joy to read. Check it out. https://doc.lagout.org/programmation/OpenGL/OpenGL%20ES%202%20for%20Android_%20A%20Quick-Start%20Guide%20%5BBrothaler%202013-07-06%5D.pdf – Lexo Aug 26 '21 at 03:03
5

You can use this book by Prateek Mehta. Everything is explained in very simple terms. Good for understanding basic OpenGL ES 2.0 and GLSL programming.

Patt Mehta
  • 4,110
  • 1
  • 23
  • 47
Ikhurana
  • 154
  • 1
  • 7
3

I found this website off the Khronos Group website:

Khronos resources And some sample code you can download for android here

The Zeus website has 25 OpenGL ES 2.0 code, I think it's a copy like the glut tutorials, but for ES 2.0.

I hope this can simplify things, I'm trying to learn OpenGL ES 2.0, you may see many of my posts in the future on 2.0 (asking questions), just to let you know.

jaysonpowers
  • 290
  • 2
  • 3
  • 16
  • i see that most of the projects and source codes are using more than just java. I want to use just java for my projects without cpp or something like that. – Baruch Apr 13 '13 at 18:12
2

I've found this extended online tutorial to be excellent, not only for the OpenGL specifics but for the underlying graphics concepts, which is of course the hard part. Very clear exposition of the different coordinate spaces you will typically be concerned with.

4bar
  • 531
  • 2
  • 14
1

I found this free course very interesting. It's about the WebGL but it's not specific to it at all (I think they just used it because it simplifies the learning experience since you don't have to set-up anything). Lecturer gives great examples and explains the math behind the concepts in detail.

https://www.udacity.com/course/cs291

Igor Čordaš
  • 5,785
  • 4
  • 42
  • 54
0

It is a long road, but there may be different roads towards the same goal. The other posters have described some, but I believe the best road towards GLES2 knowledge lies in the interaction between modeling something in a modeling program (blender, ...) and reproducing the same result on your mobile device or desktop computer. Just model something, such as terrain, ocean surface ... in the modeling program, perhaps not as beautifully as a pro modeler would, then reproduce it with GLES2. Sound tough perhaps, but in my experience, it is the best way. To help you do it, ask questions here on SO, read books, tuts, ...

user1095108
  • 14,119
  • 9
  • 58
  • 116
0

I am new to OpenGL and while searching for tutorial i find this website which provide me a great help A real Open GL ES 2.0 2D
Also check

A real Open GL ES 2.0 2D tutorial part 1: Rendering a triangle
A real Open GL ES 2.0 2D tutorial part 2: Rendering an Images
A real Open GL ES 2.0 2D tutorial part 3: Handling Input
A real Open GL ES 2.0 2D tutorial part 4: Transforming Images
A real Open GL ES 2.0 2D tutorial part 5: Knowing the OpenGL texture system
A real Open GL ES 2.0 2D tutorial part 6: Screens and dimensions
A real Open GL ES 2.0 2D tutorial part 7: Texture Atlas
A real Open GL ES 2.0 2D tutorial part 8: Rendering Text

Hope this website helps you all.
Other website present above are also helpful.
Checkout those too .

Ravikant Paudel
  • 2,228
  • 2
  • 17
  • 28