# How to Configure Follow and Bird-Eye Camera Modes in a YAML Preset for Cinematic Flythroughs

> Learn to configure follow and birdeye camera modes in YAML presets for cinematic flythroughs in Ling-Bot Map. Master chase and aerial shots with easy parameter tuning.

- Repository: [Robbyant/lingbot-map](https://github.com/Robbyant/lingbot-map)
- Tags: how-to-guide
- Published: 2026-07-31

---

**Configure cinematic camera trajectories in Ling-Bot Map by defining `camera.segments` in your YAML preset, using `mode: follow` for chase-camera shots and `mode: birdeye` for aerial reveal shots with tunable parameters like `back_offset` and `reveal_height_mult`.**

The Ling-Bot Map rendering pipeline constructs camera trajectories from a structured `camera.segments` list defined in YAML preset files. By editing these segments, you can orchestrate sophisticated cinematic flythroughs that transition smoothly between chase cameras and aerial views without modifying any Python source code.

## Understanding Camera Segments in YAML Presets

The camera system reads trajectory instructions from the `camera` block in your YAML configuration. Each entry in the `segments` array specifies a **mode** (`follow` or `birdeye`), a frame range, and mode-specific parameters that control positioning and timing. According to the Ling-Bot Map source code in [[`demo_render/rgbd_render/config.py`](https://github.com/Robbyant/lingbot-map/blob/main/demo_render/rgbd_render/config.py)](https://github.com/Robbyant/lingbot-map/blob/main/demo_render/rgbd_render/config.py#L59-L84), these values are parsed and passed to the respective path-building functions at runtime.

## Follow Mode Configuration

**Follow mode** creates a chase-camera that smoothly tracks the scanning trajectory from a dynamic rear offset. This mode is implemented by `make_follow_path` in [[`demo_render/rgbd_render/camera.py`](https://github.com/Robbyant/lingbot-map/blob/main/demo_render/rgbd_render/camera.py)](https://github.com/Robbyant/lingbot-map/blob/main/demo_render/rgbd_render/camera.py#L64-L78), which computes per-frame eye, center, and up vectors using a temporal sliding window.

### Key Follow Parameters

Adjust these values in your YAML segment to control the cinematic feel:

- **`back_offset`** — Distance behind the scanner (scene-scale multiplier). Default: `0.2`
- **`up_offset`** — Vertical lift above the trajectory plane. Default: `0.05`
- **`look_offset`** — Forward distance the camera looks ahead. Default: `0.5`
- **`smooth_window`** — Number of frames used for temporal smoothing. Default: `60`
- **`scale_frames`** — Initial frames used to estimate local scene scale (`0` = entire scene). Default: `100`

### Example Follow Segment

```yaml
camera:
  segments:
    - mode: follow
      frames: [0, 3000]
      back_offset: 0.25
      up_offset: 0.07
      look_offset: 0.6
      smooth_window: 80
      scale_frames: 150

```

## Bird-Eye Mode Configuration

**Bird-eye mode** switches to a static top-down "reveal" shot that hovers above the scene. The implementation in [[`demo_render/rgbd_render/camera.py`](https://github.com/Robbyant/lingbot-map/blob/main/demo_render/rgbd_render/camera.py)](https://github.com/Robbyant/lingbot-map/blob/main/demo_render/rgbd_render/camera.py#L60-L74) uses `_compute_birdeye_camera` to generate a single static keyframe based on scene scale.

### Key Bird-Eye Parameters

- **`reveal_height_mult`** — Multiplier of the scene's scale that determines camera height. Default: `2.5`

### Example Bird-Eye Segment

```yaml
camera:
  segments:
    - mode: birdeye
      frames: [3000, -1]
      reveal_height_mult: 3.0

```

## Building a Complete YAML Preset

Combine multiple segments to create complex cinematic sequences. The `transition` field defines the frame count for linear cross-fading between modes, ensuring seamless cuts. Frame ranges use `-1` to indicate the final frame of the sequence.

See the reference implementation in [[`demo_render/config/outdoor_drive.yaml`](https://github.com/Robbyant/lingbot-map/blob/main/demo_render/config/outdoor_drive.yaml)](https://github.com/Robbyant/lingbot-map/blob/main/demo_render/config/outdoor_drive.yaml):

```yaml
camera:
  fov: 60.0
  transition: 40
  segments:
    - mode: follow
      frames: [0, 3000]
      back_offset: 0.2
      up_offset: 0.05
      look_offset: 0.5
      smooth_window: 60
      scale_frames: 100
    - mode: birdeye
      frames: [3000, -1]
      reveal_height_mult: 2.5

```

## Verifying Your Configuration

Load and inspect the generated camera path programmatically to validate your YAML syntax before rendering:

```python
from demo_render.rgbd_render.config import load_yaml

cfg = load_yaml('demo_render/config/custom_flythrough.yaml')
cam_path = cfg.camera_path

print(f"Total segments: {len(cam_path.segments)}")
for seg in cam_path.segments:
    print(f"Mode: {seg.mode}, Frames: {seg.frames}")

```

## Tips for Smooth Transitions

- **Frame indexing**: Use `-1` in the end position to automatically capture the remaining frames in the sequence.
- **CLI overrides**: When `camera.segments` is present in the YAML, all `--back_offset`, `--up_offset`, and related CLI flags are ignored to ensure reproducible, file-driven configuration.
- **Scene scale**: The `scale_frames` parameter helps `make_follow_path` estimate appropriate distances for tight versus wide shots.

## Summary

- Define camera behavior in **`camera.segments`** within your YAML preset.
- Use **`mode: follow`** with `back_offset`, `up_offset`, and `smooth_window` for chase-camera dynamics.
- Use **`mode: birdeye`** with `reveal_height_mult` for static aerial reveals.
- Set **`transition`** to control cross-fade duration between segments.
- Reference the example preset at [`demo_render/config/outdoor_drive.yaml`](https://github.com/Robbyant/lingbot-map/blob/main/demo_render/config/outdoor_drive.yaml) for production-ready templates.

## Frequently Asked Questions

### How do I smooth camera movement in follow mode?

Increase the **`smooth_window`** value in your follow segment. This parameter, passed to `make_follow_path` in [`camera.py`](https://github.com/Robbyant/lingbot-map/blob/main/camera.py), defines how many neighboring frames are averaged to compute the camera's eye position, reducing jitter in tight turns.

### Can I combine multiple follow and birdeye segments in one preset?

Yes. The `camera.segments` array supports any number of alternating modes. Each segment renders sequentially, with the `transition` field controlling the linear blend duration when switching between chase-cam and aerial views.

### What does the `-1` value mean in frame ranges?

The value `-1` resolves to the last frame of the input sequence. Use it as the end frame (e.g., `frames: [3000, -1]`) to ensure the segment continues to the end without manually counting total frames.

### Why are my CLI camera arguments being ignored?

When a YAML preset contains a `camera.segments` block, the system prioritizes file-based configuration over CLI flags. Remove the segments block or delete the YAML entirely to restore command-line control over `back_offset` and related parameters.