At 11:43 AM +0100 5/27/04, Robert Ward wrote:
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.
I do that in my Cubic Panorama demo (on the CD, maybe also
downloadable from the website; ask me if you can't find it in either
place). What I do is simply keep mPitch and mYaw variables, which I
increment based on the mouse or keyboard. Then to update the camera,
I do something like this:
cam.orientation.SetRotateAboutAxis( 0.0, 1.0, 0.0, mYaw )
cam.Pitch mPitch
The first line resets the orientation of the camera to just the yaw,
and then the second line pitches it from there. Now all you have to
do is limit mPitch to the range [-pi, pi] and you're done.
Best,
- Joe
--
,------------------------------------------------------------------.
| Joseph J. Strout REAL Software, Inc. |
| joe at realsoftware dot com http://www.realsoftware.com |
`------------------------------------------------------------------'
_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|