Another pathfinding example
This time on a larger 1802x1802 maze from https://commons.wikimedia.org/wiki/File:MAZE.png
Same basic approach with exaggerated colorization for your viewing pleasure.
The original video https://www.youtube.com/watch?v=SafxDQYvWLs sat idle for about 4 years and to my utmost surprise has received over 100k views since April 2020! Thanks for the views, likes and subs!
Overall you, the viewer, seem to enjoy the rendering while not really caring that the "solve" path isn't drawn in the rendering; not to worry, the solve does exist and used to generate a red-line path from beginning to end but in my efforts to make the output more glamorous I broke something in that code. So, good luck YouTube compression algorithm!
A few questions on the technical side; this was written some time ago when I spent much of my time coding in PHP, and it was an easy choice. To make this rendering I was lucky enough to have retained the source code, so by simply installing a recent PHP 7.4 and enabling the GD extension the code ran without any modifications. I'll have to clean it up somewhat before I decide to release it on GitHub; it's a bit ugly and cares very little for computer resources.
The code is a class that begins by reading the supplied image file and building an array keyed on x,y with the value being color. I've also converted the mazes to monochrome to make things easier. The class must be told which pixel to start on and a pixel that would signal success, somewhere in the exit.
An overview of the current state.
find_path loops until the current position equals the target pixel.
Determines up to 4 possible vectors from the current position.
Associates/Eliminates and stacks the vectors with the loop/iteration counter
This stack of vectors is passed to solve() which re-orders the remaining stack and draws the red-line solve, and currently has a bug where it never exits properly.
Images are written using GD every 1000 iterations. This maze generated 2137 frames that were stitched using FFMPEG libx264 with pixel format of yuv420p
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Another pathfinding example», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.