jPCT-AE - a 3d engine for Android > Support

3d library

<< < (2/2)

mgrabul:

--- Quote from: EgonOlsen on October 08, 2010, 08:24:26 pm ---There are several pitfalls when loading objects. First, you are doing this:


--- Code: --- jeep=Loader.load3DS(res.openRawResource(R.raw.jipp), 5)[0];

--- End code ---

while i tend to do this myself, it's actually a hack that only works for models that consist of just one part. If that's not given, you'll only add the first part to the world and depending on the model, this can be anything. Try to do


--- Code: --- jeep=Object3D.mergeAll(Loader.load3DS(res.openRawResource(R.raw.jipp), 5));

--- End code ---

instead.

Second, object space of a model can be anything. Your jeep model might cover coordinates from -10 to 10 or from -100000 to 0 or from -100000 to -99990. Try to play around with the scale of the model to see if that changes something as well as with the models translation. To get a quick grasp of how the model is located in object space, print out the center (Object3D.getCenter()).

Third, make sure that there is light. A black jeep in front of a black background isn't really visible. I tend to choose another color for the background for testing purposes.


--- End quote ---
Thanks for the replay it was very helpful and it solves my problem but the black screen whas probably caused by tthe performance of my phone (g1)  and it still needs time to draw the screen for the first time

EgonOlsen:
Make sure to have a look at serialized objects: http://www.jpct.net/wiki/index.php/Differences_between_jPCT_and_jPCT-AE#Performance_and_memory_issues.2C_serialized_objects

It's highly recommended to use them instead of the orginal file formats on Android.

Navigation

[0] Message Index

[*] Previous page

Go to full version