void copyNoiseToHeightmap(Perlin& pn, RECT rc, HeightMap<T>* pHMap, int tMax)
	{
		int x,y;
		float xStep = 1.0f/(rc.right-rc.left);
		float yStep = 1.0f/(rc.bottom-rc.top);

		//Perlin产生的值域在[-振幅,+振幅]之间
		//--缩放到0-255的区间
		float offset = pn.GetAmplitude();
		float range = pn.GetAmplitude()*2;

		for(y=rc.top; y<rc.bottom; y++)
		{
			for(x=rc.left; x<rc.right; x++)
			{
				float n = pn.Get(x*xStep, y*yStep);
				T tn = T((n+offset)/range*tMax);
				pHMap->setValue(x, y, tn);
			}
		}//endof for
	}