www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: angieIe on December 09, 2014, 06:05:13 am

Title: 3ds not render perfectly
Post by: angieIe on December 09, 2014, 06:05:13 am
Hai, i have 3ds file and when i render it with jpct-ae i can see the object not render perfectly.. this my code:
Code: [Select]
                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.
Title: Re: 3ds not render perfectly
Post by: EgonOlsen on December 09, 2014, 08:19:23 am
What am i seeing there? What's the issue?
Title: Re: 3ds not render perfectly
Post by: angieIe on December 09, 2014, 09:29:07 am
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... :-\
Title: Re: 3ds not render perfectly
Post by: EgonOlsen on December 09, 2014, 10:10:01 am
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.
Title: Re: 3ds not render perfectly
Post by: angieIe on December 09, 2014, 10:43:03 am
 3d artist said it maybe flip surface when i render it in jpct-ae. how to fix flip surface of texture?
Title: Re: 3ds not render perfectly
Post by: EgonOlsen on December 09, 2014, 11:20:21 am
Have you tried my suggestion from above?
Title: Re: 3ds not render perfectly
Post by: angieIe on December 09, 2014, 11:30:24 am
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
Title: Re: 3ds not render perfectly
Post by: EgonOlsen on December 09, 2014, 11:34:12 am
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.
Title: Re: 3ds not render perfectly
Post by: Lobby on December 09, 2014, 12:37:11 pm
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.