如何在 Three.js 中单独访问每个元素
我已经使用 Three.js 创建了网格并渲染了“10”个 3D 对象?
如何访问每个对象以执行缩放、旋转和缩放所有的东西,所以有一个 需要单独获取div对象吗?
帮我解决这个问题吗?
谢谢 !
I have created mesh and rendered " 10 " 3d objects using three.js?
how to access each object to perform scaling , rotation & all stuffs so there is a
need to get the div object individually?
help me to solve this issue ?
thanks !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你似乎没有问一个真正的问题。而是要求某人教你一些东西。在“启动代码”中,SphereGeometry 对象与 MeshBasicMaterial 对象组合,以创建 Mesh 对象,该对象是您的 3D 对象,然后您可以使用它来访问/设置对象位置、旋转等。以下是代码行我指的是:
创建网格对象后,您需要通过调用 scene.add(mesh) 将它们添加到场景中。此时您可以设置或获取旋转或位置
You do not seem to be asking a real question. But rather asking for someone to teach you something. In the 'startup code' a SphereGeometry object is combined with a MeshBasicMaterial object in order to create the Mesh object which is your 3d object that you can then use to access/set the objects position, rotation, etc. Here are the lines of code I am referring to:
Once you create mesh objects you need to add them to the scene with a call to scene.add(mesh). At this point you can set or get the rotation or position as such