Undo / Redo in three.js scene

hello,
any idea how to make an undo / redo in three.js?
a lot of ram is required?

You should study how the editor implements this feature. The general idea is to encapsulate all possible actions (add an object, set a material etc.) in so called Command objects. You can then build a history of those commands and enable undo and redo operations by moving backwards and forwards in the history.

a lot of ram is required?

There is no easy answer for this. It heavenly depends on the actions the user performs in the editor. If the user adds a lot of complex objects and then performs undo operations, the editor still has to retain these objects in the redos list. So yeah, this will take quite a lot of memory.

3 Likes