Author Topic: Textured 3DS model  (Read 3983 times)

Offline guiloic

  • byte
  • *
  • Posts: 24
    • View Profile
Textured 3DS model
« on: March 11, 2006, 08:41:59 pm »
I'm trying to use a textured 3DS model but as result I've a dark stain...

here is my code :

Code: [Select]

Object3D[] objs = Loader.load3DS("models" + File.separatorChar + "balloon.3ds", 1);
this.model = objs[0];
for(int i=1; i<objs.length; i++)
this.model.addChild(objs[i]);
model.build();


I have the same result in software and in hardware mode.
ww.devcat.org

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Textured 3DS model
« Reply #1 on: March 11, 2006, 11:17:11 pm »
I'm not sure if adding the parts of the 3ds as childs of the first part really is what you want...but it's reasonable for some cases, so...
In any case, you have to add an Object3D to the world and if you don't merge the parts to one (like the fps-example does it for example), you have to add them all to the world (and build them all). In your code, i can't see you adding them to the world and you are obviously only calling build on the first part.

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
Textured 3DS model
« Reply #2 on: March 12, 2006, 01:26:10 am »
Yes, what happens is that the render acts over the defined World, in other worlds, you render what the Camera see of the World, if you dont add the objects to the World, then you obviously wont see anything.

Be sure to add some lights too and be sure that your camera is pointing to the object, if not you wont see anything because the camera wont look at the object.
Nada por ahora

Offline guiloic

  • byte
  • *
  • Posts: 24
    • View Profile
Textured 3DS model
« Reply #3 on: March 12, 2006, 11:56:25 am »
Thank you very much :)

Code: [Select]
Object3D objs[] = Loader.load3DS("models" + File.separatorChar
+ "balloon.3ds", 1.5f);
this.model = objs[0];

for(int i=1; i<objs.length; i++) {
this.model = Object3D.mergeObjects(this.model, objs[i]);
objs[i].build();
}

this.model.rotateX(-3.14f / 2.0f);
this.model.build();
ww.devcat.org

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Textured 3DS model
« Reply #4 on: March 12, 2006, 12:20:50 pm »
This call: objs.build(); isn't required, because you are "building" the merged model anyway. You can leave it out to gain some performance.