Texture mapping issue in JPCT game engine

40 Views Asked by At

In a Blender every textures displays fine, but not in the Engine

Sorry for my English. Recently I found on a game engine for Java - JPCT and decided to try to create a small game. I'm having a problem displaying textures on the .obj model. In blender, everything is displayed correctly, but not in the engine. See screenshots below.

Blender ](https://i.stack.imgur.com/TlCJV.png) My code:

public class WorldObjects {
    List<Object3D> objects = new ArrayList<>();
    Object3D object3D;

    public void loadObjects(){
        Object3D school = Object3D.mergeAll(Loader.loadOBJ("models/school.obj", "models/school.mtl",  5));
        school.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
        school.setCulling(true);
        school.setCollisionOptimization(true);
        school.rotateX((float) (Math.PI / 2) * 2);

        object3D = school;

        school.build();

        objects.add(school);
    }

    public Object3D getObject3D() {
        return object3D;
    }
}

My class where i planned to create all game objects and adding ones in the list

    public void render(){
        for(int i = 0; i!=worldObjects.objects.size(); i++){
            world.addObject(worldObjects.objects.get(i));
        }
    }

My method where i adding into the world all objects from list

Tell me, what's the problem? Thank you very much in advance

0

There are 0 best solutions below