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

Unable to read position values #11

Closed
amunology opened this issue May 5, 2014 · 5 comments
Closed

Unable to read position values #11

amunology opened this issue May 5, 2014 · 5 comments

Comments

@amunology
Copy link

Hello! Thank you for the wonderful work that you've done here.

For some reason, I'm unable to read any of the position values in your demo. For example, Azimuth and Altitude are always showing me 0, as are all the other vector and matrix values in there.

I assume I am doing something wrong. I have not actually modified the demo - I have only attempted to read the values.

Can you please elaborate for a moment on the proper method of doing this? Thank you.

@mayakraft
Copy link
Owner

orientation updates including _lookAzimuth and _lookAltitude get requested inside the draw function, is the screen being re-drawn?
i wonder if motion manager is being setup properly. what device are you running it on?
can you put logs in some functions for me?:
make sure -(void)updateLook is being called.
as well as seeing if (GLKMatrix4)getDeviceOrientationMatrix is entering the if statement: if([motionManager isDeviceMotionActive]), and check just incase CMRotationMatrix a is being filled with all zeros.

@amunology
Copy link
Author

The screen is being re-drawn, and the panoramic functions work perfectly (both manual and accelerometer-based). Basically, if I didn't need to read the position values, I would not have any issues.

The only change I did was to uncomment some code for manual finger panning. Without doing so, manual panning would not work (although I have set setOrientToDevice to No.

  • I am running this on an iPad 2.
  • updateLook is being called. Trying to output/view the value of _lookAzimuth or _lookAltitude in that function returns 0 (I know, it makes no sense to me either).
  • GetDeviceOrientationMatrix is in fact entering that If-statement, and CMRotationMatrix a is being filled with all zeros, although I'm not sure whether that is the case, or it is only a part of the "zero" effect I've been getting when checking any of the values.

Thank you so much for your quick response, by the way. I appreciate it.

@amunology
Copy link
Author

Update: I changed setOrientToDevice back to YES. When I did that, I got proper values for _lookAzimuth and _lookAltitude.

I suppose you commented the manual panning code due to certain issues? I also noticed that buildOrientationMatrixAz does not exist, and so I had to leave that out (which is why I'm getting 0s).

I think I have found the problem.

I would like to hear your thoughts on a possible solution.

Thank you very much! :)

@mayakraft
Copy link
Owner

oh yes! that's it exactly. i just added hotspots and reworked the whole touch interface and that broke the pan gesture, so yes everything associated with it is not guaranteed to work. i'm sorry you had to figure that out the hard way.
i'll reprioritize this and get it working soon- hopefully with a more elegant pan-gesture-rotation matrix instead of storing az-alt rotation. thanks for being patient!

@amunology
Copy link
Author

No worries at all, thanks a lot for the prompt responses!

It's an elegant piece of work, I think :) I'll be on the lookout for future updates. Thank you. All the best! Have a good day.

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