简体   繁体   English

没有GLkit的OpenGL ES。 GLKMatrix的类似物和纯OpenGL ES中的功能

[英]OpenGL ES without GLkit. Analogs for GLKMatrix and functions in pure OpenGL ES

Im learning opengl es 2.0 by books and guides in the internet. 我通过互联网上的书籍和指南学习opengl es 2.0。 BUT! 但! All examples (like a standart example in XCODE) have GLkit. 所有示例(例如XCODE中的标准示例)都具有GLkit。

For example: GLKMatrix4, GLKMatrix3, GLKView types and functions. 例如:GLKMatrix4,GLKMatrix3,GLKView类型和函数。

But i have to use pure OpenGL without GLKIT. 但是我必须使用没有GLKIT的纯OpenGL。 Does OpenGL ES have itself analogs for this types and functions or i must implement it by myself ? OpenGL ES是否具有这种类型和功能的类似物,还是我必须自己实现?

Thx for answer Andon. 谢谢答案安东。 Can i write code for this types and functions by myself or its a hard work and only choice - using GLKIT? 我可以自己编写这种类型和功能的代码,还是只能使用GLKIT进行艰苦而唯一的选择?

As @Andon noted, there are no vector/matrix math features in OpenGL ES 2.0 and later. 正如@Andon所指出的那样,OpenGL ES 2.0及更高版本中没有向量/矩阵数学功能。 (And at this point you really shouldn't be writing ES 1.1 code anymore.) There are many ways of filling in the missing pieces, of which Apple's GLKit math library is one. (现在,您真的不应该再编写ES 1.1代码。)有很多方法可以填补缺失的部分,其中Apple的GLKit数学库就是其中一种。

You could write your own math library for these functions -- it's a great educational exercise. 您可以为这些功能编写自己的数学库-这是一次很棒的教育活动。 Here's a university course that does a pretty good job of covering the requisite math and showing the equivalent C code. 这是一门大学课程 ,在涵盖必要的数学并显示等效的C代码方面做得很好。

However, in the graphics programming world, there's often a big difference between code that's easy to grok and code that runs fast on your target device. 但是,在图形编程世界中,易于抓取的代码与在目标设备上快速运行的代码之间通常会有很大的差异。 So, while educational exercises are great for educational purposes, for real work you're probably better off using someone else's math library. 因此,尽管教育性练习对于教育目的非常有用,但对于实际工作而言,最好使用他人的数学库。 GLM is a popular one if you're doing cross-platform work in C++. 如果您正在C ++中进行跨平台工作,那么GLM是一种受欢迎的工具。 If you're targeting iOS, GLKit is a good choice -- Apple's done the work of making sure it runs fast on iOS devices. 如果您的目标是iOS,则GLKit是一个不错的选择-Apple已完成确保其在iOS设备上快速运行的工作。 (If you look at the headers you'll notice many of the functions are inline and use ARM NEON vector instructions.) (如果查看标题,您会发现许多函数是内联的,并使用ARM NEON向量指令。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM