Rotation problem in IPhone

edited May 2010 in Help request
I Know how to set Rotation of camera to set different orientation of IPhone.But when I rotation the camera,the axis is not rotated,so I need to use a strange axis to set all objects position.It's weird.
Or there is another way to do this?

I know this is a IPhone special problem....but it is a big problem for me.....

Comments

  • edited May 2010
    I'm not sure to understand what your problem exactly is. :S

    When you rotate the camera, only the objects being children of this camera will follow (ie. look static relatively to your device), all the others will move around (follow your device orientation if you set the camera the same way as I did in the iPhone demo packaged with the release).

    Can you give me a more specific example?
  • edited May 2010
    when I set camera setting like below:
    [Camera]
    FrustumWidth = @Display.ScreenWidth
    FrustumHeight = @Display.ScreenHeight
    FrustumNear = 0.0
    FrustumFar = 2.0
    Position = (0.0, 0.0, -1.0)
    Zoom = 1.0
    Rotation = 90

    the original coordinates(the standard cartesian coordinates) I could set to objects have not changed with the Camera rotation.
    when I rotate my device and set camera like this,I have to set any object's position with a coordinates not rorated.....(in a person's view)you must know,This time the device is rorated.
    for a simple expression,I did't want to rotate camera at all,the really thing I want to rorate is the viewport.But I couldn't find a way to make that.
  • edited May 2010
    And if I understand correctly your description it's what is expected: the objects are in a world space and are completely independent from any device rendering.

    Actually I find this way of working much more easier than being display-device dependent as you can change your mind at anytime without having to change your game code. Objects will always behave the same way in the world, it's just the way "you look at them" that changes. It also works very well with more than one viewport (for splitscreen multiplayer games, for example).
  • edited May 2010
    Writing code as in the rotated world is some kind of strange.....
    Can I ask a simple question?How to solve the problem when I need to allow player to rotate their device and I rotate the game world to let the game world up-down side right.If I just rotate the camera,the game world is in wrong way.
  • edited May 2010
    Mmh, I'm not sure I see the problem this time again, sorry about my dumbness. :/

    For example, in the small iPhone code sample shipped with the iPhone package of orx, the view follows the orientation of the device, but the "game" still runs in the same way. Why wouldn't it work for you?
    Except of course, instead of rotating all the time, you'd rotate only using 90 or 180 degrees steps?

    Let me know what is the thing that I'm missing.
  • edited May 2010
    May be I'm in the wrong way......
    For a concrete question,When I just rotated the camera and I display the FPS,It display in the wrong way,how to change it?
    with last config:
    [Camera]
    FrustumWidth = @Display.ScreenWidth
    FrustumHeight = @Display.ScreenHeight
    FrustumNear = 0.0
    FrustumFar = 2.0
    Position = (0.0, 0.0, -1.0)
    Zoom = 1.0
    Rotation = 90
  • edited May 2010
    Your settings are fine. =)

    As for the FPS display, it's the only display which is... hardcoded in orx. :(
    My bad, when I did it I didn't think of the portrait-landscape issue, I only made sure the display would be inside the first viewport if it was valid.

    I'll fix this in the future, but any other displayed object in orx isn't subject to this issue. It's only because I manually render the FPS string after all viewports/cameras have been rendered.
  • edited May 2010
    So wrong way i was in...............
Sign In or Register to comment.