three.js how to get scene by id(name)

北城余情 提交于 2019-12-13 07:21:17

问题


I created a scene; How can I get it by id(name)? Like jquery(#test)?

In three.js doc,I just find the scene.getObjectById() to get children obj.


回答1:


Did you even search?

There is a getObjectByName method for this here in the Object3D class.
And here it is also mentioned in the documentation.


Update

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...



来源:https://stackoverflow.com/questions/36714763/three-js-how-to-get-scene-by-idname

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!