Create a sphere in blender that only uses square faces instead of triangles and then use the wireframe rendering method.
Use your custom mesh code but with the linesytem meshbuilder that will create a single mesh from your points matrix that you can rotate and transform normally.
Then do the same but instead of the Y coord, take the horizontal angle.
This is acheived easily using the arctan2 function along with X and Z coordinates, applied as well on a LessThan boolean :
Use GreasedLineTools with GreasedLine. This way you can utilize all the available features of it as variable colors, widths, textures, PBR material, etc…