This may help, if the images load, here
Obtaining angle of object in relation to camera direction
rel heading = atan(dx/dz)-yr, whats the big deal? get your signs straight and trap out divide by zero, that's about it. and that's all in world coordinates, BTW.
trig is the the math discipline behind that. if you want to program games, learn trig - then learn linear.
atan2(x,y) and its variants use the sign of x and y to determine the quadrant and gives -pi to +pi as a result.
Is this 2D or 3D?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement