Seeds Zine

Page 76

2D and 3D distributions Random 2D vector in a circle When writing procedural generation systems it is often desirable to be able to generate a 2D or 3D vector that falls uniformly within a circle or sphere. That is to say the vectors direction is random, and its magnitude ranges from (0.0, 1.f]. This can be useful for applications such as random sampling around a point, making random walks and stochastic approximations like ambient occlusion.

74


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.