Results 1 to 14 of 14
  1. Goyena's Avatar
    Posts
    893 Posts
    Global Posts
    894 Global Posts
       #1  
    I'm fuzzy on this pitch and roll thing. Does anyone have an app to display the orientation events data? Or I guess I could just go ahead and modify the API Demo app...
  2. #2  
    pitch and roll just give you the angle your phone is tilted in degrees. Ranging from ~-90 to ~90. Basically, the developer site is kinda confusing and they're actually amazingly easy to use. I actually have an app in my ares account that does what you asked. It just outputs the raw data and points an arrow in the direction your phone is tilted. It took me like 5 minutes to make, but if you like I can post it when I get back to my computer this evening.
  3. Goyena's Avatar
    Posts
    893 Posts
    Global Posts
    894 Global Posts
       #3  
    That'd be great. I want to see if I can make the patch that opens the camera automatically when the phone is unlocked horizontally a bit more restrictive than just "left" or "right".

    You're right though - I was confused by the dev guide, so I wanted to try it out on a real device to see the values change. Thanks in advance!
  4. #4  
    sorry this took so long. I forgot to get this to you yesterday.
    Attached Files Attached Files
  5. Goyena's Avatar
    Posts
    893 Posts
    Global Posts
    894 Global Posts
       #5  
    Thanks U.S.! I packaged it up but am having a bit of trouble getting it to run, the icon just pulses and the card never expands. I haven't had a chance to peer inside yet; any clue right pff the bat that could save me the trouble?
  6. #6  
    Oops. Left out a few files... Here it is again.
    Attached Files Attached Files
  7. Goyena's Avatar
    Posts
    893 Posts
    Global Posts
    894 Global Posts
       #7  
    @uS, thanks a lot! I was finally able to install your app last night (had a few days off) and it's exactly what I was looking for. You saved me a bit of time coding (since I am pretty rusty).

    In the meantime, I found an Accelerator App in the App Catalog which records the acceleration.

    Used together (essentially what I was looking for in the sample API app from the SDK) they give me a pretty good idea of what numbers to find in the Orientation events.

    Thanks again.
  8. #8  
    Glad to help. Also, if you're interested. I'm working on a game that uses the accelerometer. It's open source so you can just grab the code from sourceforge site. Just thought it might help to see the accelerometer in practical use.
  9. Goyena's Avatar
    Posts
    893 Posts
    Global Posts
    894 Global Posts
       #9  
    I'll definitely try it; the screen shots remind me of Zaxxon. Ah the nostalgia.

    BTW, how are you at patches? I'm trying to tweak this one into usability:
    http://forums.precentral.net/webos-p...ml#post2122924
    The developer hasn't answered, so I thought I'd try to refine it. What it does is automatically open the camera app if the Orientation is "left" or "right". Great idea, but if you hold the Pre just the least bit crooked (even though vertical) it'll open.
  10. #10  
    Yeah, it's based on that old java web-game Jet Slalom... As to the patch, as it sits, it'll be kinda hard to constrain to specific values... And the problem with that patch, I found, is that we tend to lay our phones flat and twist them to the side as we open them. It's just the natural motion of the hand. In this instance, the phone is correct to assume a left or right orientation.
    Out of curiosity, do you usually open your phone with your right hand or your left?
    danNielson.com - Slalom - twitter - facebook
    A posted thanks dies with the thread. Clicking the button lasts until the admins get bored with this site and throw it in the recycling bin.
  11. Goyena's Avatar
    Posts
    893 Posts
    Global Posts
    894 Global Posts
       #11  
    Left normally. But sometimes right too.

    I thought I could make the conditional more restrictive. Instead of just "right" and "left", require that pitch is (...checking the your app...) between -15 and +15, and roll is > 85 and < -85.

    The problem is I've never made a patch before and my javascript ability is pretty sucky. I can however rewrite a conditional statement. (I think...)
  12. #12  
    as far as I know, the only way to get the pitch and roll is with a orientationchange event handler. I'm not saying it'll be impossible. Just hard, since orientationchange events only fire when the screen is fully active... Meaning not dimmed. As a sort of quick fix, you may try removing the whatever == left statement. I don't know about you, but when I open my phone with my left hand I instinctively tip it to the left. Constraining the patch to only work when tilted right(volume buttons up) should reduce your false launches by quite a lot.
  13. Goyena's Avatar
    Posts
    893 Posts
    Global Posts
    894 Global Posts
       #13  
    Brilliant, why didn't I think of that? Right-handed and left-handed variants of the patch. Excellent idea.

    (Thx again. Didn't know that about orientationchange only firing when the screen's awake...)
  14. #14  
    Yeah, it's likely also part of the problem with the current patch. Actually, now I'm thinking it may be a good idea to set a self-deleting orientationchange handler inside the function provided by the patch... That way it gets set when unlock is called, kicks in as soon as the screen activates, and then promptly deletes itself so it doesn't mess anything up...
    danNielson.com - Slalom - twitter - facebook
    A posted thanks dies with the thread. Clicking the button lasts until the admins get bored with this site and throw it in the recycling bin.

Posting Permissions