DOKK / manpages / debian 11 / s3d-doc / s3d_angle_to_cam.3.en
S3D_ANGLE_TO_CAM(3) s3d Manual S3D_ANGLE_TO_CAM(3)

s3d_angle_to_cam - calculate angle between vector and cam

#include <s3d.h>

float s3d_angle_to_cam(const float obj_pos[], const float cam_pos[], float *angle_rad);

Given obj_pos and cam_pos in the format float[3], angle_rad about which angle the object should be rotated around the y-axis so that it faces the camera. This might become handy if you have some text floating in space and want it to face the camera. http://en.wikipedia.org/wiki/Vector_(spatial)

Simon Wunderlich

Author of s3d
s3d