Textured 3DS model

Started by guiloic, March 11, 2006, 08:41:59 PM

Previous topic - Next topic

guiloic

I'm trying to use a textured 3DS model but as result I've a dark stain...

here is my code :


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.

EgonOlsen

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.

Melssj5

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

guiloic

Thank you very much :)

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();

EgonOlsen

This call: objs.build(); isn't required, because you are "building" the merged model anyway. You can leave it out to gain some performance.