PDA

View Full Version : Rotate vector



09-05-2000, 10:21 AM
Hello all. I know openGL takes care of the gimbol lock problem with their rotation functions, but is there an easy way to use openGL to rotate an arbitrary vector? The reason why is, I'm doing my own lighting, and I want to rotate the direction of the light. Gimbol lock is rearing its ugly head, and I don't want to learn quaternions right now, and maybe never. Can openGL rotate this for me?

XBCT
09-07-2000, 03:29 PM
Hi!
There are ways to get back rotated vertices but like most "read-functions" this is not fast and stalls the pipeline....But No fear guy you donīt have to learn about Quaternions to solve your problem....Just get your ModelviewMatrix(with glGet()) and then multiply your vector by this matrix and voila you have your nicely rotated vector....

HTH,XBTC!