gpt4 book ai didi

animation - 更新的纹理在three.js 中停止动画

转载 作者:行者123 更新时间:2023-12-04 01:33:41 27 4
gpt4 key购买 nike

yesterday 继续.我在页面刷新时换出 .GLTF 上的纹理。纹理现在工作正常,花花公子......

但仅限于没有动画的文件。然而,纹理更新似乎阻止了它们的字面轨迹。我不确定是什么导致了它或如何重新加载动画。

这是代码:

    var creaturePath = "models/gltf/creature/";
var creatureFile = "creature_roar.gltf";

// load the model
var loader = new GLTFLoader().setPath( creaturePath ); // creature

loader.load( creatureFile, function ( gltf )
{
gltf.scene.traverse( function ( child )
{
if ( child.isMesh )
{
// override textures
texture.flipX = false;
texture.flipY = false;
my_material = new THREE.MeshBasicMaterial({map: texture});
// child.material = my_material; // this is the problem line
texture.needsUpdate = true;
}

} );

var model = gltf.scene;

最佳答案

如果更换 Material ,必须确保设置MeshBasicMaterial.skinning和/或 MeshBasicMaterial.morphTargetstrue .否则 Material 将不支持骨骼和/或变形目标动画。
three.js R113

关于animation - 更新的纹理在three.js 中停止动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60323149/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com