问题描述
我做了一个1:iOS应用MohrenJass到Android的1份。
- >奥地利Cardgame ..良好的培训例子:)
很好的介绍活动,视图,帆布,preference,API等
现在,我完成从开发者页面的OpenGL ES样品。
我读到的OpenGL,但我有一个疑问的。
有真的在它的一些点,谁给我一些艰难的时刻。
矩阵,顶点着色器,片段,投影,摄像头,...
它不是我不明白,但只知道这样做时
是不够的,在搜索code错误...
I done a 1:1 copy of the iOS App "MohrenJass" to Android. -> Austria Cardgame.. Good training example :)Good introduction to Activity, Views, Canvas, Preference, APIs, and moreNow i done the OpenGL ES Sample from the Developer page.I read about OpenGL but i have a Question about it.There are realy some points in it who give me some hard times.Matrix, vertex, shader, fragment, projection, camera,...Its not that i not understand it, but only to know "do this when that"is not enough for searching errors in code...
我想尝试旁边的ReplicaIsland code,
但我应该开始用OpenGL第一?
I think about trying the ReplicaIsland code next,but should i start with OpenGL first?
我发现这来来往往的OpenGL - > preFER它,因为它的德国
(不知道它可能与我所知的立场)
I found this fro OpenGL -> Prefer it because its germanhttp://wiki.delphigl.com/index.php/Hauptseite(Dont know if its possible with my stand of knowledge)
也发现了这个
或跳过这一点,并进入ReplicaIsland?
从实践中学习始终是一个很好的方式,
但有时它在我脸上一拳......
Or skip this and go into ReplicaIsland?Learning by doing was always a good way,but sometimes its a punch in my face...
我不会去尝试下一个简单的2D应用。
一个广场上走左/右,跳了其他广场或财产以后之上。
只有学习有一天能达到我的目标真的创建一个应用程序:)
I wont to try next a simple 2D Application.A Square to go left/ right, jump above a other Square or somthing.Only for learning to reach someday my target of realy create a App :)
我也看了一些关于团结,但我认为它没有办法的办法,我应该启动。
可能的,如果我知道我在做什么话就用得容易...
嗯..我希望你有任何的窍门我!
I also read something about Unity, but i think its not the way i should start that.Possible if i know what i am doing it will get with it easy...Well.. I hope you have any tipps for me!
推荐答案
对于库,如统一或科科斯2D和这样您将能够更快地启动你的应用程序,但它们通常在一个点限制你的能力,作为一个开发者或其他。如果这是一个用于创建一个简单的游戏的目的,那么你应该去了。如果目标是获得尽可能多的知识可能,我建议你尝试了OpenGL。这是不容易的,它不会随着时间的推移更容易,但它是值得的。如果你后来转向一些图书馆一切都会像白天一样清晰。
As for libraries such as Unity or Cocos 2D and such you will be able to start with your application quicker but they usually limit your capabilities as a developer at one point or another. If this is for a purpose of creating a simple game then you should go for it. If the goal is to get as much knowledge as possible I suggest you try the openGL. It is not easy and it does not get easier over time but it is worth it. And if you later turn to some library everything will be as clear as day.
所以有关的教程和例子还有一个事实,他们在大多数情况下产生误导。事情是怎么做的,但code结构将完全不可维护的,他们会向你解释。如果你想有一个好的code,可以帮助你在一段时间你应该创建一个简单的调试现场,你可以再加入后你期望需要的组件开始。例如,你应该创建一个可以包含稍后应该扩展到包括高速缓存,如纹理的OpenGL上下文类,着色......那么你应该有一个包含你画到视图,帧缓冲区中类和渲染缓冲区你使用就可以了。它应该包含所有必要的工具,以初始化,启用深度缓冲,模板缓冲,presenting内容......所有这些,更可以从示例和教程贴或多或少,所有你需要做的是重组他们。这将是您的基本结构,你将能够创造出所有的组件绘制和present,但不能用它画。为了测试这一切你能做的就是尽量清除缓冲区到某一值时,看看你是否得到预期的结果。
So about the tutorials and examples there is a fact that they are in most cases misleading. They will explain to you how something is done but the code structure will be completely unmaintainable. If you want a good code that will help you over time you should begin with creating a simple "debug" scene to which you can then add components you later expect to need. For instance you should create a class that can contain an openGL context which should later be extended to include caches such as textures, shaders... Then you should have a class containing the view you draw to, the frame buffer and the render buffers you use on it. It should contain all the necessary tools to initialize with view, enable depth buffers, stencil buffers, presenting the content... All of these and more can be more or less pasted from examples and tutorials, all you need to do is restructure them. This would be your base construct as you will be able to create all components to draw and present but can not draw with it. To test it all you can do is try to clear the buffer to some value and see if you get the expected result.
在此之后,有趣的部分开始:创建类来处理和编译着色器,类创建从图像中,矩阵栈,维也纳组织......纹理同样所有这些都可以从网上粘贴,但需要调整
After this the fun part begins: Creating the classes to handle and compile shaders, classes to create textures from images, matrix stacks, VBOs... Again all of these can be pasted from web but need restructuring.
所以,当你拥有所有你可以真正开始游戏本身这个工作所需的工具。此时,大多数人拿错了弯。尝试创建包含所有你需要present某一个元素在你的游戏中的数据对象。比如你有与位置定义的字符
,速度
和图像(质地
)。然后,这个对象可以有一个画
方法和移动
方法。在画
方法将使用位置
到矩阵转换,将产生或重用某些顶点数据,结合相应的纹理
键,简单地画本身。在移动
在这种情况下,将只使用速度
更改位置
。当你进入更深更多的组件通常添加,情况可能很复杂。但是想象一下,只有有我写的上面,您可以创建3张图片:人物,敌人,子弹;然后,你需要随时与此图像创造尽可能多的对象,移动它们,请你,请创建碰撞检测(这是与此数据非常简单),你有一个简单的游戏,可以通过添加仅变得非常先进的很快一些小技巧。
So when you have all this necessary tools you can actually start working on the game itself. At this point most people take the wrong turn. Try to create objects that contain all the data you need to present a certain element in your game. For instance you have a character which is defined with a location
, speed
and an image (texture
). This object can then have a draw
method and a move
method. The draw
method will use the location
to translate the matrix, will generate or reuse some vertex data, bind the appropriate texture
and simply draw itself. The move
in this case will only use the speed
to change the location
. As you go deeper more components are usually added and the situation can get complicated. But imagine only having what I wrote above you can create 3 images: character, enemy, bullet; then create as many objects as you need at any time with this images, move them around as you please, create crash detecting (which is very simple with this data) and you have a simple game which can become very advanced very quickly only by adding a few tricks.
这篇关于OpenGL ES的启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!