RE: [Algorithms] Camera
Brought to you by:
vexxed72
From: Stephan R. <ke...@be...> - 2003-08-29 22:08:15
|
Thanks Garett, I will take a look at that link. To try to elaborate a bit more on what I'm looking for. I'm looking to write a camera class that can rotate any given amount in any given axis from any given orientation. Basically similar to my 3D Solid Modeler camera's I use for my mechanical engineering at work (Autodesk Inventor). I can rotate the camera freely in any axis from any orientation without having even the slightest deviation in any axis that I don't want to rotate in. I hope this explains it a bit more. The game I'm working on in my free time, will only require yaw/pitch when played (1st person view). However in editing mode I want a complete free rotating flying camera so that my artist has complete freedom of movement when editing the world to place objects, etc. Also for future projects, I may need a camera that has complete freedom of movement. Therefore I want to write this class right the first time around to be universal and work for any application I need it to. Thanks, Stephan -----Original Message----- From: gda...@li... [mailto:gda...@li...] On Behalf Of Garett Bass Sent: Friday, August 29, 2003 4:48 PM To: gda...@li... Subject: RE: [Algorithms] Camera Stephan, You can find some sample camera code using quaternions here: http://personal.nbnet.nb.ca/daveg/opengl/camera/index.html Note that, pitching up 90 degrees, yawing right 90 degress, then pitching down 90 degrees, is the same as simply rolling right 90 degrees. Perhaps the roll you are experiencing is due to the order in which your rotations are applied? I'm not sure I understand what you're trying to acheive. If it is your intent that yaw should always be relative to the world's vertical axis, then you may need to consider a different approach. Perhaps you could store a pitch vector and a yaw vector, and cross the two to create a roll vector per frame? This would allow you to flip over completely, but when you're looking straight up, world yaw == camera roll. It may be helpful to have a more complete explanation of the effect you are looking for. Will this camera represent the viewpoint of a person standing upright on the ground, or an astronaut floating free in space, or something else entirely? Regards, Garett Bass gt...@st... -----Original Message----- From: gda...@li... [mailto:gda...@li...]On Behalf Of Stephan Rose Sent: Saturday, August 30, 2003 1:52 PM To: gda...@li... Subject: RE: [Algorithms] Camera Thanks for your responses everyone, but even using quaternions I just cannot get this to work right. If I take my input from my mouse to yaw and pitch the camera, the inputs are all delta angles, create my delta quaternion from that, multiply that by my existing orientation to get the new orientation, I still get the roll problem. Even if I normalize the new orientation quaternion afterwards, no difference. Where am I going wrong here? How do I properly determine the new target orientation based on my current orientation and the delta? Thanks, Stephan ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ GDAlgorithms-list mailing list GDA...@li... https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=6188 |