Customizing ARKit Mesh

I was working on the ARKit4 scene reconstruction.
I am able to render the mesh on the environment. I was wondering how can I customize the mesh? Like, by default the mesh is primitive colored triangles and what if I want to render it as solid black triangles, how can I do that?


I am relatively new to swift so if anyone can point me to some tutorials to achieve this, that will be great.

Thank you.
Hello,

What renderer are you using to visualize the mesh?

In SceneKit, you create a custom SCNGeometry object with the init(sources:elements:) initializer by specifying an array of SCNGeometrySources and SCNGeometryElements. You can retrieve the required vertices, normals, and faces data from your mesh anchor's geometry.
In the step where you initialize the SCNGeometryElement, you can specify the primitive type (such as triangles, lines, or points) that will determine the appearance of the created geometry.
More information:
https://developer.apple.com/documentation/scenekit/scngeometry/1522803-init
https://developer.apple.com/documentation/scenekit/scngeometryprimitivetype.

In RealityKit, the reconstructed scene is visualized with a colored mesh when the .showAnchorGeometry option is added to ARView.DebugOptions. It is not possible to change the appearance of this debug visualization. You can file an enhancement request at https://www.apple.com/feedback/.
Hi,

I am using the default ARKit implementation. I just used the .sceneReconstruction meshWithClassification property.
the default mesh rendered by ARKit is a rainbow colored mesh. I want to override the colors. Will the above suggested approaches still work? Is there a sample talking about writing custom renderers?

Any help is appreciated.

Thank you.
Customizing ARKit Mesh
 
 
Q