I need an advice. I am using RealityKit for showing models of fences. I have models which has several meshes that shouldn't be shown at once. For example filling of the fence. There are different options and I have it all in my model:
I would like to show always one at the time. How can I do that? I can't edit meshes at runtime, can I? I was thinking about changing material for each mesh but when I tried to set clear color with SimpleMaterial it shows mesh in black and when I tried OcclusionMateril I get this result:
Example how I tried hide material with SimpleMaterial:
var material = SimpleMaterial()
material.baseColor = MaterialColorParameter.color(UIColor.clear)
material.tintColor = .clear
clonedEntity.model?.materials[index] = material
Or with OcclusionMaterial (in screenshot from app above):
let occlusion = OcclusionMaterial()
clonedEntity.model?.materials[index] = occlusion
Is it possible to somehow hide parts of 3D model? Or do I have to several models and when I want to change filling for example I must change whole model? Or should I somehow composite one object from multiple models (for example filling and rest of fence)? Thanks for any advice.