I'm coming for advice how to make flatten tool with option angle.
What I have done?
Simple, I have whole function for making flat terrain, also in following picture you can see its working.
I'm using following formula to making terrain flatten:
// @change(float) = pow(0.2f, dt) // @mapData[index](float): heightmap // @y(float): height at cursor position float changeFormula = change * mapData[index] + (1 - change) * y; mapIndex[index] = changeFormula; // sending mapIndex[index] to repaint
Now what I want to do with terrain?
Simple again... following picture for better describing
Biggest trouble for me is making formula, I don't know how to make it. If you are math genius tell me please what I need or if its very easy for you if you can solve it.