kubakub audience viewpoint (old)
Where the audience is standing, as three numbers you only write once
- matrix
- viewer
- preview
- report
This is a plumbing node, and it earns its place by removing a specific kind of tedium. Several nodes in this pack need to know where the audience is: the perspective of rooms behind windows in frame in frame, the camera in kubakub scene relight with camera = audience, the view in kubakub pieces render with view = audience, the spot in kubakub scene preview. Type those numbers into each node and the first time you move the audience half a metre you have four places to edit and one of them will be stale. kubakub audience viewpoint makes it one place.
Its job is a single coordinate: where a person stands in front of the facade, in metres.
Inputs
matrix gives the node the matrix's size - and, in its preview, the picture to draw on. facade_width_m is the real width of the whole matrix on the building; the mapping is one uniform scale, facade_width_m / matrix width, so every other distance the pack computes follows from it. bottom_m is how high the matrix's bottom edge sits above the ground where people stand, which is what stops the perspective from pretending the building starts at pavement level.
Then the viewer: viewer_x_m is the position along the facade measured from its left edge, with -1 meaning "centre" - handy, since centre is the answer nine times out of ten. eye_height_m is eye height above the ground; 1.7 is a standing adult, and it's the number that sets how much of a window's interior you can see from below. distance_m (default 30) is how far out they're standing.
Outputs
viewer is the actual product: a viewpoint object that plugs into viewer on kubakub frame in frame, kubakub scene measure, kubakub scene preview, kubakub scene relight and kubakub pieces render. One wire, consistent geometry everywhere. There's a nice consequence when you connect it to scene measure - the measure node hands a viewer back out built from the real projector frame on the wall, so you can go the other way: place the projector, measure, and let the audience viewpoint be derived from the actual show rather than from numbers you typed.
preview is the matrix with a red dot where the viewer's eye line meets the facade. It's a two-second sanity check and worth doing: the dot being off the edge of the building is a mistake you'd otherwise discover as a strange room perspective three nodes later.
report gives the facade size, the scale in millimetres per pixel, and how big rooms and things sticking out of the facade will appear from there. That mm-per-pixel figure is the one that matters for the frame-in-frame use: it's what tells you whether the room you're painting behind those windows is a plausible size, or whether you're about to put a cathedral behind a ground-floor window.
When you'd reach for it
Any time the answer to "how big does this look from where someone is standing" affects the content. Painting interiors behind windows is the headline case - get the viewpoint wrong and every room is the wrong size and the wrong angle. The atmospheric case is kubakub scene relight in camera = audience mode, where the viewpoint is your hero shot.
If you're using the 3D path, you don't strictly need this node: kubakub scene measure builds a viewer from the projector frame and the real geometry, which is more accurate than anything typed by hand. This one is for the 2D path, where there is no model to measure and the facade width and bottom height only exist in your head and your site notes.
Install
Part of the pack - nothing of its own:
cd ComfyUI/custom_nodes && git clone https://github.com/kubakubkub/ComfyUI_KubaNodes
python -m pip install -r ComfyUI_KubaNodes/requirements.txt
Or search kubakub nodes in ComfyUI Manager, which will also handle updates (git pull by hand does the same).
One caveat on the model it describes: the uniform-scale mapping assumes a matrix mapped onto a flat wall with even pixel size - which is exactly the festival-template case, and exactly wrong for a strongly keystoned or tilted projection. The author says as much in the scene measure notes: the uniform-scale viewer model is exact for a projector aimed square at the facade with lens shift and no tilt. If you're throwing the picture across a wall at an angle, measure the real thing instead.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| matrix | IMAGE | The matrix (size and preview). | |
| facade_width_m | FLOAT | 40.00.1–10000 | Real width of the whole matrix on the building. |
| bottom_m | FLOAT | 0.0-100–1000 | Height of the matrix's bottom edge above the ground where people stand. |
| viewer_x_m | FLOAT | -1.0-10000–10000 | Viewer position along the facade from its left edge; -1 = centre. |
| eye_height_m | FLOAT | 1.700–1000 | Eye height of the viewer above the ground, in metres (1.7 = a standing adult). |
| distance_m | FLOAT | 30.00.5–10000 | Distance of the viewer from the facade. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| viewer | KUBA_VIEWER | The viewpoint, for frame in frame. |
| preview | IMAGE | The matrix with a red dot where the viewer's eye line meets the facade. |
| report | STRING | Facade size, millimetres per pixel and how big rooms and parasites appear. |