Skip to content
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

The coordinate of click is not correctly returned #18

Closed
xuzheng0927 opened this issue Nov 13, 2016 · 4 comments
Closed

The coordinate of click is not correctly returned #18

xuzheng0927 opened this issue Nov 13, 2016 · 4 comments

Comments

@xuzheng0927
Copy link

The pos returned from function "unproject_mouse" is not consistent with the mesh coordinate.

I tried printing xPos, yPos, _width, _height after I clicked the right bottom corner, and I got:

xPos: 326.086, yPos: 325.675, width: 800, height: 800

I am using Mac. Anybody has an idea why this happens?

@taiya
Copy link
Owner

taiya commented Nov 13, 2016

The trace code is meant to be run on the lab. I assume your mac might have a retina screen?
If you want to use your laptop, you'll have to apply a correction to re-scale it properly.

I think I had this fixed it for the generic trackball window, see this code:
OpenGP::TrackballWindow::mouse_move_callback(double x_window, double y_window)

@xuzheng0927
Copy link
Author

I see that.. what a headache

On Sat, Nov 12, 2016 at 10:01 PM, Andrea notifications@github.com wrote:

The trace code is meant to be run on the lab. I assume your mac might have
a retina screen?
If you want to use your laptop, you'll have to apply a correction to
re-scale it properly.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#18 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AI3gFH50wkCO-6QEIdRLwrno3Fzcvh8Fks5q9qfDgaJpZM4Kwm3x
.

@taiya
Copy link
Owner

taiya commented Nov 14, 2016

Unfortunately there is no way for the TA to help you, as he doesn't have a Mac+Retina computer available for testing :\

@xuzheng0927
Copy link
Author

I might be able to re-scale it when dealing with the 2D grid, but the 3D grid should be difficult for me (how to get the z coordinate value?) Anyway I cannot spend too much time on this. If the code works on the computers in the lab, I may have to spend most of my time in the lab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants