realbasic-games
[Top] [All Lists]

rb3d: limiting rotation, quaternions into angles

To: <realbasic-games at lists dot realsoftware dot com>
Subject: rb3d: limiting rotation, quaternions into angles
From: "Robert Ward" <r dot ward at bangor dot ac dot uk>
Date: Thu, 27 May 2004 11:43:52 +0100
Delivered-to: realbasic-games at lists dot realsoftware dot com
List-help: <mailto:realbasic-games-request@lists.realsoftware.com?subject=help>
List-id: REALbasic Games <realbasic-games.lists.realsoftware.com>
List-post: <mailto:realbasic-games@lists.realsoftware.com>
I'm having the orientation of rb3dspace camera follow the mouse using the
camera.yaw and camera.pitch commands. The tracking is based on the
distance of the mouse from the screen center. So for example, if the
mouse is in the upper part of the rb3d space, the camera will rotate up,
so that it looks straight up, then keep going to look backwards, then
straight down, then back to start, and so on.

It seems to work fine, except that I want to limit the amount of pitch,
so that the camera never looks backwards, ie I want to stop pitch
rotation if the camera is already looking straight up or down. But I
can't figure out how to convert the quaternion representing camera
orientation into something that I can interpret as straight up or down.
Is there anyway to convert quaternions into angles?
Rob




_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>