Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 794
Ashwini Shahapurkar Avatar asked Jul 19 '11 08:07

Ashwini Shahapurkar


2 Answers

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.

like image 179
Wroclai Avatar answered Oct 18 '22 21:10

Wroclai


It is probably a better idea for you to learn a game engine like Unity3D or UDK rather than to attempt this from scratch.

http://www.unity3d.com/

Download the engine and do the tutorials. It comes with free 3d assets to so making a first game is fairly easy. You can then deploy it in Flash, PC, Mac for free. and if they are successful there then you can pay to distribute for Android, iPhone, PS3, xBox, and Wii...

EDIT: They now allow you to publish to Android and iPhone for free if you don't care about the pro features. The nice thing is code I write once is able to deploy on so many platforms. It makes a lot of sense.

Also there is a new one out there made by the Havok engine guys called project anarchy.

Good Luck.

like image 26
Chris Lucian Avatar answered Oct 18 '22 20:10

Chris Lucian