How to simulate the object cutting with a lathe, similar to what's done in the CRAFT: Work VR Shop app?
I implemented the effect by doing a virtual lathe. I used Unity for simplicity, but this can be done in pretty much anything. First I had to generate a cylinder:
Instead of simply doing a normal cylinder, I generated a line of points and rotated them around. This way if I change the height of the vertices on that single line, it will affect the whole shape. For instance here's a sine wave:
(I upped the sideways resolution a bit to make it look nicer)
Now let's add a carving tool:
The only thing left to do is to detect when the carving tool gets closer to the object, than the width of it at that point and if it does, remove some of it:
And that's it. It still has some problems you need to fix, e.g.:
- It doesn't do dynamic collision, so if I were to move the carving tool too fast, it would leave strange artifacts
- It's missing dynamic detail. You might not want to spend a lot of rendering time on relatively simple objects
But those should be easy to do (moving the tool only in small increments and checking the distance between vertices every frame respectively).