eth-igl / gp2024-Assignments

0 stars 0 forks source link

Deleting old mesh / loading new one (in GUI) #3

Open yuhanliu-tech opened 4 months ago

yuhanliu-tech commented 4 months ago

Hi,

I noticed that the GUI load mesh option adds an additional mesh to the scene, as opposed to replacing the original mesh. Also, the key callbacks (e.g. pressing 1 to show vertex-face relations) are still only applied to the original mesh.

I was wondering if there is a way to delete the current mesh and add a new one so operations are performed on the new one? I assume we will need to switch meshes in the live demo.

Thanks!

pratyai commented 4 months ago

There is a given load_mesh function which can be used with igl::file_dialog_open() (and some plumbing to interface with the key events or an extra ui button).

PeizhuoLi commented 4 months ago

Hi everyone,

During the live demo you are not expected to switch meshes on the fly. It is okay to restart the program for reloading. But you are expected to load a new mesh without compiling your code, i.e. the file name of the target mesh should not be hard-coded in your source code.

Best, Peizhuo