# How best to render a 3D grid?

Hello I am new to Blender. I created a 3d grid using cylinders but it does not look nice. The grid lines are not regularly spaced. Can anyone tell me how to make it look better?

You can see the blend file here. http://www.imsc.res.in/~aagrawal/Schematic2.blend

• If you look at a finite grid with a perspective camera, you won't see equally spaced lines. You can use an orthographic camera (in the camera settings) if you want equal spacing, but you lose photorealism. Otherwise, I'd suggest you set a Focus on the camera (choose the yellow sphere, Sphere.010, as the focus point) and set a radius around 0.25: you will get a focus blur that gives a better understanding of the distance of each line from the camera. Jul 19 '17 at 8:38
• how did you made a " 3d grid via cylinder " exactly? why a rounded shape? Jul 19 '17 at 8:48
• @m.ardito I did not find any command to draw straight line. So is use cylinder_between function to draw cylinders. blender.stackexchange.com/questions/5898/… low=-3 hig=3 gap=1 radius=0.005 for j in np.arange(low,hig+gap,gap): for i in np.arange(low,hig+gap,gap): cylinder_between(i,low,j,i,hig,j, radius ) cylinder_between(low,i,j,hig,i,j, radius ) Jul 19 '17 at 9:53
• HI. Please use the more permanent blend-exchange.giantcowfilms.com for blend file storage in future. Jul 19 '17 at 12:26

Another way to create a 3d grid could be to use a simple basic cube:

1. add a wireframe modifier for the cube
2. add an array modifier on X, fixed count (eg) 5
3. add an array modifier on Y, fixed count (eg) 5
4. add an array modifier on Z, fixed count (eg) 5

Like this:

At least you can play easily with modifiers until satisfied...

edit:

I'll try to explain (as I got it) what Mentalist suggested in comments: you can avoid the wireframe modifier, using a "wire" material, which allows to save a lot of geometry at the expenses of... geometry, ie: material wireframe width is not adjustable but also in this way you save so many vertices.

I'll also add the option to use a different base shape (a "3d cross" instead of a cube) to save quite more (unneeded) vertices, because using cube and arrays, all cubes share all their vertices... with the "3d cross" this is slightly better.

• Nice one. And Blender Render's wireframe shader could be used for even line thickness. Only 1px thickness, but it's the simplest way I can think of. Jul 19 '17 at 15:03
• @Mentalist the only downside is the very high vertex count (eg if you raise the arrays count)... I'll try some better method but imho is way better than a python script to generate cylinders just for this, at the very least is more flexible... Jul 19 '17 at 16:20
• Yeah, the grid has to vanish at some point or it's just too much to render. I think a mist pass or z depth mask could be used to make the grid fade out gradually as the distance from the camera increases. Jul 19 '17 at 16:24
• @Mentalist I edited the answer adding your (good) suggestion, and another hack that could save 25% more vertices, imho Jul 19 '17 at 20:14
• Awesome! Good idea about the 3d cross. Cheers. Jul 20 '17 at 0:17

m.ardito's answer gives good suggestions about the modeling of the grid itself.

If, as I understand, you're less concerned about its modeling but more about the appearance, you may then want to tweak your camera settings in order to give a better understanding of the grid's shape and optical depth.

Indeed, any finite grid, if seen through a perspective camera, won't appear as equally spaced lines, which is the kind of appearance that you say you'd expect.

Try one of the following:

## 1) equally spaced lines

To obtain equally spaced lines, I can only suggest to switch your camera from perspective to ortographic.

(Select the camera, go to the object data settings, choose Orthographic, adjust the Orthographic scale and the position of your camera as you like)

## or 2) perception of optical depth

Otherwise, you can keep your perspective camera and add some focus blur to highlight the different depth of each grid line.

(Select the camera, go to the object data settings, set your central object (sphere.010 in your case) as the focus point, set a radius and adjust the position of your camera as you like)

This one uses a radius of 0.4 and an Emission shader with a dark blue color for the grid lines, instead of a transparent shader.