I'm trying to implement this algorithm in opengl to draw a fractal but i'm confused.... 
The pseudocode that I found is:
<<
Square Step:
1. Given four points in a square shape.
2. Find the centre (midpoint) point of the square.
3. Calculate this midpoints height value by averaging the heights of the four corners.
4. Displace the midpoint by a random value in the range (-sigma, sigma).
5. Proceed to Diamond Step, for each of the diamonds created by this step, with the same sigma value. Diamond Step:
1. Given four points in a diamond shape.
2. Find the midpoint of the square.
3. Calculate the height value of the midpoint by averaging the four corners.
4. Displace the midpoint by a random value in the range (-sigma, sigma).
5. Proceed to Square Step, for each of the diamonds created by this step, with a new sigma value.
sigma(new) = sigma * 2^roughness
Diamond Step:
1. Given four points in a diamond shape.
2. Find the midpoint of the square.
3. Calculate the height value of the midpoint by averaging the four corners.
4. Displace the midpoint by a random value in the range (-sigma, sigma).
5. Proceed to Square Step, for each of the diamonds created by this step, with a new sigma value.
sigma(new) = sigma * 2^roughness >>
If i start with four points in a square shape, how does it have height? and how does the midpoint have height? Can anyone show me a quick example?
			
			The pseudocode that I found is:
<<
Square Step:
1. Given four points in a square shape.
2. Find the centre (midpoint) point of the square.
3. Calculate this midpoints height value by averaging the heights of the four corners.
4. Displace the midpoint by a random value in the range (-sigma, sigma).
5. Proceed to Diamond Step, for each of the diamonds created by this step, with the same sigma value. Diamond Step:
1. Given four points in a diamond shape.
2. Find the midpoint of the square.
3. Calculate the height value of the midpoint by averaging the four corners.
4. Displace the midpoint by a random value in the range (-sigma, sigma).
5. Proceed to Square Step, for each of the diamonds created by this step, with a new sigma value.
sigma(new) = sigma * 2^roughness
Diamond Step:
1. Given four points in a diamond shape.
2. Find the midpoint of the square.
3. Calculate the height value of the midpoint by averaging the four corners.
4. Displace the midpoint by a random value in the range (-sigma, sigma).
5. Proceed to Square Step, for each of the diamonds created by this step, with a new sigma value.
sigma(new) = sigma * 2^roughness >>
If i start with four points in a square shape, how does it have height? and how does the midpoint have height? Can anyone show me a quick example?
				
		
			