I'm trying to make a simple 3D editor, but I'm not sure how I should go about it. I have come up with two options:
- In the first option, I would store a non-transformed model, a cached model that stores transformations on faces and edges, and a display model that stores the already fully transformed model. If I scale the model, I would take vertex information from the cache, and the model would not be destroyed if I scale it to a straight plane. All of that sounds good, but with this solution, I have faced this problem and I have no idea how to solve it. If you have any ideas, please let me know. Basically, I wanted to do this only for optimization of the full model scaling operation.
- My second option (and plan B) is to store applied transformations for each vertex, so I will have an origin model and a display model. This way, I don't need to do some inverting or mapping of tool axes to unscaled space. The cache model should also have been implemented in that way, so it seems like not a bad solution. The memory cost will be quadratic + translation = 16 bytes, which is about 32KiB on 1000 vertices. That is more than enough for my needs, but I'm just interested to know if there is a better solution out there.