{
...
"nodes": [{
"mesh": 0,
"name": "Banana"
}],
...
}
<xr-gltf id="myGLTF" model="gltfModel" bind:gltf-loaded="handleGLTFLoaded"></xr-gltf>
function handleGLTFLoaded({ detail }) {
const el = detail.value.target;
const gltf = el.getComponent("gltf");
const newMat = this.scene.assets.getAsset("texture", "...texture name...");
for (const mesh of gltf.getPrimitivesByNodeName("Banana")) {
mesh.material.setTexture("u_baseColorMap", newMat);
}
}
const newMat = this.scene.assets.getAsset("texture", "...texture name...");中的...texture name...是指的什么值?
for (const mesh of gltf.getPrimitivesByNodeName("Banana")) 中的Banana这个值是怎么确定填什么值的?
this.scene.assets.getAsset("texture", "...texture name...")
这个方法可以拿到图片的信息但是就是给已经有颜色有皮肤的gif模型更换不了模型外表的皮肤