Sign in to follow this  

How to check that two nodes of quadtree are neighbours?

This topic is 1510 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

Sommet way is working to searching neighbours in the quadtree, but what if two nodes are given allready, and only thing is last it is to check that they both are neighbours to the given direction(N,W,S,E)?

 

In my algorithm I use Sommet way: I traverse up to the common uncestor and watching nodes for reflection(symmetry). But it is not works properly. As result there are a more than one neighbours matched to the given direction, it's impossible, because one direction - one neighbour.

 

Please help, how to check two nodes are neighbours?

 

P.S.

I need this for stitching terrain nodes.

Share this post


Link to post
Share on other sites

Sorry, i mean Samet neighbor finding techs. Not edges but neighbors. I am trying to check is two nodes are neighbors. Let's depict:

-------------------------

|      |      |      |      |

|-----|-----|-----------|

|      |  a  |  b  |      |

-------------------------

|             |

|      c     | 

|             |

-------------

isNeighbor(a, c,  SOUTH) is true

isNeighbor(a, b, EAST) is true

isNeighbor(a, b, WEST) is false

isNeighbor(c, b, NORTH) is false

etc

Share this post


Link to post
Share on other sites

This topic is 1510 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