SceneKit:如何获得SCNNode当前外观的图像?

发布于 2025-01-25 23:46:17 字数 269 浏览 3 评论 0 原文

我有一个SCNNODE需要对其外观进行一些自定义修改,仅由于资源限制,只能在CGimage上完成。

在ButtonPressed中,我希望能够做一些事情,例如

let snapshotImage: CGImage = node.imageOfCurrentAppearance

doSomeModification(inputCGImage: snapshotImage)

如何获得SCNNode当前外观的图像? (几乎就像节点的屏幕截图吗?)

I have a SCNNode that I need to do some custom modification to its appearance that can only be done on a CGImage due to resource constraints.

In buttonPressed, I want to be able to do something like

let snapshotImage: CGImage = node.imageOfCurrentAppearance

doSomeModification(inputCGImage: snapshotImage)

How can I go about getting an image of the SCNNode's current appearance? (almost like a screenshot of the node?)

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

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

发布评论

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

评论(1

断桥再见 2025-02-01 23:46:17

仅加入节点单独的scnview,您要屏幕截图并使用在您的scnview实例上。

Make a separate SCNView with only the node added that you want to screenshot and use snapshot() on your SCNView instance.

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