-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a documented account of how to access picking? #269
Comments
Are you looking for the buildPickGui() in scr/polyscope.cpp? |
I'm guessing in C++? There are the std::pair<Structure*, size_t> pickAtScreenCoords(glm::vec2 screenCoords); // takes screen coordinates
std::pair<Structure*, size_t> pickAtBufferCoords(int xPos, int yPos); // takes indices into the buffer This gives you a pointer to which structure is at that screen location, and an index indicating which element within the structure you clicked on. E.g. for a point cloud this is just the index of a point. But the API here is real ugly for meshes etc. In this case, the local index is into a combined index space with elements ordered sequentially as This isn't very easy to use :) I will mark this bug as a TODO to remind me to add a better API for testing if a vertex was clicked etc. |
Actually you should use std::pair<Structure*, size_t> pickAtScreenCoords(glm::vec2 screenCoords); // takes screen coordinates
std::pair<Structure*, size_t> pickAtBufferCoords(int xPos, int yPos); // takes indices into the buffer rather than the old |
There are some examples here for writing such mouse interactions https://polyscope.run/features/callbacks_and_UIs/#mouse-interactions |
Thanks. Indeed this is very useful to have explicitly (for mesh/quantity editing etc.) |
Hi. I want to know if I can use these functions in Python. It seems that it doesn't work. Should I write the functions myself? Thank you. |
I am trying to access the picking of faces or vertices within a callback function to manipulate their content. However I didn't find any explicit way to do this in the documentation. Is this written somewhere?
The text was updated successfully, but these errors were encountered: