Sign in to follow this  

Finding covered tiles of the brush

This topic is 1113 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:

[attachment=24833:pic1.jpg]

my editor :

[attachment=24834:pic3.jpg]

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

This topic is 1113 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this