0
var obj = document.querySelector("#sphere");
obj.components.material.data.roughness = 0.3;
obj.components.material.update(object);
obj.components.material.flushToDOM();
//I don't think object matters for this use,
// it is only useful for shaders I believe.
我想“flushToDOM()”,但似乎并没有在所有它仍然停留在初始设置更新实体HTML材料...冲洗材料更新到HTML中AFRAME
<a-sphere id="sphere" position="0 0.25 -4.5" radius="1.25" color="#712ef0" transparent="true" material="color:#712ef0;transparent:true;metalness:0.3;opacity:1" geometry="primitive:sphere;radius:1.25" rotation="0 0 0" scale="1 1 1">
这很快,会在一分钟内尝试标记为正确。谢谢。 – msj121
哇,它不会让我接受这么快的答案......但是,这工作完美,哇,我一直在尝试不同的方法相当一段时间。谢谢。将在〜9分钟内标记正确 – msj121