Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Davi

#1
I have two activities.one is first page,it has a start button,when I clike this button,it will load my two md2 models at the same time ,when they load completely,it will skip two my game activity,in my game activity , this time,two models work normally, when I click key Back,it will go back to my first page,but at this time,if I click the start button again,my app will crashed,and there will be some error messages in logcat:


11-14 17:14:08.106: E/AndroidRuntime(19642): java.lang.OutOfMemoryError
11-14 17:14:08.106: E/AndroidRuntime(19642): at com.threed.jpct.Mesh.<init>(Mesh.java:143)
11-14 17:14:08.106: E/AndroidRuntime(19642): at com.threed.jpct.Mesh.cloneMesh(Mesh.java:332)
11-14 17:14:08.106: E/AndroidRuntime(19642): at com.threed.jpct.Loader.loadMD2(Loader.java:1328)
11-14 17:14:08.106: E/AndroidRuntime(19642): at com.threed.jpct.Loader.loadMD2(Loader.java:131)
11-14 17:14:08.106: E/AndroidRuntime(19642): at org.mxr.app.ModelLoading.loading(ModelLoading.java:75)
11-14 17:14:08.106: E/AndroidRuntime(19642): at org.mxr.app.ModelLoading.run(ModelLoading.java:65)
11-14 17:14:08.106: E/AndroidRuntime(19642): at java.lang.Thread.run(Thread.java:1102)
11-14 17:14:08.576: E/ActivityManager(1327): fail to set top app changed!


this is out of memorry,I just want to know how to clear entire cache after load md2 models before go back to first page?


#2
Support / load 5 md2 models at the same time
November 14, 2011, 08:56:33 AM
Hello,I have 5 md2 models,each model is about 2M,I want to load them at the same time,I don't know how to load it correctly, maybe there will be out of memorry? I have no idea,please give me a hint. :-\
#3
Support / load md2 model question
November 10, 2011, 07:20:23 AM
I have load md2 successully,but every time I use code finish my Activity,after that I restart my app,it often crashed. the log is as following:
11-09 13:57:53.769: E/dalvikvm(25707): Out of memory: Heap Size=24323KB, Allocated=24129KB, Bitmap Size=0KB, Limit=21884KB
11-09 13:57:53.769: E/dalvikvm(25707): Extra info: Footprint=24519KB, Allowed Footprint=24583KB, Trimmed=1060KB
11-09 13:57:53.779: W/dalvikvm(25707): threadid=13: thread exiting with uncaught exception (group=0x40025a70)
11-09 13:57:53.779: E/AndroidRuntime(25707): FATAL EXCEPTION: GLThread 16
11-09 13:57:53.779: E/AndroidRuntime(25707): java.lang.OutOfMemoryError
11-09 13:57:53.779: E/AndroidRuntime(25707): at com.threed.jpct.Mesh.<init>(Mesh.java:141)
11-09 13:57:53.779: E/AndroidRuntime(25707): at com.threed.jpct.Mesh.cloneMesh(Mesh.java:332)
11-09 13:57:53.779: E/AndroidRuntime(25707): at com.threed.jpct.Loader.loadMD2(Loader.java:1328)
11-09 13:57:53.779: E/AndroidRuntime(25707): at com.threed.jpct.Loader.loadMD2(Loader.java:131)
11-09 13:57:53.779: E/AndroidRuntime(25707): at org.opencv.mxrtoolkit.GLLayer.loadModel
   

the jpct-ae log is as following:

