Answer the question
In order to leave comments, you need to log in
Threejs - how to change hover material texture in json model?
that is, I want that when hovering over the link: $(".link").mouseover(function() {
the attribute was assigned to the json model: ( instead of textura-1.jpg -> textura-2.jpg )
{
"DbgIndex" : 2,
"DbgName" : "Material #5428",
"colorDiffuse" : [0.5880, 0.5880, 0.5880],
"colorAmbient" : [0.5880, 0.5880, 0.5880],
"colorSpecular" : [0.9000, 0.9000, 0.9000],
" transparency" : 1.0,
"specularCoef" : 10.0,
"mapDiffuse" : "textura-1.jpg",
"vertexColors" : false
},
Answer the question
In order to leave comments, you need to log in
Roughly so it is possible to ride
//...
mesh.name = 'myname';
//...
var el = document.getElementById('link1');
el.on('click', function() {
scene.getObjectByName('myname').material.map = newTexture;
renderer.render(scene, camera);
}
//....
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question