The main problem I’m facing is how I can, given a spot on a terrain mesh (x and z coordinates) change the mesh so that the surrounding points also change height but will be less affected. What’s confusing me is how I could change the mesh when that spot is not a vertex within the mesh so that the mesh will accurately represent the given point changing height. Would I need to change the mesh entirely, changing the vertex points completely to accommodate for the new shape (so possibly making that point a new vertex in the mesh and thus changing the mesh entirely) or is there some other way to do it without having to restructure the mesh so that the vertices that are affected by the height change move which will then change the faces to be in accordance with the change in height

  • \$\begingroup\$ What is the goal of this? Is this purely graphical? Will you link this to an actual physics mesh so that players or object can move on it? \$\endgroup\$ – Vaillancourt Mar 12 at 0:48
  • \$\begingroup\$ For now it’s mostly graphical I just want to be able to manipulate it yes. In the future it may be that players can move around on it but for now that’s not my main goal \$\endgroup\$ – Elijah Villarmia Mar 12 at 7:20
  • \$\begingroup\$ A triangle mesh seems like a bad representation for mouse editing. For example, Minecraft does not store the world as a triangle mesh, it just converts it to one for display. Here is how they edited terrain in The Witness. \$\endgroup\$ – user253751 Mar 12 at 10:52
  • \$\begingroup\$ Interesting, I’ll have a look at that, that looks like a reasonable solution to my problem. I’ll just need to see if I can reasonably implement that. Thanks! \$\endgroup\$ – Elijah Villarmia Mar 13 at 14:56
  • \$\begingroup\$ Assuming you have a mesh, if you need it e.g. for collision things you'd have to change it. If you only extrude it for visuals like in a heightmap you'd simply pass in the mouse position into the pipeline and calculate the offsets depending on distance of the current vertex, e.g. via cubic interpolation in the vertexshader or whatever function you'd like. I am sure there a ton of other possibilities to do it. \$\endgroup\$ – user136710 Mar 15 at 22:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.