Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.3k views
in Technique[技术] by (71.8m points)

three 场景下的scenne.chilren 怎么深度拷贝

使用场景:
我在场景中新增 多个个obj 模型,保存到数据库后

然后我在浏览该场景,需要把数据库里面的模型挨着加载进入

scene.children.forEach(object => {

        this.scene.add(object.clone(true)); 
    })
    

不管是一样this.scene.add(object.clone(true)); 还是this.scene.add(object) 发现跟之前存储的模型uuid 不一样,这个uuid 需要一样,不然没办法做一些逻辑处理(模型选中等操作),请问下有什么办法解决


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...