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.


Messages - RhoX

Pages: [1] 2
1
Support / Re: Out of memory, performance issues
« on: January 09, 2012, 05:36:51 pm »
Hello guys, thanks for the help.

Im using Android 2.1 version.
I kinda solved the problem with this links:

http://www.google.com.br/search?ix=icb&sourceid=chrome&ie=UTF-8&q=java.lang.OutOfMemoryError%3A+bitmap+size+exceeds+VM+budget
http://stackoverflow.com/questions/1949066/java-lang-outofmemoryerror-bitmap-size-exceeds-vm-budget-android
http://developer.android.com/resources/articles/avoiding-memory-leaks.html

There are some information about memory leaks, context, static and final variables. My big problem (I think) was the changes between landscape and portrait screens... those was "duplicating" the memory space used by my resources - those links explain better.

Thanks again for all that help! Ill keep it in mind through my development!

ps: K24A3,

I dont know it the problem is related somehow with my objects (for example), cause Im using just a skybox, a plane and a simple human model. But the idea of loading the textures first before anything else is interesting.

2
Support / Re: Out of memory, performance issues
« on: January 04, 2012, 05:39:01 pm »
I'm not used to the DDMS tool, but I will try it.

About reducing memory usage, I have followed some of the tips. In fact, I can see the performance difference but the problem still occurs. My textures are all about 512 x 512 (with 285kb) at most - for the skybox - the others are 128x128, 128x64 (with 1.8kb, 1.17kb)... Maybe are the skybox textures too big?

3
Support / Out of memory, performance issues
« on: January 03, 2012, 09:44:54 pm »
Hello everyone,

I've been developing a new game for Android with the jPCT-AE. Recently I've faced a new problem, an error the occurs randomly. Here is the log:

Code: [Select]
01-03 15:16:01.262: ERROR/dalvikvm(2038): Out of memory: Heap Size=20231KB, Allocated=16823KB, Bitmap Size=4274KB
01-03 15:16:01.282: WARN/dalvikvm(2038): threadid=15: thread exiting with uncaught exception (group=0x4001b390)
01-03 15:16:01.282: ERROR/AndroidRuntime(2038): Uncaught handler: thread GLThread 10 exiting due to uncaught exception
01-03 15:16:01.282: ERROR/AndroidRuntime(2038): java.lang.OutOfMemoryError
01-03 15:16:01.282: ERROR/AndroidRuntime(2038):     at com.threed.jpct.Texture.loadTexture(Texture.java:701)
01-03 15:16:01.282: ERROR/AndroidRuntime(2038):     at com.threed.jpct.Texture.loadTexture(Texture.java:662)
01-03 15:16:01.282: ERROR/AndroidRuntime(2038):     at com.threed.jpct.Texture.<init>(Texture.java:130)
01-03 15:16:01.282: ERROR/AndroidRuntime(2038):     at android.jpct.screening.ScreenRenderer.onSurfaceChanged(ScreenRenderer.java:139)
01-03 15:16:01.282: ERROR/AndroidRuntime(2038):     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1122)
01-03 15:16:01.282: ERROR/AndroidRuntime(2038):     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:977)

This Out of Memory error occurs often, but not always. Actually, sometimes I run my code (in a device) and everything works just fine, other times (without making any changes) I get this error.
I've looked after some performance issues, memory usage, this kind of stuff.. but I still get this error.
Any suggestions?

Thanks in advance

4
Support / Re: Skybox good size?
« on: November 26, 2011, 04:32:31 am »
Hummm, I understand.

It is good to know that clearing the z-buffer makes the skybox render the objects anyway.

Thanks for the reply!

5
Support / Skybox good size?
« on: November 18, 2011, 01:45:19 pm »
Hello everyone,

I've been developing a Android game with jPCT-AE and now I have a problem with this skybox stuff. I read some older topics and I got that testing on emulator is not a good idea (I'm gonna find some Android phone to test). My question is: how do I determine a skybox size good enough for the application? Let me explain:

Ealier, I was setting
 
      sky = Skybox(80);

This made my screen black XD.

After I read some topics, I've set

     sky = Skybox(10000);

With this, I've got some very good results.

What about that? Any suggestions?

Thank you in advance,

RhoX

6
Support / Re: 2D interface - Object Picking
« on: August 17, 2011, 03:45:36 am »
Hey, Edak!

Thats exactly what my question is about. I've tried some days ago some code like similar to the one you showed but it didnt work. But, when I have time, I'm going to try again (with your code) and then I'll post the results.

