---
name: "s3d_angle_to_cam"
section: "3"
platform: "linux"
package: "s3d-doc"
version: "0.2.2.1-7"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/s3d_angle_to_cam"
---

# s3d\_angle\_to\_cam(3)

calculate angle between vector and cam

## NAME

s3d\_angle\_to\_cam - calculate angle between vector and cam

## SYNOPSIS

```
#include <s3d.h>
```

**float s3d\_angle\_to\_cam(const float** *obj\_pos***\[\], const float** *cam\_pos***\[\], float \****angle\_rad***);**

## DESCRIPTION

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)

## AUTHOR

**Simon Wunderlich**

Author of s3d
