【问题标题】:OpenGLES adding a projectionOpenGLES添加投影
【发布时间】:2012-11-10 13:12:58
【问题描述】:

我开始学习 OpenGLES,目前我正在阅读这个TUTORIAL

我已经到了添加投影段,我被困在那里:

// Add to render, right before the call to glViewport
CC3GLMatrix *projection = [CC3GLMatrix matrix];
float h = 4.0f * self.frame.size.height / self.frame.size.width;
[projection populateFromFrustumLeft:-2 andRight:2 andBottom:-h/2 andTop:h/2 andNear:4 andFar:10];
glUniformMatrix4fv(_projectionUniform, 1, 0, projection.glMatrix);

// Modify vertices so they are within projection near/far planes
const Vertex Vertices[] = {
    {{1, -1, -7}, {1, 0, 0, 1}},
    {{1, 1, -7}, {0, 1, 0, 1}},
    {{-1, 1, -7}, {0, 0, 1, 1}},
    {{-1, -1, -7}, {0, 0, 0, 1}}
};

作者在populateFromFrustumLeft...中使用了一些变量,并没有解释。我想了解变量选择的逻辑以便将来能够使用此功能。

请帮助我理解逻辑!

【问题讨论】:

    标签: objective-c ios opengl-es-2.0 projection-matrix


    【解决方案1】:

    我找到了很清楚的解释!

    观看此tutorial,您将在 18:00

    看到答案

    【讨论】:

      猜你喜欢
      • 2017-09-09
      • 1970-01-01
      • 1970-01-01
      • 2011-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-04
      相关资源
      最近更新 更多