Return to site

Make a grid on 3d paint

broken image

This could probably be fixed by adding more vertices to the mesh. And further away from the terrain, there is some z-axis fighting. indicatorOffsetY is to raise the mesh from the terrain, for some reason converting the height from terrain size to heightmap size and back again messes the actual height value. The grid is just a texture so it doesn’t add more squares (it’s possible with some modification to the uv calculations). IndicatorSize changes the size of the grid. Note : When I wrote this, the terrain and the object I attached the script to were positioned at (0,0,0)

broken image

I have included some clampsing to make sure there are no array out of range problems. What I have done is created a mesh, then from a raycast from the camera to the terrain, reading the heightmap information, then modifying the mesh vertices based on the heights around the ray hit position. So, this is for drawing a grid only around the mouse position.

broken image
broken image

I had a laugh at I don’t want to do very complex stuff as I am just a beginner then reading your modification of the alphamap script, I wouldn’t have a clue on modifying the splat/texture information! This only answers the second half of the question how can I potentially draw the grid only around the cursor. I really liked this question, and was surprised there was no answer, so I decided to have a go myself.

broken image