11-09 14:15:15.149: I/jPCT-AE(25759): Static references cleared...
11-09 14:15:15.529: I/jPCT-AE(25759): Loading Texture...
11-09 14:15:15.539: I/jPCT-AE(25759): Loading file from InputStream
11-09 14:15:15.549: I/jPCT-AE(25759): Expanding buffers...16384 bytes
11-09 14:15:15.549: I/jPCT-AE(25759): Expanding buffers...24576 bytes
11-09 14:15:15.549: I/jPCT-AE(25759): Expanding buffers...32768 bytes
11-09 14:15:15.549: I/jPCT-AE(25759): Expanding buffers...40960 bytes
11-09 14:15:15.549: I/jPCT-AE(25759): Expanding buffers...49152 bytes
11-09 14:15:15.549: I/jPCT-AE(25759): Expanding buffers...57344 bytes
11-09 14:15:15.549: I/jPCT-AE(25759): Expanding buffers...65536 bytes
11-09 14:15:15.549: I/jPCT-AE(25759): Expanding buffers...73728 bytes
11-09 14:15:15.549: I/jPCT-AE(25759): Expanding buffers...81920 bytes
11-09 14:15:15.559: I/jPCT-AE(25759): Expanding buffers...163840 bytes
11-09 14:15:15.639: I/jPCT-AE(25759): Expanding buffers...245760 bytes
11-09 14:15:15.639: I/jPCT-AE(25759): File from InputStream loaded...228764 bytes
11-09 14:15:15.719: I/jPCT-AE(25759): Magic number: 844121161
11-09 14:15:15.719: I/jPCT-AE(25759): Version: 8
11-09 14:15:15.719: I/jPCT-AE(25759): Skin width: 168
11-09 14:15:15.719: I/jPCT-AE(25759): Skin height: 195
11-09 14:15:15.719: I/jPCT-AE(25759): Frame size: 1064
11-09 14:15:15.719: I/jPCT-AE(25759): Number of skins: 0
11-09 14:15:15.719: I/jPCT-AE(25759): Number of Vertices: 256
11-09 14:15:15.719: I/jPCT-AE(25759): Number of Texture coordinates: 348
11-09 14:15:15.719: I/jPCT-AE(25759): Number of triangles: 512
11-09 14:15:15.719: I/jPCT-AE(25759): Number of GL-commands: 2622
11-09 14:15:15.719: I/jPCT-AE(25759): Number of Frames: 198
11-09 14:15:15.719: I/jPCT-AE(25759): Reading Texture coordinates...
11-09 14:15:15.719: I/jPCT-AE(25759): Done!
11-09 14:15:15.719: I/jPCT-AE(25759): Reading polygonal data...
11-09 14:15:15.719: I/jPCT-AE(25759): Done!
11-09 14:15:15.899: I/jPCT-AE(25759): Reading keyframes...
11-09 14:15:15.959: I/jPCT-AE(25759): Done!
11-09 14:15:15.959: I/jPCT-AE(25759): Coverting MD2-format into jPCT-format...
11-09 14:15:16.019: I/jPCT-AE(25759): Processing: stand...
11-09 14:15:16.299: I/jPCT-AE(25759): Processing: run...
11-09 14:15:16.429: I/jPCT-AE(25759): Processing: attack...
11-09 14:15:16.469: I/jPCT-AE(25759): Processing: pain...
11-09 14:15:16.629: I/jPCT-AE(25759): Processing: jump...
11-09 14:15:16.659: I/jPCT-AE(25759): Processing: flip...
11-09 14:15:16.819: I/jPCT-AE(25759): Processing: salute...
11-09 14:15:16.969: I/jPCT-AE(25759): Processing: taunt...
11-09 14:15:17.879: I/jPCT-AE(25759): Processing: wave...

I'm sure some memory is not released when I exist this activity, how to release it use jpct-ae ?
#4
I have a projection matrix,I don't know whether it needs to set with jpct-ae? then how to do?
#5
Support / How set my projection matrix to to jpct-ae
October 30, 2011, 10:39:34 AM
I have got a projection 4*4 matrix,wanna to  set to jpct-ae,but don't know how to set it ?can you help me ?
#6
Support / how to set the FrameBuffer to alpha
October 29, 2011, 07:37:32 PM
I want to use camera as the background in my AR project,but I don't know how to set the FrameBuffer(fb) to be transparent in my onDrawFrame() function. my code as below:

        onDrawFrame(GL10 gl){
                 fb=new FrameBuffer(gl, this.getWidth(),this.getHeight);
                 RGBColor transp = new RGBColor(?,?,?,?);
fb.clear(transparent);
world.renderScene(fb);
world.draw(fb);
fb.display();
        }

it always show black or other color background,can you tell me how to set it to be transparent?
#7
         I have opengl es code as blew:     
             
                gl.glMatrixMode(GL10.GL_PROJECTION);
gl.glPushMatrix();
gl.glLoadMatrixf(ProjectionBuff);
gl.glMatrixMode(GL10.GL_MODELVIEW);
gl.glPushMatrix();
gl.glLoadMatrixf(Transform);
             

      I want to know how to set jpct-es like this?
#8
when Load md2 model ,the log show:

Loading Texture...
     ... ...
Processing:deathc...
[1319821045737] - ERROR: Too many sub-sequences defined. Modify configuration to allow a higher number.

I want to know how to modify configuration to allow a higher number??? ???please help
#9
Support / why my texture can't show on md2 model?
October 28, 2011, 04:34:20 AM
public void onSurfaceCreated(GL10 gl, EGLConfig config) {

      world = new World(); 
      world.setAmbientLight(150, 150, 150);   
      TextureManager.getInstance().addTexture("tris3", new Texture(BitmapFactory.decodeResource(this.getResources(), R.drawable.tris3))); 
      snork = Loader.loadMD2(LoadAssets.loadf("tris3.md2"), scale); 
      snork.setTexture("tris3");
      snork.strip(); 
      snork.build(); 
      world.addObject(snork);
}
public void onSurfaceChanged(GL10 gl, int width, int height) {
      if (fb != null) { 
         fb = null; 
      } 

      this.width=width;
      this.height=height;
      fb = new FrameBuffer(gl,width, height); 
}
onDrawFrame(GL10 gl) {
      doAnim(); 
      world.renderScene(fb);
      world.draw(fb);
      fb.display();
}
above is my key code to show texture,the md2 model loading is ok,but the texture can't show on the model,I don't know what wrong is?
Please help me ?
#10
Support / why I can't rotate my md2 model?
October 28, 2011, 03:57:56 AM
before use world.addObject(md2); I want to let my model rotate 90 angle,
I use md2.rotateX(90);
or
   
Matrix ma=new Matrix();
      ma.rotateX(90);
      ma.rotateY(90);
      ma.rotateZ(90);
        snork.setRotationMatrix(ma);

But why it can't work???