I'm very glad that you can see this. I hope you can learn something from here.
This repo is to demonstrate how to build a 3D world from scratch. Here I'm gonna use OpenGL|ES 3.0 to build the entire stuff. You can try it if you have an Android device which supports OpenGL|ES 3.0.
The best way to learn how to set up environment is to download a sample from Android developer site and use that as a template. To render the simplest thing such as a triangle, you need at least to do the following:
- Set up EGL which provides rendering context for OpenGL ES.
- Set up view port.
- Set up vertex and fragment shaders.
- Compile and link shaders to a program which is used by OpenGL ES.
- Create and bind a vertices array to that contains vertices of a triangle.
- At last, invoke draw command to render.
A camera has following properties:
- Position.
- Look direction.
- Near and far distance.
The actions we'll take is to convert camera specification into perspective view matrix, then transform perspective view matrix to standard view volume.