Example #1
0
int main( int argc, char **argv ) {

	uint32 cycle, nbCycles = 5;
	if (argc == 1)
		cycle = 112952;
	else
	{
		if (argc >= 2)
			sscanf(argv[1], "%d", &cycle);
		if (argc >= 3)
			sscanf(argv[2], "%d", &nbCycles);
	}
	// nbCycles*9/(60*24*365) years worth
	// 1 year = 58400 weather cycles
	printf("; %dbit platform\n", cpuPlatform);
	printf("; cycle=%d, nbCycles=%d\n", cycle, nbCycles);

	NLMISC::CNoiseValue nv;

	NLMISC::OptFastFloorBegin();
	for(uint32 i=cycle; i < (cycle + nbCycles); ++i){
		float noiseValue = nv.eval(NLMISC::CVector(i * 0.99524f, i * 0.85422f, i * -0.45722f));
		noiseValue = fmodf(noiseValue * 10.f, 1.f);
		printf("%d, %f\n", i, noiseValue);
	}
	NLMISC::OptFastFloorEnd();


	return 0;
}
Example #2
0
// *******************************************************************************************
float computeUniformNoise(const NLMISC::CNoiseValue &nv, const CVector &pos)
{
	NLMISC::OptFastFloorBegin();
	float value = nv.eval(pos);
	value = 10.f * fmodf(value, 0.1f); // make repartition more uniform
	NLMISC::OptFastFloorEnd();
	return value;
}