Author Topic: Loading 3d model before blank screen appear.  (Read 647 times)

Offline hemant

  • byte
  • *
  • Posts: 4
    • View Profile
Loading 3d model before blank screen appear.
« on: September 04, 2014, 06:15:54 am »
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();
      }
   }

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11771
    • View Profile
    • http://www.jpct.net
Re: Loading 3d model before blank screen appear.
« Reply #1 on: September 04, 2014, 08:31:32 am »
Isn't that an Android specific question more than it is an engine specific?

Offline AGP

  • quad
  • ******
  • Posts: 1525
    • View Profile
Re: Loading 3d model before blank screen appear.
« Reply #2 on: September 04, 2014, 08:33:21 am »
Assuming that you're already using jpct's renderer, find where buffer.clear() is in MyRenderer and call buffer.clear(RGBColor.RED) (for red).