I am new to Metal Kit and Computer Graphics in general.
I was playing around with this sample code:
https://developer.apple.com/documentation/arkit/visualizing_a_point_cloud_using_scene_depth
I want to re-write this app. I wish to render a triangle mesh / triangle strip with custom colors in place of the particles or dots rendered here in this app (on top of the rgb image captured per frame)
I would really appreciate it if someone can point me to the right direction. I know I need to probably re-write the shader file to draw triangles but I can not figure out how.
Any help is appreciated.
Thank you.
I was playing around with this sample code:
https://developer.apple.com/documentation/arkit/visualizing_a_point_cloud_using_scene_depth
I want to re-write this app. I wish to render a triangle mesh / triangle strip with custom colors in place of the particles or dots rendered here in this app (on top of the rgb image captured per frame)
I would really appreciate it if someone can point me to the right direction. I know I need to probably re-write the shader file to draw triangles but I can not figure out how.
Any help is appreciated.
Thank you.
As Adam mentioned this would not be a straightforward change to the sample. You would need to group the points provided by ARKit into sets of 3, each describing a vertex of a triangle. You would then render with Metal with a drawPrimitives or drawIndexedPrimitives call using a the MTLPrimitiveType.triangle type.
Since you're unfamiliar with Metal, there's a lot to learn here before you get to this. Metal is a fairly low level API allowing lots of flexibility but requiring a fair amount expertise to use properly. I would suggest starting with some of the Metal Sample code (starting with the Metal Fundamentals samples) to learn about the basics of Metal.
However, if you want the "easy" solution, RealityKit may provide a better alternative to do what you're asking.
Since you're unfamiliar with Metal, there's a lot to learn here before you get to this. Metal is a fairly low level API allowing lots of flexibility but requiring a fair amount expertise to use properly. I would suggest starting with some of the Metal Sample code (starting with the Metal Fundamentals samples) to learn about the basics of Metal.
However, if you want the "easy" solution, RealityKit may provide a better alternative to do what you're asking.