# Quetzalcoatlus lawsoni motion study

The generated source assets, animated GLB and rigging scripts are included. No API key is needed to inspect them. The GLB can be imported into Blender; the scripts recreate the editable Blender project without duplicating its packed source textures in this archive.

## Pipeline

1. ImageGen creates the reconstruction from the exact prompt in `outputs/quetzalcoatlus/prompts.json`.
2. ImageGen edits the same creature into a tracking suit on green, then widens its starting frame for travel.
3. Fal Kling v3 Pro generates the eight-second motion reference. The exact request, prompt, input hash and request ID are in `work/new-creatures/quetzalcoatlus/video-request.json`.
4. Seeded Lucas-Kanade forward/backward optical flow tracks visible surfaces. Quetzalcoatlus near-hand and near-ankle markers also use color reacquisition. Missing observations are omitted from the overlay and CSV; interpolation is used only for fitting. These are 2D tracks of an AI-generated video, not measured 3D motion capture.
5. Fal Hunyuan 3D v3.1 Pro generates the textured 120,000-triangle mesh from the reconstruction. The original GLB and 4096-pixel texture atlas are retained. The triangle illustration is rendered from that mesh.
6. A morphology-specific rig transfers the observed motion, with depth and hidden controls inferred. Two baked clips compare the fitted motion with secondary physics. The browser GLB uses 2048-pixel textures. The optional rendered fallback videos are 576 x 360 at 8 fps; the interactive animation is sampled at 24 fps.

## Interpretation

The long neck and four-limb walk follow an azhdarchid reconstruction. Forelimbs are folded wings, with hand support separated from the long wing finger. Joint centers, hidden contacts, scale, depth and membrane properties are inferred. A support constraint removes shared projected height drift so a hand and hind foot remain planted. The far hind stride is reconstructed from the visible near-side stride.

Physics parameters are animation choices. These examples do not establish a fossil animal's real gait or an energy-minimizing solution. `rig-report.json` records the model and assumptions; `tracking.json` records the visibility of each landmark.

## Rebuild locally

Use Python 3.13 with the packages in `requirements.txt`. Run from the extracted archive root:

```
python work/new-creatures/model_tools.py quetzalcoatlus
python work/new-creatures/track_video.py track quetzalcoatlus
python work/new-creatures/rig_quetzalcoatlus.py
python work/new-creatures/render_motion.py quetzalcoatlus --preview
python work/new-creatures/render_motion.py quetzalcoatlus
```

The scripts use the included source model and video. Generating new Fal media is optional and billable: set your own `FAL_KEY` environment variable and use `generate.py`. The retained request records prevent accidental duplicate submissions. Exact ImageGen prompts are included; image generation itself uses the built-in ImageGen tool.

## Sources

- Quetzalcoatlus functional morphology: https://doi.org/10.1080/02724634.2020.1780247
- Quetzalcoatlus lawsoni skeletal context: https://news.utexas.edu/2021/12/08/worlds-largest-pterosaur-leaped-aloft-to-fly/
- Cameroceras fossils: https://www.ordovicianatlas.org/atlas/mollusca/cephalopoda/endocerida/endoceratidae/cameroceras/
- Orthocone hydrostatic reconstruction: https://www.palaeo-electronica.org/content/2019/2521-cephalopod-hydrostatics
