3ds not render perfectly

Started by angieIe, December 09, 2014, 06:05:13 AM

Previous topic - Next topic

angieIe

Hai, i have 3ds file and when i render it with jpct-ae i can see the object not render perfectly.. this my code:

                world = new World();
world.setAmbientLight(30, 30, 30);
sun = new Light(world);
sun.setIntensity(255, 255, 255);
// Create a texture out of the icon...:-)
TextureManager txtMgr = TextureManager.getInstance();
if (!txtMgr.containsTexture("BURJ_AL_.JPG")) {
Texture texture = new Texture(BitmapHelper.rescale(
BitmapHelper.convert(mActivity.getResources().getDrawable(R.drawable.burj_al_arab_map)), 512, 512));
txtMgr.addTexture("BURJ_AL_.JPG", texture);
}

Context mContext =mActivity.getApplicationContext();
InputStream stream = null;
try {
stream = mContext.getAssets().open("burj_al_arab.3DS");

} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//cube = Primitives.getCylinder(20, 80);
cube=Loader.load3DS(stream, 1f)[0];
cube.setCulling(false);
cube.strip();
cube.build();
world.addObject(cube);


I attach pic of screen shot.

EgonOlsen

What am i seeing there? What's the issue?

angieIe

#2
it should like this in 3d max ..in my previous pic, texture like transparent (sorry i have difficult in english so i can't explain it in detail). As you can see it different between 3dMax and in my phone... :-\

EgonOlsen

I'm still not sure what exactly you mean, but try a setTransparency(-1) on your objects. 3ds files can contain wrong transparency information sometimes and jPCT reads them.

angieIe

#4
 3d artist said it maybe flip surface when i render it in jpct-ae. how to fix flip surface of texture?

EgonOlsen

Have you tried my suggestion from above?

angieIe

yes..i have and still it likes transparent..
It seems that white color texture is become transparent..
in my 3d max screenshoot the roof of Burj al arab white.. but when i render it becomes transparent

EgonOlsen

Then you haven't properly disabled transparency. Transparent rendering doesn't happen by accident. Either that, or you model just doesn't include that geometry in the exported 3ds.

Lobby

If some triangles aren't drawn it also may be a problem with the order of vertex points in the triangles. To test this you may try to call setCulling(False) on your model.