double C3DPerlinNoise::generateNoise1D(double x)
{
	x *= _frequency;
	int ix = (int)x;
	double s = x - ix;
	ix += _seed;
	double r1 = noise1d(ix);
	double r2 = noise1d(ix + 1);
	return interpolate(r1, r2, s) * _factorScale + _factorAdd;
}
示例#2
0
文件: Perlin.hpp 项目: 0----0/cppvox
float noise3d(uint x, uint y, uint z) {
        return noise1d(x + y * 67 + z * 101);
}
示例#3
0
文件: Perlin.hpp 项目: 0----0/cppvox
float noise2d(uint x, uint y) {
        return noise1d(x + y * 71);
}
static inline double noise2d(int x, int y)
{
	int n = x + y * 57;
	return noise1d(n);
}