Randomness
Random Points within Cylinder
Random Points on Cylinder Surface
This code snippet generates uniformly distributed random points on the surface of a 3D cylinder, either on its two caps or along the length of the cylinder, taking the surface area of each section into account.
Random Points within AABB
Code snippet for generating random points within an AABB (axis-aligned bounding box)
Random Points on Rectangle Perimeter
Shows how to generate random points along the perimeter of an arbitrary 2D rectangle.
Random Points in Disc
Simple code snippet that demonstrated how to generate random points on a flat disc that are uniformly distributed and do not become more dense near the disc's center.
Random Points on Disc Perimeter
Snippet for generating random points along the perimeter of a flat disc (or circle)
Random Points within Sphere
This code snippet generates random points inside a sphere with uniform distribution. Unlike commonly used rejection methods, this code generates only valid points, ensuring deterministic runtime performance.
Random Points on Sphere Surface
Code snippet for generating uniformly distributed random points on the surface of three-dimensional spheres. This method ensures a perfectly uniform distribution and avoids the common problem of having a higher density of points near the sphere's poles.
Random Points on AABB Surface
Explains how to generate uniformly distributed random points on the surface on an AABB (axis-aligned bounding box)