三.js 如何通过 id(name) 获取场景 [英] three.js how to get scene by id(name)
问题描述
我创建了一个场景;我怎样才能通过 id(name) 获取它?喜欢 jquery(#test)
?
I created a scene;
How can I get it by id(name)?
Like jquery(#test)
?
在 three.js
文档中,我只找到了 scene.getObjectById()
来获取儿童 obj.
In three.js
doc,I just find the scene.getObjectById()
to get children obj.
推荐答案
你有没有搜索过?
此getObjectByName方法rel="nofollow">此处位于 Object3D
类中.
而此处也在文档中提及.
There is a getObjectByName
method for this here in the Object3D
class.
And here it is also mentioned in the documentation.
getObjectByName
和 getObjectById
方法都是在父对象中查找子对象.场景没有父级,因此按 id 查找场景或按名称查找场景没有多大意义...
Both the getObjectByName
and the getObjectById
methods are to find children objects inside a parent object. A scene doesn't have a parent so finding scene by id or finding scene by name doesn't make much sense...
这篇关于三.js 如何通过 id(name) 获取场景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!