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

3d library

(1/2) > >>

mgrabul:
Hi can some one point out a librery whit a 3d models that I can easely use to load 3d models in my application.
I found http://dmi3d.comeze.com/modelsvehicle2.html and I realy like the models but I have trouble importing them in the application. I first installed Blender in order to export the files in a .3ds fromat. After I exported the model in a .3ds format I still had problems ranning the application and I get an error. can someone explane in details the easiest way for adding 3d models to my application. Please:)

EgonOlsen:
Which errors  ???

mgrabul:
I am sorry I have no errors, but when I try to add a new 3d object from a the raw folder, the screen becomes black (I am using the code from the demo example). This is my code:

private Object3D jeep=null;
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
         TextureManager.getInstance().flush();
         world = new World();
         Resources res = getResources();

         TextureManager tm = TextureManager.getInstance();
                        ................................
                        .....................................
                       jeep=Loader.load3DS(res.openRawResource(R.raw.jipp), 5)[0];
                          jeep.translate(-200, -10, 50);
                        world.addObject(jeep);
}
 
I try to add a new objec from the file jipp.3ds, I equerd the file from http://dmi3d.comeze.com/modelsvehicle2.html it is a .lwo file so I used Blender to export the file in .3ds
please tell me what am I doing wrong or explane a simpe way to add 3d models in mu application

mgrabul:

--- Quote from: EgonOlsen on October 07, 2010, 07:47:16 am ---Which errors  ???

--- End quote ---
I am sorry I have no errors, but when I try to add a new 3d object from a the raw folder, the screen becomes black (I am using the code from the demo example). This is my code:

private Object3D jeep=null;
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
         TextureManager.getInstance().flush();
         world = new World();
         Resources res = getResources();

         TextureManager tm = TextureManager.getInstance();
                        ................................
                        .....................................
                       jeep=Loader.load3DS(res.openRawResource(R.raw.jipp), 5)[0];
                          jeep.translate(-200, -10, 50);
                        world.addObject(jeep);
}
 
I try to add a new objec from the file jipp.3ds, I equerd the file from http://dmi3d.comeze.com/modelsvehicle2.html it is a .lwo file so I used Blender to export the file in .3ds
please tell me what am I doing wrong or explane a simpe way to add 3d models in mu application

EgonOlsen:
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.

Navigation

[0] Message Index

[#] Next page

Go to full version