-
Notifications
You must be signed in to change notification settings - Fork 16
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
Error in Canvas Coordinates Transformation #5
Comments
@Clydewang still not working for me after tried to fix. Can you send me your fixed demo? |
@mrnexeon Sure, no problem. Plz leave me your email address. |
@mrnexeon Oh, the code files was blocked by Gmail because of the security issue. Could you please describe the problem you are now facing? And did you only change these two lines I've mentioned without any others, right? |
@Clydewang yes, right |
@mrnexeon What does browser console say? Is there any error? |
@Clydewang THANKS A LOT! Changing only the 2 lines above solves the issue for me. Anyway I find out something weird: limiting the marker to 3 in app.js Please, can you check if it's happening on your code? |
Thanks @Clydewang , that 2 line fix has fixed everything. Created a PR for the fix: #7 |
@SilverGlow I have also fixed this issue. The very first markup (id is 0) will not work. I have fixed is as part of the same PR #7 (#7) |
I've run your demo, and like other post, it seems click event is not working well. And I examined your source code carefully and finally find out the cause.
In markupExt.js, after coordinates in canvas are acquired from event parameters, they are transformed into the relative coordinates in viewport which ranges from -1 to 1. However in your code, Line 56 and 57,
their ranges are (-1, 0), not (-1, 1).
And axis-direction also matters, y-axis is positive downward in canvas, while, according to documentation of THREE.js, it is positive upward in viewport. Positive direction of y-axis is reversed in the transformation. So I thought the expressions you want to write are
after fixing this, this demo works very well.
Thanks for your Markup Extension, it helped me a lot in my work. Nice work!
The text was updated successfully, but these errors were encountered: