为什么不从三个标签渲染器中删除div

发布于 2025-01-23 00:46:50 字数 223 浏览 4 评论 0 原文

嗨,这是我提到问题以来的第三次renderer.domElement remove from document body then its delete but I want to delete the renderer.domElement child delete which is not delete .Here is the code which I'm using in my project.请检查三

Hi its my third time since I have mentioned my question but I didn't get the proper solution .The problem is I create div in runtime but after once I click the div then function call and click but div is not remove event if I remove renderer.domElement remove from document body then its delete but I want to delete the renderer.domElement child delete which is not delete .Here is the code which I'm using in my project. Please check if three.js admins or members read this question then please don't ignore it I will be very thankful for help :)

JSFiddle: [https://jsfiddle.net/regeme786/vmx8uLd1/22/]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

人间☆小暴躁 2025-01-30 00:46:50

如果要从CSS渲染器中删除元素,则必须删除其实例 css2dobject 。不是元素本身。因此,而不是这样做:

element.remove();

您必须使用 three.js api:

label.removeFromParent();

If you want to remove an element from the CSS renderer, you have to remove it's instance of CSS2DObject. Not the element itself. So instead of doing:

element.remove();

you have to use the three.js API:

label.removeFromParent();
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文