3D rotation based on 2 vectors...

Started by
13 comments, last by Glaiel_Gamer 18 years, 1 month ago
couldn't you just use gluLookAt to generate the matrix using the two vectors, then apply that matrix to your object? Best way I can think of.
As your leader, I encourage you from time to time, and always in a respectful manner, to question my logic. If you're unconvinced that a particular plan of action I've decided is the wisest, tell me so, but allow me to convince you and I promise you right here and now, no subject will ever be taboo. Except, of course, the subject that was just under discussion. The price you pay for bringing up either my Chinese or American heritage as a negative is - I collect your f***ing head.
Advertisement
Quote:Original post by anist
couldn't you just use gluLookAt to generate the matrix using the two vectors, then apply that matrix to your object? Best way I can think of.


doesnt gluLookAt just change the camera? This is what i'm pretty much trying to do (use gluLookAt for an object) so how do i get the matrix from it?
That's what I gave in my post. gluLookAt will modify the matrix stack itself. To accomplish what gluLookAt does, use the steps in my post to calculate the matrix.
oh wait.... so what if i use gluLookAt on the object then pop the matrix stack?
meh nevermind i solved it in a mock-up way by calling glLoadIdentity in the shape's code

This topic is closed to new replies.

Advertisement