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

center point not calculating properly #23

Open
ghost opened this issue Jul 25, 2016 · 2 comments
Open

center point not calculating properly #23

ghost opened this issue Jul 25, 2016 · 2 comments
Labels

Comments

@ghost
Copy link

ghost commented Jul 25, 2016

I noticed the effect seemed off when using this, so I used higher than normal values to more prominently show how, if the mouse is placed in the center of the element or window both should essentially show the perspective elements all lined up. but its not, the center point is closer to the top left corner of the window.

If you move the mouse pointer all the way to the left and right side of the window, you will notice it rotates more when the cursor is on the right hand side, that also shows that there is more distance between the center point and the right edge than on the left side, it should be even if the point was in the correct center of the window / element.

I setup a code pen to show the effect.
https://codepen.io/oconnalex/pen/xOjpNY/

@hellsan631
Copy link
Owner

hmm, your right, thanks for the demo. This was a problem I had before, but I thought I got rid of it. Guess not. I'll take a look into this asap.

@hellsan631 hellsan631 added the bug label Jul 25, 2016
@ghost
Copy link
Author

ghost commented Jul 25, 2016

I was looking through the code in the jquery.logosDistort.js file trying to figure out a solution and noticed if I removed the '/2' from the following two lines, it works fine.

line 400 return appliedX - (this.center.x/2);

line 404 return appliedY - (this.center.y/2);

Here is a link to a new demo
http://demos.alex-oconnell.com/3dimg/demo.html

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

No branches or pull requests

1 participant