Topic was automatically imported from the old Question2Answer platform.
Asked By
hidemat
I need this to help me for debugging, helping me visualize a 3d grid for building geometry. I also need them to not be visible through geometry that is in front.
One would think that ImmediateGeometry might come in handy but in Godot 3.x it is not possible to use the line width. And a width of 1 is not something you’ll need most of the time.
I propose that you assemble the grid with meshinstances of geometric primitives.
If you want to display your grid in plane(s), you could also use shaders.
Here’s an example that I use for a “dotted line” along the z-axis. (Shader is applied to a box shape, thin on x/y, long on z). I think it is a good example of how to obtain the local coords in a fragment shaders. This could be extended to draw a checkerboard or some … grid.