0
我下载了一个显示带有某种纹理的正方形的项目。广场目前位于屏幕底部附近,我想将它移动到中间位置。这是代码。如何更改渲染对象放置在屏幕上的位置,OpenGL Es 2.0 iOS
Geometry.h
#import "GLKit/GLKit.h"
#ifndef Geometry_h
#define Geometry_h
typedef struct {
float Position[3];
float Color[4];
float TexCoord[2];
float Normal[3];
} Vertex
typedef struct{
int x;
int y;
int z;
} Position;
extern const Vertex VerticesCube[24];
extern const GLubyte IndicesTrianglesCube[36];
#endif
这里是geometry.m代码
const Vertex VerticesCube[] = {
// Front
{{1, -1, 1}, {1, 0, 0, 1}, {0, 1}, {0, 0, 1}},
{{1, 1, 1}, {0, 1, 0, 1}, {0, 2.0/3.0}, {0, 0, 1}},
{{-1, 1, 1}, {0, 0, 1, 1}, {1.0/3.0, 2.0/3.0}, {0, 0, 1}},
{{-1, -1, 1}, {0, 0, 0, 1}, {1.0/3.0, 1}, {0, 0, 1}},
};
const GLubyte IndicesTrianglesCube[] =
{
// Front
0, 1, 2,
2, 3, 0,
}
什么部分的代码的确定屏幕上所呈现的对象的位置?
非常感谢。我还有一个问题,如果你能帮助我,那会很棒。 http://stackoverflow.com/questions/35873388/cannot-set-custom-class-to-glkview-inside-uiview –