I want to transform a cube into a 4 sided figure like an octagon cut in half . The bottom will be flat.
On the sides I dont care .

How do I do this

Show an image of what exactly you want to start with and what you exactly want it to turn into (my mind reading skills are a little rusty). From your very limited description like this ? http://screencast.com/t/ZML8etqi

yes that is it (well done) but lying on flat surface.
Anyway this is the shape so what do i do?

For a plane changing to half an octagon (this is 2d but the same process for the 3d version)