home/ atoms/ hydra-webcam-source

Hydra processes a webcam by initialising it into s0 and using it inside src()

Hydra can process external video such as a webcam, not only internally generated sources. The camera is activated into an external-source variable (s0.initCam()), which lights the webcam, but nothing shows until you reference it inside a sketch with src(s0). From there every Hydra transform — geometry, color, blend, modulate — works on the live video exactly as it does on osc() or shape(), so the camera becomes a live source you can warp and composite. Multiple cameras are selected with a number, e.g. s0.initCam(1).

Examples

s0.initCam(); src(s0).out() — raw webcam. src(s0).modulateRotate(osc(5)).out() — webcam warped by an oscillator. src(s0).blend(osc()).out().

Assessment

Write a sketch that takes webcam input and applies two transformations, and explain what src() does differently from osc() when it sits in the source position.

“you can use hydra to process external video sources such as a webcam”
corpus · hydra-getting-started-official-interactive-tutorial · chunk 1