[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Camera thoughts



MAO wrote:


> 	This seems to work fine, but if, for example, I pitch up, and start
> just applying yaw repeatedly, I notice that the camera slowly starts
> leveling, canceling the initial pitch. Obviously the Up vector is
> getting screwed up, but I can't notice why. Or is my approach just wrong
> in the first place?

You're running into the Dreaded Gimble Lock Problem - read Steve's excellent 
Omniverous Biped FAQ at

http://www.sjbaker.org/steve/omniv/index.html

specifically the Eulers are Evil section.

For doing anything more than simple camera movements I really would 
recommend that you read up on Quaternions. There are some links to
explanations on lgdc, you'll also turn up a few articles if you search on 
Gamasutra (if you don't have a gamasutra account, get one now - its free, 
and you get access to an incredible amount of information) Game tutorial 7
on NeHe's websie also covers Quaternions:

http://nehe.gamedev.net/trentp/gametutorials/lesson07.asp

There are three or four articles on them in Game Programming Gems (ISBN 
1-58450-049-2 - the book is worth getting even if you don't need to know
about Quaternions!)

Chris
-- 
  .------{ http://www.starforge.co.uk }-----. .--------------------------.
=[     Explorer2260, Designer and Coder     \=\ P: TexMaker, ROACH, site \
=[___You_will_obey_your_corporate_masters___]==[ Stack: EETmTmTRRSS------ ]