Obtaining angle of object in relation to camera direction

Started by
11 comments, last by Hawkblood 7 years, 11 months ago

This may help, if the images load, here

Advertisement

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.

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

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