Jump to content


Photo

FLOOD FILL


  • Please log in to reply
1 reply to this topic

#1 slayer 64

slayer 64

    GMC Member

  • GMC Member
  • 3278 posts
  • Version:GM8.1

Posted 24 March 2012 - 07:13 PM

i needed the floodfill algorithm for a game i'm making. not just to color in an image. my example shows the algorithm working step by step. red is the filling color. blue are new nodes. i started with someone elses example and i was pretty confused. but now that i've read the code, broken it down and simplified it, flood fill is easy. the example doesn't have a script that automatically fills in surfaces for you. you'll have to read the code, learn how it works and write your own script. i've got to make flood fill work in 3d now, later.

http://www.host-a.ne.../flood fil.gm81
  • 2

#2 TheSnidr

TheSnidr

    That guy

  • Global Moderators
  • 2438 posts
  • Version:GM:Studio

Posted 25 March 2012 - 12:46 AM

Nice one! I tried this once myself, but I eventually had to admit defeat. It's very efficient too, at least for the grid in the example. Good to see you're back at the GMC!
  • 1




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users