hex grid border highlighting

Keywords: current cell loop, current neighbor, neighbor highlight, border cell, navigable cell, navigable neighbor, bar texture, correct rotation, actual highlight, neighboring cell, edge, quad. Powered by TextRank.

Previously I've been doing this by actually highlighting all the possible cells, but it's looks a lot better if you just highlight the borders. Here's the results I've got after this implementation


Calculating the border cells is a different task which I've explained over [ere][]. After we have the cells that we can navigate to we need to filter out the border cells. If you look carefully the edges that need highlighting from all the cells in range are the ones that do not have a navigable neighbor. In the image the cell (4,-6,2) and (5,-6,1) are both in range, but they share a border with a navigable cell, so that edge should not be highlighted. The algorithm should be like this:

The actual highlighting is done by placing a quad with a bar texture with the correct rotation and coordinates easily calculated from the current cell we are processing.

Here is a video of the highlighting:

{{< youtube UkWKeim-n_Y >}}


Similar posts

Powered by TF-IDF/Cosine similarity

First published on 2018-05-09

Generated on May 29, 2024, 10:02 PM


Mobile optimized version. Desktop version.