Original Post
Hi would it be possible to convert some DirectX code to XNA C#? float Noise(int x) { x = (x<<13) ^ x; return (1.0 - ((x * (x*x * 15731 + 789221) + 1376312589) & 0x7fffffff) / 1073741824.0); } float CosInterpolate(float v1, float v2, float a) { float angle = a * D3DX_PI; float prc = (1.0f - cos(angle)) * 0.5f; return v1*(1.0f - prc) + v2*prc; } HRESULT HEIGHTMAP::CreateRandomHeightMap(int seed, float noiseSize, float persistence, int octaves) { //For each map node for(int y=0;y 255)b = 255; //Save to heightMap m_pHeightMap[x + y * m_size.x] = (b / 255.0f) * m_maxHeight; } return S_OK; } thanks