Search code examples
androidopengl-es3d

Android 3D Game Development


I am a new game developer and have started developing game for android.
I have followed basic tutorials and able to draw a 3D object onto the screen.
I want to draw the scene in game like the background and other objects along with the player object.
Please suggest how can I achieve this using opengl. I am not using any of the libraries. I have started opengl development from scratch.
Thanks.


Solution

  • This is a very abstract question, although there are several ways to go if you want to make a scene in which a player can move around.

    In this answer, I'm assuming you have knowledge and control over the vertex, index, texture, color and normal processes when you are creating your model in code.

    • Use a 3D program to model your world. This 3D model should contain information about vertices, indices, texture coords, colors and normals. At runtime, your application applies the information from your model file into regular vertex arrays.

    • Generate a scene by using an image (usually a grayscale image) and let, for example, black represent the lowest point and white the tallest point. Then use a texture that describes the landscape and uv the texture to the landscape, and further more, apply the colors to the landscape in order to get, for example, black describing the pits and white describing the top of the mountains.

    These techniques are usually the ones I use, however, a quick Google search for "terrain generation OpenGL" or "heightfield terrain OpenGL" will give you a good start. I'm also aware that there are several models out on the web that are ready for use.