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

Pan and device orientation, not right when device turn 90º #31

Open
MarkEhr opened this issue Nov 16, 2015 · 2 comments
Open

Pan and device orientation, not right when device turn 90º #31

MarkEhr opened this issue Nov 16, 2015 · 2 comments

Comments

@MarkEhr
Copy link

MarkEhr commented Nov 16, 2015

Hi there,
inside the method panHandler: there are two times when you use your method vectorFromScreenLocation:inAttitude: and you use the _offsetMatrix as the attitude parameter. This causes that when the device is turned 90º (like change from landscape to portrait or vice-versa) the pan gesture is inverted from vertical and horizontal motion (i.e. move the finger to the right and the image moves up). I was wondering if there's a reason why you use this matrix instead of the _attitudeMatrix as the attitude parameter. I have made this change and works fine but wanted to ask if there's a reason for that so my change could have some side effects.
PS Thank you very much for your work, this have saved me a lot of work
PPS I have solved the head tilt on my fork, still a little buggy on nadir and zenith but no tilted horizon. Will make pull request when I can stabilise nadir and zenith.

@fruitcoder
Copy link

Hi @MarkEhr! Could you share have how you used the _attitudeMatrix? Thanks :)

@MarkEhr
Copy link
Author

MarkEhr commented Jul 12, 2016

@fruitcoder I just changed the parameter when the method is called.
I changed this lines inside the panHandler:
touchVector = [self vectorFromScreenLocation:[sender locationInView:sender.view] inAttitude:_offsetMatrix];
and
GLKVector3 nowVector = [self vectorFromScreenLocation:[sender locationInView:sender.view] inAttitude:_offsetMatrix];

for:
touchVector = [self vectorFromScreenLocation:[sender locationInView:sender.view] inAttitude:_attitudeMatrix];
and
GLKVector3 nowVector = [self vectorFromScreenLocation:[sender locationInView:sender.view] inAttitude:_attitudeMatrix];

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