URL: https://graphicscomputing.fr/cgp/reference/frame/
Description: Local coordinate frame.

# frame

Local coordinate frame.

Fields:

- `rotation_transform orientation` - Rotation giving the axes of the frame, the columns of its matrix being ux, uy and uz.
- `vec3 position` - Position of the origin of the frame.

Functions taking it:

- `frame inverse(frame const& f)` - Frame of the inverse rigid transform (inverse orientation, position -R^-1 * position).
- `mesh mesh_primitive_frame(frame const& f = frame(), float scale = 1.0f, vec3 const& color_ux = {1,0,0}, vec3 const& color_uy = {0,1,0}, vec3 const& color_uz = {0,0,1}, vec3 const& color_sphere = {1,1,1}, float frame_thickness = 0.025f)` - Mesh of the frame f: three arrows of length scale along ux, uy and uz (red, green and blue by default) and a sphere at its origin, the arrow radius being frame_thickness*scale.

Functions returning it:

- `frame camera_frame_look_at(vec3 const& eye, vec3 const& center, vec3 const& up)` - Camera frame placed at eye and looking toward center (local -z axis), with its y axis aligned as much as possible with up.

Operators:

- `frame operator*(affine_rt const& T, frame const& f)` - Frame transformed by the rigid transform: orientation and position are rotated, then the position is translated.
- `frame operator*(rotation_transform const& R, frame const& f)` - Frame rotated around the origin: both its orientation and its position are rotated.
- `frame operator+(frame const& f, vec3 const& tr)` - Copy of the frame with its position translated by tr.
- `frame operator+(vec3 const& tr, frame const& f)` - Copy of the frame with its position translated by tr.
- `frame operator-(frame const& f, vec3 const& tr)` - Copy of the frame with its position translated by -tr.
