Author Topic: 3ds not render perfectly  (Read 1169 times)

Offline angieIe

  • byte
  • *
  • Posts: 29
    • View Profile
3ds not render perfectly
« 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11744
    • View Profile
    • http://www.jpct.net
Re: 3ds not render perfectly
« Reply #1 on: December 09, 2014, 08:19:23 am »
What am i seeing there? What's the issue?

Offline angieIe

  • byte
  • *
  • Posts: 29
    • View Profile
Re: 3ds not render perfectly
« Reply #2 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... :-\
« Last Edit: December 09, 2014, 09:31:45 am by angieIe »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11744
    • View Profile
    • http://www.jpct.net
Re: 3ds not render perfectly
« Reply #3 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.

Offline angieIe

  • byte
  • *
  • Posts: 29
    • View Profile
Re: 3ds not render perfectly
« Reply #4 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?
« Last Edit: December 09, 2014, 10:45:12 am by angieIe »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11744
    • View Profile
    • http://www.jpct.net
Re: 3ds not render perfectly
« Reply #5 on: December 09, 2014, 11:20:21 am »
Have you tried my suggestion from above?

Offline angieIe

  • byte
  • *
  • Posts: 29
    • View Profile
Re: 3ds not render perfectly
« Reply #6 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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11744
    • View Profile
    • http://www.jpct.net
Re: 3ds not render perfectly
« Reply #7 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.

Offline Lobby

  • int
  • **
  • Posts: 66
    • View Profile
    • flowersoft
Re: 3ds not render perfectly
« Reply #8 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.