Android的3D游戏开发游戏开发、Android

2023-09-08 10:26:12 作者:安之若素ら

我是一个新的游戏开发者,并已开始开发游戏为Android。 我按照基本教程,并能够绘制3D物体在屏幕上。 我想画的场景在游戏中喜欢的背景,并随着玩家对象的其他对象。 请建议我怎么能做到这一点使用的OpenGL。我没有使用任何的库。我已经开始OpenGL开发从无到有。 谢谢你。

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.

推荐答案

这是一个很抽象的问题,虽然有几种方法可以去,如果你想使一个的场景的其中一名球员可以走动。

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.

在这个答案,我假设你拥有的知识和控制顶点,索引,质地,颜色和正常的过程,当你创建在code型。

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.

使用一个3D程序来模拟你的世界。这个3D模型应当包含顶点,索引,COORDS质地,颜色和法线信息。在运行时,您的应用程序从应用模型文件到正规顶点数组的信息。

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.

通过使用图像(通常为灰度图像)生成一个场景,并让,例如,黑重新present最低点和白最高点。然后使用描述景观和UV纹理的景观,并进一步纹理,运用色彩的景观,以获得,例如黑色描述坑和白色描述的山顶上。

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.

这些技术通常是那些我用的,然而,一个快速谷歌搜索的地形生成的OpenGL 的或 heightfield地形的OpenGL 的会给你一个良好的开端。我也知道,有多种型号出在网络上是可以使用了。

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.