Original Post
Well, I want to figure out the 3 angles needed(for X,Y and Z)needed to rotate based on a viewvector. This is because i''m using viewvectors for objects in my game, and when the object renderer comes in, it has to rotate the model...
This is what i have to far...not werking too good.
glTranslatef(_vPosition._x,_vPosition._y,_vPosition._z); CVector v = _vView-_vPosition; Normalize(v); glRotatef(v._z,0,0,1); glRotatef(v._y,0,1,0); glRotatef(v._x,1,0,0); /* float RotZ = atan(v._y/v._z); float RotY = atan(v._x/v._z); float RotX = atan(v._z/v._y); glRotatef(RotZ,0,0,1); glRotatef(RotY,0,1,0); glRotatef(RotX,1,0,0); */