# Square direction

Dschoonmaker
Posts:

**260**Member
in 3D

Using built in distance and direction functions, I get a circular pattern(I'm making a terrain mesh). That makes sense, but I need square distance and square direction functions for my square terrain.

To make the square distance function, I get the distance between point A and point B on each axis, then return the greatest axis distance. That works, but I can't figure out how to make the direction function. Do you know how to make a square direction function?

## Answers

2,785Adminonly ever turn by 90 degree angles?

749ModeratorWhat part of terrain generation would require a "square direction"?

260MemberI'm trying to make a grid mesh with LOD. If I multiply some vertices' positions, I get a gap between levels of detail. If I move the vertices in a little with a normal direction function, the grid gets "bent":

Maybe there's a different way to move vertices in, but I think a "square" direction function would work.

749ModeratorCan I see what it looks like without the normal transformation?

260Member749ModeratorI think simply uniformally multiplying those vertices' positions would do fine. Have you tried to scale them by √2 instead?

260MemberWhich part should be multiplied by √2? Right now I multiply inner vertices by 0.5, should the √2 come before that, or after, or should it be applied to only some vertices? I tried moving the √2 to a few different places, but nothing I tried worked.