Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/186.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android上OpenGL ES 2.0中的frustumM/setLookAtM_Android_Opengl Es 2.0_Frustum - Fatal编程技术网

Android上OpenGL ES 2.0中的frustumM/setLookAtM

Android上OpenGL ES 2.0中的frustumM/setLookAtM,android,opengl-es-2.0,frustum,Android,Opengl Es 2.0,Frustum,我正在Android平台上玩OpenGL,使用OpenGL ES 2.0教程作为基础。有关守则是: public void onSurfaceChanged( GL10 unused, int width, int height ) { GLES20.glViewport( 0, 0, width, height ); float ratio = (float) width / height; Matrix.frustumM( mProjMatrix, 0, -ratio,

我正在Android平台上玩OpenGL,使用OpenGL ES 2.0教程作为基础。有关守则是:

public void onSurfaceChanged( GL10 unused, int width, int height )
{   GLES20.glViewport( 0, 0, width, height );

    float ratio = (float) width / height;
    Matrix.frustumM( mProjMatrix, 0, -ratio, ratio, -1, 1, 1,  9.9999f );

    Matrix.setLookAtM( mVMatrix, 0, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f,  0.0f, 0.0f, 1.0f,  0.0f );

    muMVPMatrixHandle = GLES20.glGetUniformLocation( mProgram, "uMVPMatrix" );
}
特别是,将“远”参数设置为平截头体。只要该参数为10,图像(三角形)就不会出现。任何其他值都可以。为什么?

我读了不少书,都没用。甚至我的朋友(又名谷歌)也没能帮助我


提前感谢。

计算投影矩阵时,指定远平面为9.9999f, 这就是为什么在视图矩阵计算中eyeZ值为10或更大将导致空图像的原因。你正在看你的平截头台外面


请看这篇文章:

计算投影矩阵时,指定远平面为9.9999f, 这就是为什么在视图矩阵计算中eyeZ值为10或更大将导致空图像的原因。你正在看你的平截头台外面


请看这篇文章:

谢谢你的回复,但我的问题没有我想的那么清楚。当'far'参数为9或11时,一切正常。只有当参数为10时,三角形才会出现。我遗漏了什么?谢谢你的回答,但我的问题没有我想的那么清楚。当'far'参数为9或11时,一切正常。只有当参数为10时,三角形才会出现。我错过了什么?