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 - thiamant

Pages: [1]
Support / Scaling objects dynamically
« on: October 07, 2010, 07:48:15 pm »
I'm trying to scale a model dynamically when the model is already running and visible. Do I have to rebuild the object or something like that? After calling .scale() method the object disappears and I can only see the framebuffer empty (with the background colour).

Support / Adding preferences
« on: September 30, 2010, 10:29:27 pm »

I'm trying to add some preferences running an activity that is extending PreferenceActivity. The problem is that when starting the activity changing some preferences and then coming back most of the polygons are not showing anymore (the onStop method is being called and I guess some memory is being freed and hence the model not showing properly). I can't load the model again just for changing some preferences since it takes too long so I'm just loading it the first time that onSurfaceCreated method is called.

Is there any way to force android not to release any memory ? I've been trying to setPersistent(true) but it's not working.


Support / Loading screen
« on: September 30, 2010, 06:03:59 pm »
I'm trying to display a loading picture. I want it to be displayed between the time of the application start and until the first frame of the model has been displayed. I can't seem to get this work with an ImageView at the start because once the renderer is created the screen goes black again.

Any ideas? Thanks.

Support / Object serialization octrees
« on: September 13, 2010, 03:35:11 pm »
Does object serialization (DeSerializer class) include octrees asigned to it?

Is it loading automatically when loadSerializedObject is called?

Support / Loading big models (memory issues)
« on: September 10, 2010, 01:10:13 pm »
I'm trying to load a model with a reasonable size and it's working more or less properly (maybe at a low frame rate which is around 10 atm) in my orange boston. The app crashes in HTC Desire though. I think this is happening due to some memory issues (maybe a limited heap size). So, how exactly is the model being loaded (is jpct loading the .obj completely in memory and uncompressed? the obj size is just around 3-4MB and it's uncompressed but clearly the heap size is larger than 4 MB).

Can I load the model in several parts so only the parts needed are stored in memory?
Do you think I could have to optimize the model to make it work properly? What are my chances here?

Support / Loading textures in serialized objects
« on: September 09, 2010, 07:10:29 pm »
Hello, I'm new to jPCT and trying to load an OBJ model in JPCT-AE.

The problem is that I'm serializing the object like this:
Code: [Select]
TextureManager texMan = TextureManager.getInstance();
DeSerializer des = new DeSerializer();

char c = File.separatorChar;
File dir = new File("raw");
String[] files = dir.list();
for (int i = 0; i < files.length; i++) {
String name = files[i];
if (name.toLowerCase().endsWith(".jpg")) {
texMan.addTexture(name, new Texture("raw" + c + name));

Object3D[] objs = Loader.loadOBJ("raw/raw.obj","raw/raw.mtl", 1);
OutputStream os = new FileOutputStream("raw.ser");

des.serialize(objs[0], os, true);
But when loading the model in Android with Loader.loadSerializedObject(...) the textures won't appear.
My question: How does this exactly work? Does this call look for textures in any specific directory?
Do I have to load them once again in Android manually?
Where should I put them? I have lots of them in the model.

Thanks in advance.

Pages: [1]