POV-Ray : Newsgroups : povray.off-topic : Vector flood fill? : Re: Vector flood fill? Server Time
3 Sep 2024 15:12:25 EDT (-0400)
  Re: Vector flood fill?  
From: Slime
Date: 15 Nov 2010 01:46:35
Message: <4ce0d74b$1@news.povray.org>
> I'm thinking you could probably triangulate all the areas between
 > verticies. I.e., build a list of triangles between verticies that don't
 > contain any other verticies, and then use the center of each triangle or
 > something to represent the "cells", then flood-fill from there as
 > appropriate. Does that sound like it would work out? It sounds like a
 > lot of brute-force to find those triangles given nothing but the segment
 > endpoints. I wonder if you could build the maze that way in the first
 > place, plopping down a bunch of randomish triangles and *then* drawing
 > edges. Hmmmm...

That's how to do it. If you turn the wall line segments into loops, You 
can treat the maze like a complicated polygon and triangulate it as 
such. It's not too hard to do yourself, but there's also libraries that 
do it for you. Then just pathfind the resulting mesh.

  - Slime


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.