question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JSON Loader - Texture Issue

See original GitHub issue

Hi all,

This is my model: http://yagiz.me/model/zombi.js This is its texture: http://yagiz.me/model/zombi.png

And this is how I load it:

function loadModel() {
    var loader = new THREE.JSONLoader();
    var callback = function( geometry ) {
            var mesh = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { map : new THREE.Texture( "models/zombi/zombi.png" ) } ));
        scene.addObject( mesh );
        };

    loader.load( "models/zombi/zombi.js", callback);
}

Model has a UV data but I can’t see the texture. It’s all black? What do you think?

Issue Analytics

  • State:closed
  • Created 12 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
alteredqcommented, Jan 12, 2012
var texture = THREE.ImageUtils.loadTexture( "models/zombi/zombi.png" );
var material = new THREE.MeshBasicMaterial( { map : texture } ); 
var mesh = new THREE.Mesh( geometry, material );
Read more comments on GitHub >

github_iconTop Results From Across the Web

JSON Loader callback is fired before textures are mapped to ...
i am using JSONLoader to load 3d models to my scene .. then i stop the rendering loop to avoid cpu overhead while...
Read more >
Three.js JSONLoader texture issues - Stack Overflow
I'm trying to learn three.js so my next personal chalenge was to import a model from blender, everything went well but some of...
Read more >
ObjectLoader not loading textures from JSON - three.js forum
Hi, im having issues with the THREE.ObjectLoader() not loading the textures from a JSON I exported with the .toJSON() function of an object ......
Read more >
[Solved]-Three.js JSONLoader texture issues-three.js
In this case, the exporter has incorrectly guessed Tree_Bark_Tiled.png is a light map instead of a diffuse map. To fix this, change all...
Read more >
Promise loading with Three.js - ITNEXT
TextureLoader.load() returns a Texture, which is updated when the image is loaded. JSONLoader.load() is passed a onComplete callback, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found