Hi.
I am trying to add a grid wireframe(like the gizmo grid matrix in editor view) with ArrayMesh, the basic idea is:
- Get camera pos center
- Generation 100*100 quads based on camera center + offset with for in range loop every frame or upon camera movements
- Render the generated mesh in meshinstance3d.
Though I got a few questions:
I cant seem to find a function to reset mesh, you could only generate new mesh with add_from_surface, but you can't remove exist vertices from ArrayMesh.
The array mesh generated only supports lines or triangle primitives, and it requires vertices count to be power of 3, which is problematic since I am making quads grid.
The ArrayMesh tutorial in 4.0 docs only give an example of how to generate array mesh file, but didn't give hints on how to update mesh in scene in real-time. So what is the proper way of updating generated array mesh in real-time?
I also looking into the possibility to use an exist model(subdivided plane) attached to camera center, though I am not sure if it's appropriate to use model as gridview wireframe renderer.
Thanks.