Author Topic: how to set frame buffer in GLES20 in vuforia  (Read 2566 times)

Offline nima.sh23

  • byte
  • *
  • Posts: 40
    • View Profile
how to set frame buffer in GLES20 in vuforia
« on: February 12, 2015, 01:35:58 pm »
Hi
i want set a jpct frame buffer in GLES20 in vuforia for show my 3d object in camera.
how can i do that?
     
Code: [Select]
if (!mActivity.isExtendedTrackingActive())
            {
               TextureManager tm = TextureManager.getInstance();
               if(!tm.containsTexture("texture"))
               {
               com.threed.jpct.Texture texture = new com.threed.jpct.Texture(BitmapHelper.rescale(BitmapHelper
              .convert(mActivity.getResources().getDrawable(R.drawable.camaro)), 64, 64));
            TextureManager.getInstance().addTexture("texture", texture);
               }
                   InputStream objStream=null ;
                   InputStream mtlStream=null ;
                   World world = new World();
           world.setAmbientLight(20, 20, 20);
           Light sun = new Light(world);
           sun.setIntensity(250, 250, 250);
               try {
            objStream = mActivity.getResources()
    .getAssets().open("camaro_obj");
            mtlStream = mActivity.getResources()
    .getAssets().open("camaro_mtl");
               } catch (IOException e) {

e.printStackTrace();
}
        Object3D cube = Object3D.mergeAll(Loader.loadOBJ(objStream, mtlStream, 10));
cube.setTexture("texture");
cube.strip();
cube.build();
Camera cam = world.getCamera();
        cam.moveCamera(Camera.CAMERA_MOVEOUT, 10);
        cam.lookAt(cube.getTransformedCenter());
        world.addObject(cube);
SimpleVector sv = new SimpleVector();
sv.set(cube.getTransformedCenter());
sv.y -= 100;
sv.z -= 100;
sun.setPosition(sv);
MemoryHelper.compact();
com.threed.jpct.Matrix mResult = new com.threed.jpct.Matrix();
mResult.setDump(modelViewMatrix);
cube.setRotationMatrix(mResult); 
cam.setBack(mResult);
                world.renderScene(fb);
                world.draw(fb);
                fb.display();

help me please....!!
« Last Edit: February 13, 2015, 07:32:44 am by EgonOlsen »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: how to set frame buffer in GLES20 in vuforia
« Reply #1 on: February 13, 2015, 07:34:24 am »
What do you mean exactly. I've acutually no idea about Vuforia, but i think that it creates the GL context for itself. You have to make it create an GLES2.0 context and then create a jPCT FrameBuffer instance in GLES2.0 mode.

Offline nima.sh23

  • byte
  • *
  • Posts: 40
    • View Profile
Re: how to set frame buffer in GLES20 in vuforia
« Reply #2 on: February 17, 2015, 07:11:51 am »
Thanks for your answer.
do you have a article for "use jpct in vuforia for android"?
help me please i need that.
thanks

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: how to set frame buffer in GLES20 in vuforia
« Reply #3 on: February 17, 2015, 08:40:17 am »
There's the wiki: http://www.jpct.net/wiki/index.php/Integrating_JPCT-AE_with_Vuforia. It doesn't cover the latest (Java based) version of Vuforia, but the basic ideas should be the same.

Offline nima.sh23

  • byte
  • *
  • Posts: 40
    • View Profile
Re: how to set frame buffer in GLES20 in vuforia
« Reply #4 on: March 03, 2015, 09:00:30 am »
Thanks a lot.
I make a project with vuforia and jpct.
but have a question..!!!
i change my dataset in ImageTargets.cpp,but my project dosent build,I know i should use of Cygwin for compile,i install Cygwin,but i dont know how can i setting up on my project.
can you help me,please?
thanks
Nima.S-H

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: how to set frame buffer in GLES20 in vuforia
« Reply #5 on: March 03, 2015, 05:47:12 pm »
No idea from my side...never used this, never tried to...maybe somebody else knows?