OpenGL ES 1.1 2D (iPhone):调整一组纹理/矩形对象的大小
我正在尝试将 OpneGL ES 在屏幕上显示的内容的大小调整为一个因子。
更清楚地说,我试图按一个因子调整图层的大小,以便与该图层关联的所有对象都按该因子调整大小。
- 假设我有 2 个图像:image_1 的大小:100x100 和 image_2 的大小:50x50。两者都在layer_1中。
-我将layer_1大小设置为0.5。
- image_1 和 image_2 应分别调整为 50x50 和 25x25。
-图像应绘制在新的调整大小的位置。
我已经能够通过在CPU上进行一些计算来实现这种效果。 我想知道是否有办法在GPU上做到这一点。类似于绘制空纹理之类的东西。 OpenGL ES 1.1 可以吗?我对 OpenGL 和图形还很陌生。
I'm trying to resize whats being displayed by OpneGL ES on the screen by a factor equally.
More clearly, i'm trying to resize a layer by a factor, so that all the objects associated with that layer are resized by that factor.
-Suppose i have 2 images:image_1 of size:100x100 and image_2 of size:50x50. Both in layer_1.
-I set the layer_1 size to 0.5.
-The image_1 and image_2 should resize to 50x50 and 25x25 respectively.
-The images should be drawn in a new resized position.
I've been able to achieve this effect by doing some calculations on the CPU.
I would like to know if there is a way to do it on the GPU. Something like drawing to an empty texture. Is it possible with OpenGL ES 1.1? I'm quite new to OpenGL and graphics.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你无法在 GPU 上计算比例。所以据我所知,你必须在CPU上进行计算。
对于 OpenGL 来说,绘图的大部分是由 GPU 处理的,而大多数计算是由 CPU 处理的。
I don't think you will be able to calculate the scale on the GPU. So you will have to do calculations on the CPU as far as I know.
For the most part with OpenGL the drawing is handled with the GPU while most calculations are handled with the CPU.