Skip to content

Instantly share code, notes, and snippets.

@roxlu ☾ roxlu

Block or report user

Report or block roxlu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
roxlu / fun.cpp
Last active Jul 11, 2019 — forked from kizzx2/fun.cpp
Using lua 5.2 with C++
View fun.cpp
// fun.cpp
// This is for Lua 5.2, for Lua 5.1, see
#include <lua.hpp>
#include <iostream>
#include <sstream>
class Foo
roxlu / fun.cpp
Last active Aug 29, 2015 — forked from kizzx2/fun.cpp
View fun.cpp
// fun.cpp
extern "C"
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
#include <iostream>

Mitchell’s best-candidate algorithm generates a new random sample by creating k candidate samples and picking the best of k. Here the “best” sample is defined as the sample that is farthest away from previous samples. The algorithm approximates Poisson-disc sampling, producing a much more natural appearance (better blue noise spectral characteristics) than uniform random sampling.

See also the white-on-black and Voronoi variations of this example.

You can’t perform that action at this time.