Thanks for the help!

RhoX

7
Support / Re: 2D interface - Object Picking
« on: August 13, 2011, 09:39:37 pm »
Well, I kinda solved this problem with the blitting method that you told in another thread. But, how am I supposed to correct ou ajust these coordinates (framebuffer x touch)?

Thank you again!  ;D

8
Support / Re: Multiples Primitives
« on: August 13, 2011, 09:35:17 pm »
EgonOlsen, thank you very much!

I've tried the blit method and it worked perfectly! It's really a magical stuff! heheheh  ;D

Thank you again!

RhoX

9
Support / Re: Multiples Primitives
« on: August 10, 2011, 08:58:32 pm »
Man! It worked with the camera looking to the z-axis! Thank you very much! I've not tried the second idea yet, but it seems that is going to work better for me.

About blitting... well, I've already seen some threads about it, but actually I couldn't understand the idea  ;D. Do you know any thread, tutorial or something like that could help me?

Thank you ver much again! :D

10
Support / Re: 2D interface - Object Picking
« on: August 10, 2011, 08:40:40 pm »
Here is the screenshot of the application:



The blue button at the right down corner of the screen is suppose to be clickable. And when it gets clicked, the model displayed is changed by other. Actually, with my lines of code, the picking not occurs at the right points (i.e., when I pick some points int the area above the button, my "debugger" says "PICKED!".

That is my problem  :-\

11
Support / Re: Multiples Primitives
« on: August 10, 2011, 08:23:34 pm »
Well, I think I didn't make myself clear, sorry. Just a little explain: example, when a plane is translated like (X, 0,0), it gets smaller and upper (seems like the translation made is by (X, some value of Y, some value of Z).
Here is a sequence of images, to explain:



See that the first plane (left most) is correct. But the others, which supposed to be at the same Height and Depth, are shifted.
I've tried many things and nothing worked at all. What I want is to align them at the same horizontal axis, like if they were 3 buttons at the screen.

12
Support / Multiples Primitives
« on: August 10, 2011, 01:07:51 pm »
Hey, folks!

I am with another problem with my project, similar (if not equal) to the one of this post (http://www.jpct.net/forum2/index.php/topic,1996.msg14704/topicseen.html#msg14704)

I'm creating six Primitives which are Planes. But, when I translate them they get smaller (farther from the screen), or higher (closer to the screen), or upper, or more down.. something like that. By the other topic this is kind of a "bug" in jPCT-AE. Unfortunately, I couldn't solve the problem with any idea that Ive had. And I need those planes to build my interface.

Any suggestions?

Thanks in advance!

RhoX

13
Support / Re: 2D interface - Object Picking
« on: August 10, 2011, 10:18:39 am »
Okay. I'll do it later.

Thanks for everything!

I'll be back soon XD!

14
Support / Re: 2D interface - Object Picking
« on: August 10, 2011, 08:35:47 am »
Well, I've tried the idea of using the diferent projection, but it still doesnt work. Maybe it is because my object's center is "bad" positioned.
My 2D button is:

Code: [Select]
Texture tela = new Texture(res.openRawResource(R.raw.icon1));
tm.addTexture("tela", tela);

nextBt = Primitives.getPlane(4, 25f);
nextBt.setTexture("tela");
//nextBt.setCollisionOptimization(true);
nextBt.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
nextBt.setLighting(Object3D.LIGHTING_NO_LIGHTS);
nextBt.translate(65f, 140f, -75f);
nextBt.setBillboarding(Object3D.BILLBOARDING_ENABLED);

Some idea?

Thanks for the reply! :D

15
Support / 2D interface - Object Picking
« on: August 09, 2011, 11:37:02 pm »
Hey, guys, whats'up?

I am TRYING to develop an simple 2D interface with jPCT-AE: its just a 2D button which, when I press it, the 3D displayed model is changed by another model. For doing this, I'm using object picking, but it just doesnt work! Actually, it works. But it shows that the button was "picked" in screen points outside of the button area (the button is just a plane).
Do you know what I am missing  here?
My code for collision is:

Code: [Select]
public boolean checkCollision(int x, int y)
{
dir = Interact2D.reproject2D3DWS(world.getCamera(), fb, x, y).normalize();

Object[] res = world.calcMinDistanceAndObject3D(world.getCamera().getPosition(), dir, 300 );
if (res[1] != null && res[1] == nextBt)
return true;

return false;
}

This method is called by the main activity when the user touches the screen.

Thanks!

RhoX

Pages: [1] 2