I am successfully extracting vector data from SceneKit primitives, very much along the lines as in the question/answer here:
Extracting vertices from scenekit
This does not seem to work for all the geometries SceneKit generates though. I can extract the standard box, sphere etc, but special features like chamfer or more complex geometries (e.g. from SCNText) simply don't seem to be contained in the standard SceneKit geometry. Also: The normal SCNBox and SCNSphere only come in one geometry resolution and don't respect the parameters provided (e.g. different dimensions from 1.0).
Did anybody successfully extract the geometry from SCNText?
Thanks,
Felix
SceneKit is a high-level 3D graphics framework that helps you create 3D animated scenes and effects in your apps.
A six-sided polyhedron geometry whose faces are all rectangles, optionally with rounded edges and corners.
In my previous blog post I discussed how to overlay an image on the camera output in an ARKit app. Objects that you overlay on the camera output are called nodes. By default, nodes don't have a shape. Instead, you give them a geometry (shape) and apply materials to the geometry to provide a visual appearance.
The underlying geometry data of these primitives are updated lazily at render time or when a transaction is flushed.
If you want to make sure that the data you will get from your primitives matches the latest parameter you configured then you need to either create and configure them within a SCNTransaction
and access the geometry data after calling [SCNTranction commit]
or you can invoke [SCNTransaction flush]
before getting the data.
That should work for every primitive including SCNText
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With