Finding covered tiles of the brush

Started by
0 comments, last by Muzzy A 9 years, 4 months ago

I need to calculate terrain brush covers how much tiles.And i need to find which tiles has been selected.I use hexagonal tiles.When brush size changed,covered area size changes.

I need an algorithm for this problem.

I looked to this site : http://www.redblobgames.com/grids/hexagons/ But i couldn't understand.

Thanks in advance.

for example:

[attachment=24833:pic1.jpg]

my editor :

[attachment=24834:pic3.jpg]

Advertisement

Not an expert on this or anything, but no one else has replied so I will put in my opinion =P

From what your saying it seems like I would personally do something like casting a ray from the camera and get the point of collision on the terrain from that ray. Then create a vertical cylinder, rectangle, or whatever the shape will represent your brush the best, then test that geometric shape against the terrain to find all of the tiles that are either inside or colliding with the shape.

Hope this helps!

This topic is closed to new replies.

Advertisement