Note that there are some explanatory texts on larger screens.

plurals
  1. POModel texturing error with libgdx
    primarykey
    data
    text
    <p>I am having an issue with libgdx where when I load a model in any format the texture is not appearing correctly. I'm not sure what is causing this issue.</p> <p>Example: In 3ds max or blender it looks like this <img src="https://i.stack.imgur.com/fwVsa.png" alt=""></p> <p>but when I put it into a libgdx project it looks like this <img src="https://i.stack.imgur.com/Owbh8.png" alt=""></p> <p>My code is based on <a href="http://blog.xoppa.com/loading-models-using-libgdx/" rel="nofollow noreferrer">http://blog.xoppa.com/loading-models-using-libgdx/</a></p> <p>And I have tried it with and without the lights with no luck</p> <p>Code:</p> <pre><code>//Loading the model assetManager = new AssetManager(); assetManager.load("data/models/M4A1 SOPMOD/M4A1 SOPMOD.g3db", Model.class); //.................................................. //Calling to an object and drawing it public void create() modelBatch = new ModelBatch(); box = Assets.assetManager.get("data/models/M4A1 SOPMOD/M4A1 SOPMOD.g3db", Model.class); //box = Assets.getModelByName("M4"); //box = modelBuilder.createBox(1f, 1f, 1f, new Material(ColorAttribute.createDiffuse(Color.WHITE), ColorAttribute.createSpecular(Color.WHITE), FloatAttribute.createShininess(64f)), Usage.Position | Usage.Normal); boxInstance = new ModelInstance(box); lights = new Lights(); lights.ambientLight.set(1f, 1f, 1f, 1f); lights.add(new DirectionalLight().set(1f, 1f, 1f, -1f, -0.8f, -0.2f)); } public void Update(float deltaTime) { dotd.camera.rotateAround(Vector3.Zero, new Vector3(0, 1, 0), deltaTime* 50.0f); dotd.camera.update(); } public void Render() { modelBatch.begin(dotd.camera); modelBatch.render(boxInstance, lights); modelBatch.end(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload