Reputation: 5458
I have this camera setup:
Pos(px,py,pz)
LookAt(lx,ly,lz)
Up(ux,uy,uz)
I need to find the cameras right and up vectors, a way to find them with an explanation would be greatly appreciated. thanks.
Upvotes: 1
Views: 1986
Reputation: 10896
It seems you already have a camera pos (p), target (l) and up (u) vectors. To calculate right, find the cross product of (p - l) and (u - p).
This will give you a vector orthogonal to both, the "right" vector.
Upvotes: 3