"-cam.backBx, -cam.backBy, -cam.backBz",how to get them?
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 MenuQuote from: EgonOlsen on October 30, 2011, 07:51:47 PMhow can I understand what the code does,can you give me some open source code about that?
The projection matrix is implicitly created by the engine based on the current fov settings and the far and near clipping plane. There's no way to set it directly from the outside. The model view matrix in OpenGL is a combination of object space->world space and world space->camera space transformations. The matrix itself is set by the engine based on an object's transformation and the camera rotation and position. You can't take some random GL code and just extract the matrices to feed them into jPCT-AE. You have to understand what the code does and rebuild it's behaviour by using the means that the engine offers.
Quotethank you very much, it seems can't release all texture memory from my system,can you tell me how to clear all memory completely,
@Override
protected void onDestroy() {
TextureManager.getInstance().removeTexture(texturesName);
model=null;
fb.freeMemory();
fb.dispose();
fb=null;
world.dispose();
world=null;
Loader.clearCache();
}
TextureManager.getInstance().removeTexture(texturesName);
TextureManager.getInstance().flush();
TextureManager.getInstance().removeAndUnload(textureName,frameBuffer)
@Override
protected void onDestroy() {
model=null;
fb=null;
world=null;
TextureManager.getInstance().removeTexture(texturesName);
Loader.clearCache();
}
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!
for(int i=0;i<5;i++){
modelList.add(Loader.loadMD2(this.getResources().getAssets().open(modelName[i], AssetManager.ACCESS_UNKNOWN), 3f));
TextureManager.getInstance().addTexture(texturesName[i],
new Texture(BitmapFactory.decodeResource(this.getResources(), texturePictureId[i])));
}
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
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...
onDrawFrame(GL10 gl) {
matrixTrans=new Matrix();
matrixTrans.translate(a,b,c)
model.setTranslationMatrix(matrixTrans);
//doAnim();
world.renderScene(fb);
world.draw(fb);
fb.display();
}
I/jPCT-AE (11870): Loading Texture...
I/jPCT-AE (11870): Loading file from InputStream
I/jPCT-AE (11870): Expanding buffers...16384 bytes
I/jPCT-AE (11870): Expanding buffers...24576 bytes
I/jPCT-AE (11870): Expanding buffers...32768 bytes
I/jPCT-AE (11870): Expanding buffers...40960 bytes
I/jPCT-AE (11870): Expanding buffers...49152 bytes
I/jPCT-AE (11870): Expanding buffers...57344 bytes
I/jPCT-AE (11870): Expanding buffers...65536 bytes
I/jPCT-AE (11870): Expanding buffers...73728 bytes
I/jPCT-AE (11870): Expanding buffers...81920 bytes
I/jPCT-AE (11870): Expanding buffers...163840 bytes
I/jPCT-AE (11870): Expanding buffers...245760 bytes
I/jPCT-AE (11870): Expanding buffers...327680 bytes
I/jPCT-AE (11870): Expanding buffers...409600 bytes
I/jPCT-AE (11870): File from InputStream loaded...346308 bytes
I/jPCT-AE (11870): Magic number: 844121161
I/jPCT-AE (11870): Version: 8
I/jPCT-AE (11870): Skin width: 256
I/jPCT-AE (11870): Skin height: 256
I/jPCT-AE (11870): Frame size: 1612
I/jPCT-AE (11870): Number of skins: 5
I/jPCT-AE (11870): Number of Vertices: 393
I/jPCT-AE (11870): Number of Texture coordinates: 561
I/jPCT-AE (11870): Number of triangles: 764
I/jPCT-AE (11870): Number of GL-commands: 3833
I/jPCT-AE (11870): Number of Frames: 198
I/jPCT-AE (11870): Reading Texture coordinates...
I/jPCT-AE (11870): Done!
I/jPCT-AE (11870): Reading polygonal data...
I/jPCT-AE (11870): Done!
I/jPCT-AE (11870): Reading keyframes...
I/jPCT-AE (11870): Done!
I/jPCT-AE (11870): Coverting MD2-format into jPCT-format...
I/jPCT-AE (11870): Processing: stand...
I/jPCT-AE (11870): Processing: run...
I/jPCT-AE (11870): Processing: attack...
I/jPCT-AE (11870): Processing: pain...
I/jPCT-AE (11870): Processing: jump...
I/jPCT-AE (11870): Processing: flipoff...
I/jPCT-AE (11870): Processing: salute...
I/jPCT-AE (11870): Processing: taunt...
I/jPCT-AE (11870): Processing: wave...
I/jPCT-AE (11870): Processing: point...
I/jPCT-AE (11870): Processing: crstand...
I/jPCT-AE (11870): Processing: crwalk...
I/jPCT-AE (11870): Processing: crattack..
I/jPCT-AE (11870): Processing: crpain...
I/jPCT-AE (11870): Processing: crdeath...
I/jPCT-AE (11870): Processing: deatha...
I/jPCT-AE (11870): Processing: deathb...
I/jPCT-AE (11870): Processing: deathc...
I/jPCT-AE (11870): Done!
I/jPCT-AE (11870): Normal vectors calculated in 88ms!
I/jPCT-AE (11870): OpenGL vendor: Qualcomm
I/jPCT-AE (11870): OpenGL renderer: Adreno 205
I/jPCT-AE (11870): OpenGL version: OpenGL ES-CM 1.1
I/jPCT-AE (11870): OpenGL renderer initialized (using 2 texture stages)
I/jPCT-AE (11870): Using vm based buffer copies!
I/jPCT-AE (11870): Remapping 642 vertex indices!
I/jPCT-AE (11870): Creating vertex cache (15408 bytes)!
I/jPCT-AE (11870): Vertex indices will be mapped!
I/jPCT-AE (11870): Subobject of object 0/object2 compiled to indexed fixed point data using 2292 vertices in 70ms!
I/jPCT-AE (11870): Object 0/object2 compiled to 1 subobjects in 88ms!
I/jPCT-AE (11870): Object 'object2' uses one texture set!
I/jPCT-AE (11870): VBO created for object 'object2'
Page created in 0.026 seconds with 12 queries.