Loading 3d model before blank screen appear.

Started by hemant, September 04, 2014, 06:15:54 AM

Previous topic - Next topic

hemant

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();
      }
   }

EgonOlsen

Isn't that an Android specific question more than it is an engine specific?

AGP

Assuming that you're already using jpct's renderer, find where buffer.clear() is in MyRenderer and call buffer.clear(RGBColor.RED) (for red).