in app/src/main/java/com/facebook/sample/SampleGLTFView.java [129:150]
private void onSurfaceAvailable(SurfaceTexture surfaceTexture, int width, int height) {
Log.d(TAG, "onSurfaceAvailable w: " + width + " h: " + height);
eglRenderTarget.createRenderSurface(surfaceTexture);
Choreographer.getInstance().postFrameCallback(frameCallback);
GLES20.glViewport(0, 0, width, height);
GLHelpers.checkGlError("glViewport");
aspectRatio = (float) width / height;
Matrix.perspectiveM(projectionMatrix, 0, FOVY, aspectRatio, Z_NEAR, Z_FAR);
Matrix.setIdentityM(viewMatrix, 0);
Matrix.setIdentityM(modelMatrix, 0);
GLES20.glClearColor(1.f, 1.f, 1.f, 1.f);
try {
gltfObject.createOnGlThread(context, "helloworld.gltf");
} catch (IOException e) {
Log.e(TAG, e.getMessage());
}
}