我的顶点坐标是:
GLfloat vertices[]=
{
0.5f,0.5f,0.5f,
-0.5f,0.5f,0.5f,
-0.5f,-0.5f,0.5f,
0.5f,-0.5f,0.5f,//face 1
0.5f,-0.5f,-0.5f,
-0.5f,-0.5f,-0.5f,
-0.5f,0.5f,-0.5f,
0.5f,0.5f,-0.5f,//face 2
0.5f,0.5f,0.5f,
0.5f,-0.5f,0.5f,
0.5f,-0.5f,-0.5f,
0.5f,0.5f,-0.5f,//face 3
-0.5f,0.5f,0.5f,
-0.5f,0.5f,-0.5f,
-0.5f,-0.5f,-0.5f,
-0.5f,-0.5f,0.5f,//face 4
0.5f,0.5f,0.5f,
0.5f,0.5f,-0.5f,
-0.5f,0.5f,-0.5f,
-0.5f,0.5f,0.5f,//face 5
-0.5f,-0.5f,0.5f,
-0.5f,-0.5f,-0.5f,
0.5f,-0.5f,-0.5f,
0.5f,-0.5f,0.5f//face 6
};
现在,我正在通过以下方式更改z坐标:
for(int i=0;i<24;i++)
vertices[i*3+2]*=10
glDepthRange(0,10.0);
现在,由于glDepthRange调用,我希望z坐标将被映射到-0.5到0.5的范围内,并且我能够看到一个合适的立方体,但实际输出却与我注释掉上面的glDepthRange调用时出现扭曲几何图形的输出相同。
(0,1)
:)(再次查看手册 - *窗口深度值始终被视为(0,1)
*)。我猜你可能会觉得它没什么用,但实际上你不应该担心它。 - Bartek Banachewicz