S
S
sysY2019-05-14 19:19:29
three.js
sysY, 2019-05-14 19:19:29

How to connect texture to loaded object (obj+mtl) in Three js?

The section of code where I connect the object with the material

loadModel: function () {
    var oLoader = new THREE.OBJMTLLoader();

    oLoader.load('static/img/general/obj/phones/phones.obj',
                 'static/img/general/obj/phones/phones.mtl', function (object) {
        this.obj0 = object;
        object.rotateY(110);
        object.position.x = 0;
        object.position.y = -8;
        object.position.z = 100;
        object.scale.set(1, 1, 1);
        phones.scene.add(object);
    });
}

How to enter texture connection (jpg) here?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question