Poisson disc sampling, an algorithm for generating tightly-packed points which are all some minimum distance from one another.
Based on: this video - the first few minutes are also a good description.
A visualization of the selection process with some color added based on the 'age' the point was picked.
and the actual points table displayed as... points
Poisson Disc Sampling
Poisson Disc Sampling
- Attachments
-
- Lua_PoissonDiskSampler.love
- (6.08 KiB) Downloaded 174 times
Re: Poisson Disc Sampling
This is pretty useful stuff!
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
"If each mistake being made is a new one, then progress is being made."
Re: Poisson Disc Sampling
Thanks! It started out as a simple starfield generator, but the more 'knobs' I add and 'dials' I turn, I'm seeing a lot of possibilities here. Since I really need to get around to learning shaders, I think the first project will be something that takes in the points and outputs 'nebula' type shading based on point density/age.
Re: Poisson Disc Sampling
My implementation (move mouse to create new circles)
press space to switch the view
press S to reset the field
press G to hide he grid
https://github.com/darkfrei/love2d-lua- ... c-sampling
https://www.youtube.com/watch?v=PlQuPHga82Q
press space to switch the view
press S to reset the field
press G to hide he grid
https://github.com/darkfrei/love2d-lua- ... c-sampling
https://www.youtube.com/watch?v=PlQuPHga82Q
- Attachments
-
- poisson-disc-sampling-02.love
- license CC0
- (1.57 KiB) Downloaded 146 times
Re: Poisson Disc Sampling
Situation, if the Poisson Disc Sampling allows just one connection to the old points.
https://youtu.be/cqcDK5IPvhM
https://github.com/darkfrei/love2d-lua- ... c-sampling
https://youtu.be/cqcDK5IPvhM
https://github.com/darkfrei/love2d-lua- ... c-sampling
- Attachments
-
- poisson-disc-sampling-03.love
- (1.66 KiB) Downloaded 149 times
Re: Poisson Disc Sampling
@darkfrei
Your implementation doesn't look quite as random and evenly distributed as the original. I see more patterns and lines among the samples.
Your implementation doesn't look quite as random and evenly distributed as the original. I see more patterns and lines among the samples.
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
"If each mistake being made is a new one, then progress is being made."
Re: Poisson Disc Sampling
You are right, it's not the same: in the original PDS the generated point will be chosen randomly, but here the generated point will be chosen near the mouse position is only.
But you can simulate the original simulation if you move mouse from starting point to the outside.
Points: Connections: https://youtu.be/SdPaPliAi7s
- Attachments
-
- poisson-disc-sampling-04.love
- (1.99 KiB) Downloaded 149 times
Who is online
Users browsing this forum: alexjgriffith and 2 guests