Filling a grid using Hamiltonian paths

Started by
-1 comments, last by Murloc992 8 years, 6 months ago
Hello,
recently I was trying to implement a Hamilton path function to generate/fill a grid of points with a snake-like path.
Generally the code I have now miss-performs in the beginning and near the last steps, between those (80% of the generation) everything seems extremely fine. I really cannot find what would be the issue. Seems like my nodes just snap and another, related node gets placed in a completely random spot. Maybe somebody could point out where I did a mistake?
Here is my Pastebin code:
I am using GLM for vec2 class, but a simple struct with int x and y would do.
Thanks in advance!

This topic is closed to new replies.

Advertisement