Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Nick

Pages: [1]
1
Support / 3ds model texture behavior
« on: December 15, 2010, 11:05:22 pm »
Hello,

I'm having difficulties with displaying and texturing some 3ds models, made in sketchup. When displaying and rotating  the camera, at different angles some models are seen through other models. Turning the camera stops it at some angles. I've added some screenshots for better explanation.

The "wrong" angle: http://img810.imageshack.us/i/wrongb.png/

The "good" angle: http://img217.imageshack.us/i/gooddv.png/

This is the code which I use to import 3ds files and edit them a bit.
Code: [Select]
private Object3D getBuilding(String link, float x, float y, float z, float rotate, String texture) {

Object3D obj = null;
Object3D[] imports = Loader.load3DS(link, 1f);
if (imports.length > 0) {
obj = imports[0];
}
obj.rotateX((float) -Math.PI / 2f);
obj.rotateY((float) ((rotate / 180) * Math.PI));
obj.translateMesh();
obj.rotateMesh();
obj.setTranslationMatrix(new Matrix());
obj.setRotationMatrix(new Matrix());
obj.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
obj.setEnvmapped(Object3D.ENVMAP_ENABLED);
obj.setTexture(texture);
obj.translate(x, y, z);
obj.build();

return obj;
}

Does somebody know why this behavior is taking place?

Greetings,

Nick

Pages: [1]