简体   繁体   中英

Draw on face of SCNNode

I am experimenting with ARKit and SceneKit and have been able to place boxes or custom shapes using UIBezierPath. What I'd like to do next is draw text and place images on the surface of these shapes. I've tried adding an image to the material property but this just fills the shape with an image. I'd like to have control over the size and position of the image / text relative to the shape. Is this possible?

You can do so by creating a new node for your text or image, and add it as a child node of your existing SCNNode ( addChildNode ). You can then position it as needed relative to your parent node, much as you have already done with your SCNNode.

For text you can make your SCNNode from an SCNText , or render the text into a bitmap and use it as a texture material of an SCNPlane .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM