Maison filaire (lot ④) : le témoin détaillé (maison.js : gouttières, filtre, réseau, eaux grises, poêle, lit de culture, ramasseurs, vélos), le trait fusionné et l'écorché ; les vélos remontés ; cadrage S à 26 m ; plusieurs effets à la fois

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PWGVn3MeAPFsoCSyLs2zZW
This commit is contained in:
Jules Nény
2026-11-06 15:35:12 +01:00
co-authored by Claude Opus 5.5
parent 1b1b9a6fac
commit 846c451549
3 changed files with 338 additions and 42 deletions
+66 -41
View File
@@ -3,11 +3,17 @@
// un cadrage ne bougent pas la caméra (c'est ce qui empêche les fiches de « se balader »).
import * as THREE from 'three';
import { lot, haiesEssences, vergers, arbresPlan, thuyas, plantesEau, potager, NOMS_AQUA, rnd } from './vegetal.js';
import { vieAnimale, velo, veloCargo, attelage, voiture, chien, remorque } from './animaux.js';
import { vieAnimale, velo as veloA, veloCargo, attelage, voiture, chien, remorque } from './animaux.js';
import { gestesDuTour } from './gestes.js';
import { objetsNouveaux } from './objets.js';
import { detaillerTemoin } from './maison.js';
import { PLAFONDS_FOND, prochaineImage, vueScenario, SCENARIO_FOND } from './mode.ts';
// lot ④ (06/11) : la largeur du cadrage `maison` en S (m ; 0 rend l'ancien cadrage), et le témoin détaillé en mode fond
// (faux : le fond reste identique au pixel, docs/EMBED.md).
const LARGEUR_S = 26;
const DETAILS_EN_FOND = false;
const PAL = {
fond: '#efeee2', papier: '#e7e5d3', socle: '#d9d3bc',
mur: '#f4f0e4', toit: '#c9bba8', paille: '#e6cf8a', toitT: '#b9a68e', grandMur: '#f1ebdc', grandToit: '#c99a7f',
@@ -108,7 +114,7 @@ export function creerScene(canvas, { D, ESSENCES, BULLES, IMG, reduit, petit, on
[murs, t, pg].forEach((m) => { m.castShadow = true; m.receiveShadow = true; g.add(m); });
// le trait du dessin : arêtes des volumes, discrètes
const ar = new THREE.LineSegments(new THREE.EdgesGeometry(murs.geometry), matTrait); ar.position.copy(murs.position); g.add(ar);
g.add(new THREE.LineSegments(new THREE.EdgesGeometry(t.geometry, 20), matTrait));
const arT = new THREE.LineSegments(new THREE.EdgesGeometry(t.geometry, 20), matTrait); g.add(arT);
if (transfo) {
const th = g.rotation.y, faces = [[1, 0, Math.cos(th), -Math.sin(th)], [-1, 0, -Math.cos(th), Math.sin(th)], [0, 1, Math.sin(th), Math.cos(th)], [0, -1, -Math.sin(th), -Math.cos(th)]];
const f = faces.reduce((a, b) => (b[3] > a[3] ? b : a));
@@ -131,7 +137,8 @@ export function creerScene(canvas, { D, ESSENCES, BULLES, IMG, reduit, petit, on
const desc = new THREE.Mesh(new THREE.CylinderGeometry(0.08, 0.08, eave - 1.6, 8), mat.zinc); desc.position.set(Math.max(-(Lu + ite) / 2, Math.min((Lu + ite) / 2, xd)), (eave - 1.6) / 2 + 1.4, ze); g.add(desc);
const filtre = new THREE.Mesh(new THREE.BoxGeometry(0.6, 0.9, 0.2), mat.zinc); filtre.position.set(desc.position.x, 1.0, ze + cote * 0.05); g.add(filtre);
const pompe = new THREE.Mesh(new THREE.BoxGeometry(0.55, 0.45, 0.45), mat.pompe); pompe.position.set(cu.position.x + (cu.position.x > 0 ? -1.2 : 1.2), 0.23, cu.position.z); pompe.castShadow = true; g.add(pompe);
Object.assign(info, { gout, desc, filtre, pompe, ze, xd: desc.position.x });
// maison.js (lot ④) reprend ces volumes pour le trait et l'écorché du témoin
Object.assign(info, { gout, desc, filtre, pompe, ze, xd: desc.position.x, murs, toitM: t, pg, serre, aretes: [ar, arT, as] });
}
g.updateMatrixWorld(true);
info.chemW = ch.getWorldPosition(new THREE.Vector3()).add(new THREE.Vector3(0, 1.4, 0));
@@ -369,6 +376,8 @@ export function creerScene(canvas, { D, ESSENCES, BULLES, IMG, reduit, petit, on
const tr = {}; for (const k in D.routes) tr[k] = trajet(D.routes[k]);
const cheminsLongs = D.chemins.map(trajet).filter((t) => t.L > 40).sort((a, b) => b.L - a.L);
const ajoute = (obj, t, vitesse, decal, depart, groupe, role) => { groupe.add(obj); const m = { obj, t, v: vitesse, d: decal, s: depart * t.L, sens: 1, role }; mobiles.push(m); return m; };
// lot ④ : le cycliste assis sur la selle (animaux.js) ; en mode fond, l'ancien vélo (le fond reste identique au pixel)
const velo = (c) => veloA(c, !fond);
ajoute(velo(PAL.gens[0]), tr.principale, 4.2, 2.8, 0.1, G.v2035, 'velo'); ajoute(velo(PAL.gens[3]), tr.principale, 3.8, -2.6, 0.65, G.v2035, 'velo');
ajoute(velo(PAL.gens[1]), tr.verticale, 4.0, 2.2, 0.4, G.v2035, 'velo'); ajoute(velo(PAL.gens[4]), tr.anneau, 3.5, 2.0, 0.2, G.v2035, 'velo');
ajoute(veloCargo(PAL.gens[2]), tr.principale, 3.2, -2.4, 0.3, G.v2035, 'cargo'); ajoute(veloCargo(PAL.gens[5]), tr.verticale, 3.0, -2.0, 0.75, G.v2035, 'cargo');
@@ -416,6 +425,11 @@ export function creerScene(canvas, { D, ESSENCES, BULLES, IMG, reduit, petit, on
lotHaies = lot(itemsHaies.filter((it) => !(it.haie === o.k && it.s > o.s0 && it.s < o.s1)), matsHaie, E.reglages.fruits);
G.v2035.add(lotHaies);
}
// ---------------------------------------------------------------- la maison témoin détaillée (lot ④, maison.js) : après les
// objets nouveaux (l'ordre de construction ne change aucune pose), en démo seulement (M8)
const temoin = !fond || DETAILS_EN_FOND ? detaillerTemoin({ T, D, PAL, mat, matT, geoP, groupe: G.v2035, velo, reduit, P: gestes.P,
evite: [...Object.values(objets.points), ...Object.values(gestes.points)].filter(Boolean) }) : null;
if (temoin) { anim.push(...temoin.anim); cliquables.unshift(...temoin.cliquables); } // avant la maison : ses morceaux ouvrent leur fiche
// ---------------------------------------------------------------- bulles de la planche 2030 (dessins de Jules, p. 15)
const VERT = new Set(['pomme', 'abeille', 'fleur', 'arbre', 'oiseaux']);
@@ -449,7 +463,8 @@ export function creerScene(canvas, { D, ESSENCES, BULLES, IMG, reduit, petit, on
const T_ = (c) => ({ ...c, az: azT });
const CAD = {
quartier: { x: 0, z: 2, w: 250 }, // le socle fait 268,9 m de large : les bords de la forêt et de l'ouest sont à peine rognés
maison: T_(boite(ptsMaisonT, 1.25, 34)),
// lot ④ (M1) : en S, la caméra cadre la maison témoin de plus près (26 m au bureau ; la règle portrait de cadrer() s'applique)
maison: LARGEUR_S ? T_({ x: T.c.x, z: T.c.y, w: LARGEUR_S }) : T_(boite(ptsMaisonT, 1.25, 34)),
jardin: T_(boite([...ptsMaisonT, ...prochesHaie, ...(noueT || [])], 1.15, 46)),
haie: T_(boite(prochesHaie.length ? [...prochesHaie, [T.c.x, T.c.y]] : ptsMaisonT, 1.15, 36)),
noue: T_(boite(noueT && noueT.some((p) => pres2(p) < 22) ? [...noueT.filter((p) => pres2(p) < 22), [T.c.x, T.c.y]] : ptsMaisonT, 1.3, 30)),
@@ -590,9 +605,14 @@ export function creerScene(canvas, { D, ESSENCES, BULLES, IMG, reduit, petit, on
}
// ---------------------------------------------------------------- état : époque, effet
const etat = { epoque: '2035', fx: null, auj: 0, cibleAuj: 0, fond: false };
const etat = { epoque: '2035', fx: null, fxs: new Set(), auj: 0, cibleAuj: 0, fond: false };
function epoque(e) { etat.epoque = e; etat.cibleAuj = e === 'auj' ? 1 : 0; G.v2035.visible = e === '2035'; G.vAuj.visible = e === 'auj'; besoin = true; }
function effet(nom) { etat.fx = nom || null; chantier.visible = nom === 'chantier'; besoin = true; }
// un effet (une fiche), ou plusieurs ensemble (lot ④ : l'allumage sous mouvement réduit allume tout le chapitre)
function effets(noms) {
const L = (noms || []).filter(Boolean); etat.fx = L[0] || null; etat.fxs = new Set(L);
chantier.visible = etat.fxs.has('chantier') || etat.fond; besoin = true;
}
const effet = (nom) => effets([nom]);
function tourner() { vol = { avant: { ...vue }, apres: { ...vue, az: vue.az + Math.PI / 2 }, t0: performance.now(), d: reduit ? 0 : 900 }; cadrageCourant = null; }
// ---------------------------------------------------------------- boucle
@@ -614,58 +634,62 @@ export function creerScene(canvas, { D, ESSENCES, BULLES, IMG, reduit, petit, on
const dt = Math.min(0.05, horloge.getDelta()); t += dt;
if (vol) { const k = Math.min(1, (now - vol.t0) / (vol.d || 1)), e = ease(k); for (const key of ['x', 'z', 'az', 'el', 'w']) vue[key] = vol.avant[key] + (vol.apres[key] - vol.avant[key]) * e; if (k >= 1) vol = null; }
etat.auj += (etat.cibleAuj - etat.auj) * Math.min(1, dt * 4); matAuj.opacity = etat.auj;
const puls = 0.5 + 0.5 * Math.sin(t * 2.6), fx = etat.fx;
// lot ④ : plusieurs effets peuvent être allumés ensemble (sous mouvement réduit, tout le chapitre de la maison) ; `on(k)`
// vaut `fx === k` quand un seul l'est (la démo en M, le mode fond : rien ne change)
const puls = 0.5 + 0.5 * Math.sin(t * 2.6), fxs = etat.fxs, on = (k) => fxs.has(k);
const eauT = (i) => i === D.temoin.noue;
surv.noues.forEach((m) => (m.material.opacity = fx === 'noue-plantes' ? (eauT(m.userData.i) ? 0.3 + 0.3 * puls : 0.12) : fx === 'mare' || fx === 'phyto' ? 0.22 : fx === 'eaux-grises' && eauT(m.userData.i) ? 0.3 : 0));
surv.bassins.forEach((m) => (m.material.opacity = fx === 'mare' || fx === 'phyto' ? 0.3 + 0.3 * puls : 0));
surv.sentiers.forEach((m) => (m.material.opacity = fx === 'sentiers' ? 0.3 + 0.35 * puls : 0));
surv.liaisons.forEach((m) => { m.material.uniforms.uT.value = t; m.material.uniforms.uA.value = fx === 'eaux-grises' ? (m.userData.i === D.temoin.liaison ? 0.95 : 0.12) : fx === 'mare' ? 0.35 : 0; });
surv.chemins.forEach((m) => { m.material.uniforms.uT.value = t; m.material.uniforms.uA.value = fx === 'sentiers' || fx === 'mobilite' ? 0.9 : fx === 'foret' ? 0.5 : 0; });
const vivant = fx === 'haie-essences' || fx === 'strates' || fx === 'nourrir';
surv.noues.forEach((m) => (m.material.opacity = on('noue-plantes') ? (eauT(m.userData.i) ? 0.3 + 0.3 * puls : 0.12) : on('mare') || on('phyto') ? 0.22 : on('eaux-grises') && eauT(m.userData.i) ? 0.3 : 0));
surv.bassins.forEach((m) => (m.material.opacity = on('mare') || on('phyto') ? 0.3 + 0.3 * puls : 0));
surv.sentiers.forEach((m) => (m.material.opacity = on('sentiers') ? 0.3 + 0.35 * puls : 0));
surv.liaisons.forEach((m) => { m.material.uniforms.uT.value = t; m.material.uniforms.uA.value = on('eaux-grises') ? (m.userData.i === D.temoin.liaison ? 0.95 : 0.12) : on('mare') ? 0.35 : 0; });
surv.chemins.forEach((m) => { m.material.uniforms.uT.value = t; m.material.uniforms.uA.value = on('sentiers') || on('mobilite') ? 0.9 : on('foret') ? 0.5 : 0; });
const vivant = on('haie-essences') || on('strates') || on('nourrir');
pulseEm(matsHaie.couronne, vivant, 0.1, 0.2, 0.02, puls);
pulseEm(matsForet.couronne, fx === 'foret', 0.08, 0.18, 0.04, puls);
pulseEm(mat.paille, fx === 'transformees', 0.26, 0.16, 0, puls);
pulseEm(matT.paille, fx === 'paille' || fx === 'chantier' || fx === 'transformees', 0.26, 0.16, 0, puls);
pulseEm(matT.verre, fx === 'serre', 0.3, 0.25, 0.05, puls);
pulseEm(matT.cuve, fx === 'cuve' || fx === 'pompe', 0.05, 0.22, 0.4, puls);
pulseEm(matT.chem, fx === 'poele', 0.35, 0.12, 0, puls);
pulseEm(mat.pompe, fx === 'pompe', 0.05, 0.25, 0.45, puls);
pulseEm(mat.grandToit, fx === 'communs', 0.35, 0.12, 0, puls);
matEtal.forEach((m) => pulseEm(m, fx === 'marche', 0.25, 0.14, 0, puls));
// les objets (objets.js) : un émissif léger par-dessus leur émissif propre (le verre du tube en a un)
for (const [nom, L] of Object.entries(objets.lumieres)) {
const on = fx === nom ? puls : 0;
for (const m of L) { const b = (m.userData.base ??= m.emissive.clone()); m.emissive.setRGB(b.r + 0.26 * on, b.g + 0.17 * on, b.b + 0.05 * on); }
pulseEm(matsForet.couronne, on('foret'), 0.08, 0.18, 0.04, puls);
pulseEm(mat.paille, on('transformees'), 0.26, 0.16, 0, puls);
pulseEm(matT.paille, on('paille') || on('chantier') || on('transformees'), 0.26, 0.16, 0, puls);
pulseEm(matT.verre, on('serre'), 0.3, 0.25, 0.05, puls);
pulseEm(matT.cuve, on('cuve') || on('pompe'), 0.05, 0.22, 0.4, puls);
pulseEm(matT.chem, on('poele'), 0.35, 0.12, 0, puls);
pulseEm(mat.pompe, on('pompe'), 0.05, 0.25, 0.45, puls);
pulseEm(mat.grandToit, on('communs'), 0.35, 0.12, 0, puls);
matEtal.forEach((m) => pulseEm(m, on('marche'), 0.25, 0.14, 0, puls));
// les objets (objets.js) et les morceaux du témoin (maison.js) : un émissif léger par-dessus leur émissif propre
for (const lum of temoin ? [objets.lumieres, temoin.lumieres] : [objets.lumieres]) for (const [nom, L] of Object.entries(lum)) {
const k = on(nom) ? puls : 0;
for (const m of L) { const b = (m.userData.base ??= m.emissive.clone()); m.emissive.setRGB(b.r + 0.26 * k, b.g + 0.17 * k, b.b + 0.05 * k); }
}
if (imPotager) pulseEm(imPotager.material, fx === 'strates' || fx === 'nourrir', 0.15, 0.12, 0, puls);
eauV.meshes.forEach((m) => pulseEm(m.material, fx === 'noue-plantes' || fx === 'phyto', 0.06, 0.12, 0.08, puls));
if (imPotager) pulseEm(imPotager.material, on('strates') || on('nourrir'), 0.15, 0.12, 0, puls);
eauV.meshes.forEach((m) => pulseEm(m.material, on('noue-plantes') || on('phyto'), 0.06, 0.12, 0.08, puls));
const zoom = Math.max(0.55, Math.min(1.6, vue.w / 60));
for (const [k, L] of Object.entries(etiquettes)) L.forEach((s) => { s.material.opacity += ((fx === k ? 1 : 0) - s.material.opacity) * Math.min(1, dt * 5); s.visible = s.material.opacity > 0.02; s.scale.set(5.6 * zoom * (k === 'noue-plantes' ? 0.8 : 1), 1.23 * zoom * (k === 'noue-plantes' ? 0.8 : 1), 1); });
for (const [k, L] of Object.entries(etiquettes)) L.forEach((s) => { s.material.opacity += ((on(k) ? 1 : 0) - s.material.opacity) * Math.min(1, dt * 5); s.visible = s.material.opacity > 0.02; s.scale.set(5.6 * zoom * (k === 'noue-plantes' ? 0.8 : 1), 1.23 * zoom * (k === 'noue-plantes' ? 0.8 : 1), 1); });
pluie.forEach((p) => {
const on = fx === 'pluie-toit'; p.s.material.opacity = on ? 0.75 : 0; if (!on) return;
const o = on('pluie-toit'); p.s.material.opacity = o ? 0.75 : 0; if (!o) return;
const k = (t * 0.7 + p.ph) % 1; p.s.position.copy(T.g.localToWorld(new THREE.Vector3(p.x, T.eave + T.rh + 0.4 + (1 - k) * 12, p.z)));
});
if (filets.gouttiere) { filets.gouttiere.on = fx === 'gouttiere'; filets.gouttiere.maj(t); }
if (filets.pompe) { filets.pompe.on = fx === 'pompe'; filets.pompe.maj(t); }
if (filets['eaux-grises']) { filets['eaux-grises'].on = fx === 'eaux-grises'; filets['eaux-grises'].maj(t); }
if (filets.gouttiere) { filets.gouttiere.on = on('gouttiere') || on('filtre'); filets.gouttiere.maj(t); }
if (filets.pompe) { filets.pompe.on = on('pompe'); filets.pompe.maj(t); }
if (filets['eaux-grises']) { filets['eaux-grises'].on = on('eaux-grises'); filets['eaux-grises'].maj(t); }
fumee.forEach((s) => {
const k = (t * 0.12 + s.userData.ph) % 1, m = s.userData.m; s.position.set(m.chemW.x - k * 5, m.chemW.y + k * 9, m.chemW.z - k * 2.5);
const fort = fx === 'poele' && m.temoin, sc = (fort ? 1.6 : 1.2) + k * 4.5; s.scale.set(sc, sc, 1); s.material.opacity = (fort ? 0.8 : 0.45) * (1 - k) * Math.min(1, k * 6);
const fort = on('poele') && m.temoin, sc = (fort ? 1.6 : 1.2) + k * 4.5; s.scale.set(sc, sc, 1); s.material.opacity = (fort ? 0.8 : 0.45) * (1 - k) * Math.min(1, k * 6);
});
surv.ondes.forEach((o) => { const k = (t * 0.35 + o.userData.ph) % 1, on = fx === 'mare' || fx === 'phyto'; o.scale.setScalar(1 + k * 11); o.material.opacity = on ? 0.6 * (1 - k) : 0; });
const lieesA = { marche: ['marche', 'musique'], 'haie-essences': ['pomme'], nourrir: ['pomme', 'confiture', 'bouteille', 'marche'], foret: ['abeille', 'miel', 'fleur', 'arbre'], communs: ['biere', 'couverts', 'outils'], mare: ['oiseaux', 'musique'], sentiers: ['promeneurs'], mobilite: ['enfant', 'promeneurs', 'apaise1', 'apaise2', 'ballons'], chantier: ['outils'] }[fx] || [];
surv.ondes.forEach((o) => { const k = (t * 0.35 + o.userData.ph) % 1, a = on('mare') || on('phyto'); o.scale.setScalar(1 + k * 11); o.material.opacity = a ? 0.6 * (1 - k) : 0; });
const LIEES = { marche: ['marche', 'musique'], 'haie-essences': ['pomme'], nourrir: ['pomme', 'confiture', 'bouteille', 'marche'], foret: ['abeille', 'miel', 'fleur', 'arbre'], communs: ['biere', 'couverts', 'outils'], mare: ['oiseaux', 'musique'], sentiers: ['promeneurs'], mobilite: ['enfant', 'promeneurs', 'apaise1', 'apaise2', 'ballons'], chantier: ['outils'] };
const lieesA = [...fxs].flatMap((k) => LIEES[k] || []);
const zb = Math.max(0.32, Math.min(1, vue.w / 150)); // en gros plan, les bulles se font petites : elles ne masquent plus la maison
surv.bulles.forEach((s) => { const u = s.userData, on = lieesA.includes(u.id), k = (on ? 1.35 : 1) * zb; s.position.y = u.base + Math.sin(t * 1.4 + u.ph) * 0.35; s.scale.set(u.taille * k, u.taille * k, 1); s.material.opacity = (fx === 'haie-essences' || fx === 'noue-plantes' || fx === 'strates') && !on ? 0.25 : lieesA.length && !on ? 0.55 : 1; });
surv.bulles.forEach((s) => { const u = s.userData, o = lieesA.includes(u.id), k = (o ? 1.35 : 1) * zb; s.position.y = u.base + Math.sin(t * 1.4 + u.ph) * 0.35; s.scale.set(u.taille * k, u.taille * k, 1); s.material.opacity = (on('haie-essences') || on('noue-plantes') || on('strates')) && !o ? 0.25 : lieesA.length && !o ? 0.55 : 1; });
anim.forEach((f) => f(t));
vie.troupeau.children.forEach((o, i) => { o.position.y = fx === 'paturage' ? Math.abs(Math.sin(t * 3 + i)) * 0.25 : 0; });
if (temoin) temoin.maj(dt, { on, fxs, cam, reduit, paille: matT.paille });
vie.troupeau.children.forEach((o, i) => { o.position.y = on('paturage') ? Math.abs(Math.sin(t * 3 + i)) * 0.25 : 0; });
mobiles.forEach((m) => {
if (m.suit) { const s = m.suit; m.obj.visible = s.obj.parent.visible; const p = surTrajet(s.t, s.s - s.sens * m.d); m.obj.position.set(p.x + 0.5, 0, p.z + 0.4); m.obj.rotation.y = s.obj.rotation.y; return; }
if (!m.obj.parent.visible) return; m.s += m.v * dt * m.sens; if (m.s > m.t.L) { m.s = m.t.L; m.sens = -1; } if (m.s < 0) { m.s = 0; m.sens = 1; }
const p = surTrajet(m.t, m.s); let dx = p.dx * m.sens, dz = p.dz * m.sens; const n = Math.hypot(dx, dz) || 1; dx /= n; dz /= n;
m.obj.position.set(p.x - dz * m.d, 0, p.z + dx * m.d); m.obj.rotation.y = Math.atan2(-dz, dx);
});
const vMob = fx === 'mobilite' || fx === 'travail';
mobiles.forEach((m) => { if (m.role && m.obj.children) { const k = vMob && (m.role === 'cargo' || m.role === 'attelage' || (fx === 'travail' && m.role === 'partagee')) ? 1.25 : 1; m.obj.scale.setScalar(k); } });
const vMob = on('mobilite') || on('travail');
mobiles.forEach((m) => { if (m.role && m.obj.children) { const k = vMob && (m.role === 'cargo' || m.role === 'attelage' || (on('travail') && m.role === 'partagee')) ? 1.25 : 1; m.obj.scale.setScalar(k); } });
if (G.v2035.visible) { convoi.maj(dt); objets.maj.forEach((f) => f(dt)); }
// la caméra suit le véhicule de la fiche, en douceur, tant que personne ne la reprend
if (suivi && suivi.nom === cadrageCourant && !vol && !scenario) { const c = CAD[suivi.nom], k = Math.min(1, dt * 2.5); vue.x += (c.x + suivi.ox - vue.x) * k; vue.z += (c.z + suivi.oz - vue.z) * k; }
@@ -697,10 +721,11 @@ export function creerScene(canvas, { D, ESSENCES, BULLES, IMG, reduit, petit, on
if (/[?&]mesure\b/.test(location.search)) {
const v = new THREE.Vector3();
window.__quartier = { renderer, construction: performance.now() - t0, laisses: objets.laisses, points: objets.points, cadrage: () => cadrageCourant,
temoin: temoin ? temoin.mesure : null, effets: () => [...etat.fxs],
ecran(x, y, z) { v.set(x, y, z).project(cam); const { W, H } = taille(); return { x: (v.x + 1) / 2 * W, y: (1 - v.y) / 2 * H }; } };
}
return {
cadrer, effet, epoque, tourner,
cadrer, effet, effets, epoque, tourner,
poserPanneau(f) { panneau_ = f; },
/** Mode fond : le scénario de caméra part de la vue courante (la vue d'ensemble) ; le chantier chez le voisin reste montré. */
fond(on) { etat.fond = on; scenario = on ? { ensemble: { x: vue.x, z: vue.z, w: vue.w }, t: 0 } : null; chantier.visible = on || etat.fx === 'chantier'; besoin = true; },