I am using your default code to load 3d model. I put progress bar when loading 3d model.
I face a problem when loading a 3d model. My screen color black.
I want to change screen background color when loading 3d model.
/**
* Loading 3d model task
*/
class ModelLoadingTask extends AsyncTask<Void, Void, Void>
{
@Override
protected void onPreExecute()
{
mProgressDialog = new ProgressDialog(ThreeDWorld.this);
mProgressDialog.setMessage("Loading.. 3D model Please wait");
mProgressDialog.show();
mGLView = new GLSurfaceView(getApplication());
}
@Override
protected Void doInBackground(Void... params)
{
mGLView.setEGLConfigChooser(new GLSurfaceView.EGLConfigChooser()
{
public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display)
{
// Ensure that we get a 16bit framebuffer. Otherwise, we'll fall
// back to Pixelflinger on some device (read: Samsung I7500)
int[] attributes = new int[]
{ EGL10.EGL_DEPTH_SIZE, 16, EGL10.EGL_NONE };
EGLConfig[] configs = new EGLConfig[1];
int[] result = new int[1];
egl.eglChooseConfig(display, attributes, configs, 1, result);
return configs[0];
}
});
mRenderer = new MyRenderer();
mGLView.setRenderer(mRenderer);
return null;
}
@Override
protected void onPostExecute(Void result)
{
mllMain.addView(mGLView);
mProgressDialog.dismiss();
}
}
I face a problem when loading a 3d model. My screen color black.
I want to change screen background color when loading 3d model.
/**
* Loading 3d model task
*/
class ModelLoadingTask extends AsyncTask<Void, Void, Void>
{
@Override
protected void onPreExecute()
{
mProgressDialog = new ProgressDialog(ThreeDWorld.this);
mProgressDialog.setMessage("Loading.. 3D model Please wait");
mProgressDialog.show();
mGLView = new GLSurfaceView(getApplication());
}
@Override
protected Void doInBackground(Void... params)
{
mGLView.setEGLConfigChooser(new GLSurfaceView.EGLConfigChooser()
{
public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display)
{
// Ensure that we get a 16bit framebuffer. Otherwise, we'll fall
// back to Pixelflinger on some device (read: Samsung I7500)
int[] attributes = new int[]
{ EGL10.EGL_DEPTH_SIZE, 16, EGL10.EGL_NONE };
EGLConfig[] configs = new EGLConfig[1];
int[] result = new int[1];
egl.eglChooseConfig(display, attributes, configs, 1, result);
return configs[0];
}
});
mRenderer = new MyRenderer();
mGLView.setRenderer(mRenderer);
return null;
}
@Override
protected void onPostExecute(Void result)
{
mllMain.addView(mGLView);
mProgressDialog.dismiss();
}
}