Egon, this is what the Rajawali engine does onSurfaceChanged():
public void onSurfaceChanged(GL10 gl, int width, int height) {
mViewportWidth = width;
mViewportHeight = height;
mCamera.setProjectionMatrix(width, height);
GLES20.glViewport(0, 0, width, height);
}
And this is the camera setProjectionMatrix() method referenced above:
public void setProjectionMatrix(int width, int height) {
float ratio = (float) width / height;
float frustumH = MathUtil.tan(getFieldOfView() / 360.0f * MathUtil.PI) * getNearPlane();
float frustumW = frustumH * ratio;
Matrix.frustumM(mProjMatrix, 0, -frustumW, frustumW, -frustumH,
frustumH, getNearPlane(), getFarPlane());
}
Can I replicate this in JPCT-AE ?