3

我开始学习 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...并没有解释它们。我想了解变量选择的逻辑,以便将来能够使用此功能。

请帮助我理解逻辑!

4

1 回答 1

2

我找到了一个非常明确的解释!

观看本教程,您将在18:00看到答案

于 2012-11-22T08:30:53.250 回答