Using noise to generate marching cube terrain?
===

I've succesfully made a marching cubes class in C# XNA and am using Lib noise to generate 3d perlin noise, but when I tried to generate terrain using the values of the perlin noise as the densities for my marching cubes it generates a large chunk of marching cubes with seemingly random triangles inside of them.  I separated the marching cube and gave it arbitrary 3d arrays of densities to run through so I could make sure everything was working and it looked fine, and I had the terrain generation code generate normal cubes and I got a normal looking terrain, but the problem is the corners of each cube gets values from the noise are always switching from negative to positive so fast that the marching cubes just look like a jumbled mess.

This is the code I'm using to generate the terrain: 

     public MarchingCube[, ,] getTerrainChunk(int size, int stepsize)
        {
            MarchingCube[, ,] temp = new MarchingCube[size / stepsize, size / stepsize, size / stepsize];
            for (int x = 0; x < size; x += stepsize)
            {
                for (int y = 0; y <size; y += stepsize)
                {
                    for (int z = 0; z < size; z += stepsize)
                    {
                        Vector3[] corners = { new Vector3(x,y,z), new Vector3(x,y+stepsize,z),new Vector3(x+stepsize,y+stepsize,z),new Vector3(x+stepsize,y,z), new Vector3(x,y,z+stepsize), new Vector3(x,y+stepsize,z+stepsize),
                           new Vector3(x+stepsize,y+stepsize,z+stepsize), new Vector3(x+stepsize,y,z+stepsize)};
                        float[] densities = { GetDensity(corners[0]),GetDensity(corners[1]),GetDensity(corners[2]),GetDensity(corners[3]),GetDensity(corners[4]),
                                                GetDensity(corners[5]),GetDensity(corners[6]),GetDensity(corners[7])};
                        if (x == 0 && y == 0 && z == 0)
                        {
                            temp[x / stepsize, y / stepsize, z / stepsize] = new MarchingCube(densities, corners, device);
                        }
                        else
                            temp[x / stepsize, y / stepsize, z / stepsize] = new MarchingCube(densities, corners);
                    }
                }
            }
        return temp;
     }

and the GetDensity method is as follows:

    private float GetDensity(Vector3 point) 
    {
      return (float)terrain.GetValue(point));
    }

I think the problem is that I'm not using the noise correctly to get the densities of the marching cubes corners, but so far my google search results haven't been much help at all. So does anyone know how to use the noise properly to generate smooth looking terrain? Or what else may be causing this problem? 


