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.


Topics - RhoX

Pages: [1]
1
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

2
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

3
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 I´ve had. And I need those planes to build my interface.

Any suggestions?

Thanks in advance!

RhoX

4
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

5
Support / Re: load a .obj file in JPCT-AE demo
« on: July 29, 2011, 11:35:42 pm »
Alright. Now I've realized that.  "Wrong positions" I meant something related to the scene, but - like you said - those commands werent about loading a scene setup. I've misundertood. Sorry.

In fact, I'm with a problem loading up my models: I've separated the code for loading the model from the onDrawFrame method, and now  I doesnt show up anything at the scene. In terms of code, it is...

I have my method for loading models:

Code: [Select]
public Object3D arrangeWorld(int objType)
{
Object3D mainTemp = null;
switch (objType)
{
//.OBJ
case 0:
break;
//.MD2
case 1:
mainTemp = Loader.loadSerializedObject(res.openRawResource(R.raw.serbird_final));

Texture birdy = new Texture(res.openRawResource(R.raw.bird_final));
tm.addTexture("bird_final", birdy);

mainTemp.setCenter(SimpleVector.ORIGIN);
//mainTemp.rotateX((float)( -.5*Math.PI));
            mainTemp.rotateMesh();
mainTemp.setRotationMatrix( new Matrix() );
mainTemp.setTexture("bird_final");
break;
//.3DS
case 2:
Object3D temp = null;
Object3D chair[] = new Object3D[7];

chair[0] = Loader.loadSerializedObject(res.openRawResource(R.raw.serchair0));
chair[1] = Loader.loadSerializedObject(res.openRawResource(R.raw.serchair1));
chair[2] = Loader.loadSerializedObject(res.openRawResource(R.raw.serchair2));
chair[3] = Loader.loadSerializedObject(res.openRawResource(R.raw.serchair3));
chair[4] = Loader.loadSerializedObject(res.openRawResource(R.raw.serchair4));
chair[5] = Loader.loadSerializedObject(res.openRawResource(R.raw.serchair5));
chair[6] = Loader.loadSerializedObject(res.openRawResource(R.raw.serchair6));

Texture chairy = new Texture(res.openRawResource(R.raw.decoo));
tm.addTexture("chair", chairy);

int l = chair.length;
for(int i = 0; i < l; i++)
{
temp = chair[i];
temp.setCenter(SimpleVector.ORIGIN);
temp.rotateX((float)( -.5*Math.PI));
            temp.rotateMesh();
temp.setRotationMatrix( new Matrix() );
temp.setTexture("chair");
mainTemp = Object3D.mergeObjects(mainTemp, temp);
}
break;
default:

}

return mainTemp;
}


And, in  the onDrawFrame method I have the following sequence:

Code: [Select]
//... some other codes
mainObj = new Object3D(arrangeWorld(objType));

world.addObject(mainObj);
world.buildAllObjects();
//... some other codes

What do you think about that?

ps: Sorry if here isnt the right place to make this question =/

6
Support / 3D GUI development - objects positions
« on: July 29, 2011, 10:09:05 am »
Hey, guys!

I have a problem here, if you could help me with some tips and/or tutorials, this kind of stuff, I would be glad: I am starting to develop some 3D interfaces for simulations on Android, using the jPCT-AE. I've seen some code examples, but I dont know how to "position" my models at the scene. It's kinda hard to explain: how am I supposed to know where the objects are (and how) if I'm not seeing the scene during the development?
I dont know if I could get it clear for you, but the idea is pretty much simple. Do you have some "technique" to develop interfaces, scenes in general? Or is it just like try and error?

Thank you in advance

RhoX

7
Support / Tutorials or some help
« on: February 23, 2011, 08:26:05 pm »
Hey guys!

I've started to use the jpct-ae engine recently and I'm a little lost with all those classes and methods. I'm using the HelloWorld code and the other example (more complex) as guides but I'd like to know if there is some kind of tutorial which might be useful.
And, what do you think about reading the tips of jpct [desktop version] (like: how to start, the explanation about HelloWorld and other things like that) to get used to the engine?

Thanks in advance!

8
Support / Textures when serializing objects
« on: February 21, 2011, 11:26:39 pm »
Hey folks!

I was trying to serialize some objects but I´ve always got the following error:
Loading Texture...C:/grassy.jpeg
[ Mon Feb 21 19:17:51 BRT 2011 ] - ERROR: File 'C:/grassy.jpeg' not found - replacement texture used instead!


I've already tried to make many changes to correct this problem, but I couldn't solve it (the grassy.jpeg file is there, I've checked!). Sorry if there already is another topic with the same subject, I didn't find it.

The code that I've used was:
Code: [Select]
TextureManager.getInstance().flush();
TextureManager tm = TextureManager.getInstance();

Object3D objMD2 = null;

        objMD2 = Loader.loadMD2("C:/bird.md2",1);

        Texture texMD2; 
        texMD2 = new Texture("C:/grassy.jpeg");

        tm.addTexture("bird", texMD2);
        objMD2.setTexture("bird");
        objMD2.build();
       
        DeSerializer de;
        de = new DeSerializer();
        FileOutputStream outputObjMD2 = new FileOutputStream( "C:/serbird.ser");
        de.serialize(objMD2, outputObjMD2, true);

Thanks you in advance!

Pages: [1]