Smart way to find polygon neighbors?

Discussions about SOFTIMAGEs© Interactive Creative Environment©
Chris_TC
Posts: 411
Joined: 22 Mar 2010, 16:43

Smart way to find polygon neighbors?

Post by Chris_TC » 25 May 2011, 10:20

Ì find myself in need of turning a polygon position into an array of all neighboring polygons' positions. My current method works, but this is for a pathfinding ICE tree, and the polygon neighbors need to be found thousands of times in a loop, which is slow with this method. Is there no faster, more efficient way of doing this?
Image

Tree:
Image

Chris_TC
Posts: 411
Joined: 22 Mar 2010, 16:43

Re: Smart way to find polygon neighbors?

Post by Chris_TC » 25 May 2011, 14:07

The pathfinding works now, and according to the ICE performance tester, over 60% of the calculation time is wasted on finding polygon neighbors with the tree I posted.

chris3d
Posts: 2
Joined: 12 Dec 2009, 21:11

Re: Smart way to find polygon neighbors?

Post by chris3d » 31 May 2011, 15:01

do this lookup only one time, store positions/ids of the neighbor polys
on each polgon. then you can perform a fast lookup on each poly without
evaluating the search tree .