Best way to draw a cartesian grid?

What’s the best way to draw a cartesian grid in jme3? I am trying to make a simple application where a user can connect lines to form quadrilateral or hexagonal shapes, (and not necessarily regular ones). I would like to have a grid in the background that they can use as a reference. I would also like the grid points to line up over the integer points of the grid, {0,0,1},{0,1,0}, etc.

I’ve explored the possibility of doing this with terrain and a height map floored at 0. That looks promising, but I am not sure where to go with it. I could map a texture to it, but I don’t know how to get that texture to line up with the grid points.

I have also looked at just drawing the lines with Mesh and Geometry. I think this would work too, but it would be computationally cumbersome compared to using the terrain, right?

Simply showing the wireframe isn’t an option, I think, because it only shows the triangles (albeit in whatever arrangement they have).

Thank you very much for your time!

Jay Jay

I have also looked at just drawing the lines with Mesh and Geometry.
So you created a huge amount of lines? Or did you use the Grid mesh? If the grid is only in the background, using the com.jme3.scene.debug.Grid is the easiest way I think.
1 Like

I did not use the Grid mesh in my original post, but after trying it based on your suggestion I have found that it works perfectly. Thanks very much!

1 Like