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

请帮我理解逻辑!

最佳答案

我发现 一个非常清楚的 解释!

观看此 tutorial,您将在 18:00 看到答案

关于objective-c - OpenGLES 添加投影,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/13507602/

10-12 03:36