How can i show UIView on a ModelEntity?
On android, i use ViewRenderable to load a view , and attach it to a Node, to show a View in the AR scene.
But i not found any ways to show view in the AR scene of the ARView used the RealityKit.
Anyone can help me ?
Thanks very much!
Hi,
is your UIView static or does it change a lot? If it's just a static view you could create a snapshot, extract it's CGImage and convert that into a TextureResource (https://developer.apple.com/documentation/realitykit/textureresource/3768851-generate) that could be mapped on whatever model you want.
In case it is animated I assume you could render that view with your desired update interval into a Metal Texture and then use the DrawableQueue API to update your material with the new texture: https://developer.apple.com/documentation/realitykit/textureresource/drawablequeue
Maybe this GitHub sample I've done could help you with the latter option: https://github.com/arthurschiller/realitykit-drawable-queue