The short question is: What's the math to move the face of a cube? I.e. how to stretch (or shrink) a cube in the direction of one of its faces?
Here's a picture:
The camera shows a cube (left). When the user clicks and drags on one of the faces (yellow), the face (it's vertices) should follow the mouse and as a result expand (or shrink) the cube in the given direction (like the right cuboid in the picture above).
Please note that this should be done ingame, by moving the vertices, not by scaling the object.
Now, I already have the selected face and all the vertices of its four corners. Further, the distance how far it should be moved is also known. The question is, what needs to be done with the vertices to pull the face out (or push it in)? Whats the math?
Your help is very much welcome. Thank you.