Jump to content
Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.
Posted 24 September 2012 - 12:36 PM
Posted 24 September 2012 - 12:50 PM
Posted 26 September 2012 - 07:14 AM
Let be the mean distance between each point, and be the required variance.
1. Generate a regular lattice spaced by in every dimension.
2. For each point in the lattice:
- choose a random angle (or two, if you are in three dimensions) to displace the point in some direction in space
- generate a random variable following a Gaussian distribution* with your variance but with mean 0
- displace the point by units in the direction determined by the angle chosen above
- if the point falls outside or too close to your convex hull, try again until it works (this is biased, but I think it's acceptable given that considering the shape of the hull would likely be intractable)
* see Box-Muller transform to get that from uniform variables
Edited by Bacterius, 26 September 2012 - 07:31 AM.
“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”
Posted 27 September 2012 - 01:37 AM
Omae Wa Mou Shindeiru
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.