Jump to content
  • Advertisement
Sign in to follow this  

Finding covered tiles of the brush

This topic is 1418 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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:


my editor :


Share this post

Link to post
Share on other sites

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!

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!