{"id":1255,"date":"2026-11-17T18:52:19","date_gmt":"2026-11-17T18:52:19","guid":{"rendered":"https:\/\/boogie-hebel.eu\/?page_id=1255"},"modified":"2026-11-17T19:43:13","modified_gmt":"2026-11-17T19:43:13","slug":"virtuelle-ausstellung","status":"publish","type":"page","link":"https:\/\/boogie-hebel.eu\/?page_id=1255","title":{"rendered":"Virtuelle Ausstellung"},"content":{"rendered":"\n<style>  html,body{overflow-x:clip}\n  #bh3d{position:relative;width:100vw;max-width:100vw;margin:0 0 0 calc(50% - 50vw);height:min(86vh,920px);min-height:460px;\n    overflow:hidden;background:#1a1613;color:#111;font-family:\"Helvetica Neue\",Helvetica,Arial,system-ui,sans-serif;\n    -webkit-font-smoothing:antialiased;line-height:1.4;font-size:14px;text-align:left}\n  #bh3d:fullscreen{width:100vw;height:100vh;margin:0}\n  #bh3d:-webkit-full-screen{width:100vw;height:100vh;margin:0}\n  #bh-intro h1{color:#111;font-weight:400;line-height:1.2;padding:0}\n  #bh-intro p{color:#333}\n  #bh3d img{max-width:100%}\n  @media (max-width:640px){#bh3d{height:78vh}}\n\n  #bh3d,#bh-lb,#bh-tip{\n    --ink:#111; --paper:#f6f3ee; --muted:#6d6a66; --line:rgba(17,17,17,.14);\n    --glass:rgba(250,248,244,.86);\n  }\n    #bh-stage{position:absolute;inset:0;touch-action:none;cursor:grab}\n  #bh-stage.drag{cursor:grabbing}\n  #bh-stage.hand{cursor:pointer}\n  #bh3d canvas{display:block;max-width:none}\n  #bh3d *{box-sizing:border-box}\n  #bh3d .spaced{letter-spacing:.32em;text-transform:uppercase}\n  #bh3d button,#bh3d a{all:unset;box-sizing:border-box;cursor:pointer;font-family:inherit}\n  #bh3d button:focus-visible,#bh3d a:focus-visible{outline:2px solid #111;outline-offset:2px}\n\n  \/* top bar *\/\n  #bh-bar{position:absolute;left:12px;right:12px;top:12px;display:flex;align-items:center;gap:10px;\n    pointer-events:none;z-index:5}\n  #bh-brand{pointer-events:auto;background:var(--glass);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);\n    padding:10px 14px;border-radius:2px;font-size:11px;line-height:1.35;white-space:nowrap}\n  #bh-brand b{display:block;font-weight:600;font-size:12px}\n  #bh-brand span{color:var(--muted)}\n  #bh-nav{margin-left:auto;display:flex;gap:4px;pointer-events:auto;background:var(--glass);\n    backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);padding:4px;border-radius:2px;flex-wrap:wrap;justify-content:flex-end}\n  #bh-nav button{font-size:10.5px;padding:8px 10px;border-radius:2px;letter-spacing:.2em;text-transform:uppercase;white-space:nowrap}\n  #bh-nav button:hover{background:rgba(0,0,0,.07)}\n  #bh-nav button.on{background:#111;color:#fff}\n\n  \/* tour + info *\/\n  #bh-dock{position:absolute;left:50%;bottom:14px;transform:translateX(-50%);z-index:5;\n    display:flex;flex-direction:column;align-items:center;gap:8px;width:min(560px,calc(100vw - 24px))}\n  #bh-info{width:100%;background:var(--glass);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);\n    padding:14px 16px;border-radius:2px;display:none;gap:14px;align-items:center}\n  #bh-info.show{display:flex}\n  #bh-info .thumb{width:54px;height:54px;object-fit:cover;background:#ddd;flex:none}\n  #bh-info .t{flex:1;min-width:0}\n  #bh-info .cat{font-size:10px;color:var(--muted)}\n  #bh-info .name{font-size:15px;margin-top:3px;font-weight:500}\n  #bh-info .acts{display:flex;gap:6px;flex:none}\n  #bh3d .btn{font-size:10.5px;letter-spacing:.2em;text-transform:uppercase;padding:9px 12px;border:1px solid #111;border-radius:2px;\n    text-decoration:none;color:#111;white-space:nowrap;display:inline-block}\n  #bh3d .btn.dark{background:#111;color:#fff}\n  #bh3d .btn:hover{opacity:.8}\n  #bh-tour{display:flex;align-items:center;gap:2px;background:var(--glass);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);\n    border-radius:2px;padding:4px}\n  #bh-tour button{width:40px;height:36px;font-size:16px;border-radius:2px}\n  #bh-tour button:hover{background:rgba(0,0,0,.07)}\n  #bh-tour .lbl{font-size:10.5px;padding:0 10px;min-width:150px;text-align:center}\n\n  #bh-hint{position:absolute;left:12px;bottom:14px;z-index:4;font-size:10.5px;color:#fff;opacity:.85;\n    text-shadow:0 1px 3px rgba(0,0,0,.6);line-height:1.6;max-width:260px;pointer-events:none}\n  #bh-tip{position:fixed;z-index:100001;pointer-events:none;background:#111;color:#fff;font-size:10.5px;padding:5px 8px;\n    border-radius:2px;transform:translate(14px,14px);display:none;white-space:nowrap}\n\n  \/* intro *\/\n  #bh-intro{position:absolute;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;\n    background:rgba(246,243,238,.94);transition:opacity .6s}\n  #bh-intro.gone{opacity:0;pointer-events:none}\n  #bh-intro .box{text-align:center;padding:30px;max-width:520px}\n  #bh-intro h1{font-weight:400;font-size:clamp(20px,4vw,30px);margin:0 0 6px;letter-spacing:.42em;text-transform:uppercase}\n  #bh-intro .sub{font-size:11px;color:var(--muted);margin-bottom:26px}\n  #bh-intro p{font-size:14px;line-height:1.6;margin:0 0 26px;color:#333}\n  #bh-intro .keys{font-size:11.5px;color:var(--muted);line-height:1.9;margin-top:22px}\n  #bh-prog{width:200px;height:2px;background:var(--line);margin:0 auto 22px;position:relative;overflow:hidden}\n  #bh-prog i{position:absolute;left:0;top:0;bottom:0;width:0;background:#111;transition:width .3s}\n  #bh-enter{padding:13px 26px}\n\n  \/* lightbox *\/\n  #bh-lb{position:fixed;inset:0;z-index:100000;background:rgba(14,12,11,.96);display:none;flex-direction:column;color:#fff}\n  #bh-lb.show{display:flex}\n  #bh-lb .top{display:flex;align-items:center;padding:14px 16px;gap:12px;font-size:11px}\n  #bh-lb .top .t{flex:1}\n  #bh-lb .top .t small{display:block;color:#aaa;margin-bottom:3px;font-size:10px}\n  #bh-lb .wrap{flex:1;display:flex;align-items:center;justify-content:center;min-height:0;padding:0 56px 18px;position:relative}\n  #bh-lb img{max-width:100%;max-height:100%;object-fit:contain;box-shadow:0 10px 40px rgba(0,0,0,.5);background:#fff}\n  #bh-lb .nv{position:absolute;top:50%;transform:translateY(-50%);width:44px;height:64px;font-size:24px;color:#fff;opacity:.75}\n  #bh-lb .nv:hover{opacity:1}\n  #bh-lb .prev{left:6px} #bh-lb .next{right:6px}\n  #bh-lb .x{font-size:22px;width:40px;height:40px;color:#fff}\n  #bh-lb .btn{border-color:#fff;color:#fff}\n\n  @media (max-width:640px){\n    #bh-bar{flex-direction:column;align-items:stretch;gap:6px;left:8px;right:8px;top:8px}\n    #bh-brand{font-size:9.5px;padding:8px 10px;align-self:flex-start}\n    #bh-nav{margin-left:0;flex-wrap:nowrap;justify-content:space-between}\n    #bh-brand span{display:none}\n    #bh-nav button{padding:8px 5px;font-size:9px;letter-spacing:.08em}\n    #bh-hint{display:none}\n    #bh-info .thumb{display:none}\n    #bh-info{flex-wrap:wrap}\n    #bh-info .acts{width:100%}\n    #bh-info .acts .btn{flex:1;text-align:center}\n    #bh-tour .lbl{min-width:110px}\n    #bh-lb .wrap{padding:0 8px 12px}\n    #bh-lb .nv{background:rgba(0,0,0,.35)}\n  }\n<\/style>\n<div id=\"bh3d\">\n<div id=\"bh-stage\" aria-label=\"3D-Ausstellungsraum\"><\/div>\n\n<div id=\"bh-bar\">\n  <div id=\"bh-brand\"><b class=\"spaced\">Virtuelle Ausstellung<\/b><\/div>\n  <div id=\"bh-nav\" role=\"toolbar\" aria-label=\"R\u00e4ume\">\n    <button data-go=\"fig\">Salon<\/button>\n    <button data-go=\"abs\">Abstrakt<\/button>\n    <button data-go=\"geo\">Geometrisch<\/button>\n    <button data-go=\"overview\" id=\"bh-ovBtn\">\u00dcbersicht<\/button>\n    <button id=\"bh-fsBtn\" title=\"Vollbild\" aria-label=\"Vollbild\">\u2922<\/button>\n  <\/div>\n<\/div>\n\n<div id=\"bh-hint\">Ziehen&nbsp;= umsehen \u00b7 Klick auf den Boden&nbsp;= hingehen<br>Klick auf ein Bild&nbsp;= ansehen \u00b7 W A S D \/ Pfeiltasten<\/div>\n<div id=\"bh-tip\"><\/div>\n\n<div id=\"bh-dock\">\n  <div id=\"bh-info\" aria-live=\"polite\">\n    <img class=\"thumb\" alt=\"\">\n    <div class=\"t\"><div class=\"cat spaced\"><\/div><div class=\"name\"><\/div><\/div>\n    <div class=\"acts\">\n      <button class=\"btn dark\" id=\"bh-openLb\">Ansehen<\/button>\n      <a class=\"btn\" id=\"bh-ask\" target=\"_top\" href=\"#\">Anfrage<\/a>\n    <\/div>\n  <\/div>\n  <div id=\"bh-tour\" role=\"group\" aria-label=\"Rundgang\">\n    <button id=\"bh-prev\" aria-label=\"Vorheriges Werk\">\u2039<\/button>\n    <div class=\"lbl spaced\" id=\"bh-tourLbl\">Rundgang<\/div>\n    <button id=\"bh-next\" aria-label=\"N\u00e4chstes Werk\">\u203a<\/button>\n  <\/div>\n<\/div>\n\n<div id=\"bh-intro\">\n  <div class=\"box\">\n    <h1>Boogie \u2014 Hebel<\/h1>\n    <div class=\"sub spaced\">Contemporary Art \u00b7 Black and White<\/div>\n    <p>Willkommen in der virtuellen Ausstellung. Gehen Sie frei durch die R\u00e4ume oder folgen Sie dem Rundgang von Werk zu Werk.<\/p>\n    <div id=\"bh-prog\"><i><\/i><\/div>\n    <button class=\"btn dark\" id=\"bh-enter\">Ausstellung betreten<\/button>\n    <div class=\"keys\">Ziehen zum Umsehen \u00b7 Tippen\/Klicken auf den Boden zum Gehen<br>Bild antippen zum Ansehen \u00b7 Pfeile \u2039 \u203a f\u00fcr den Rundgang<\/div>\n  <\/div>\n<\/div>\n\n<div id=\"bh-lb\" role=\"dialog\" aria-modal=\"true\" aria-label=\"Werkansicht\">\n  <div class=\"top\">\n    <div class=\"t\"><small class=\"spaced\" id=\"bh-lbCat\"><\/small><span id=\"bh-lbName\"><\/span><\/div>\n    <a class=\"btn\" id=\"bh-lbAsk\" target=\"_top\" href=\"#\">Anfrage<\/a>\n    <button class=\"x\" id=\"bh-lbClose\" aria-label=\"Schlie\u00dfen\">\u00d7<\/button>\n  <\/div>\n  <div class=\"wrap\">\n    <button class=\"nv prev\" id=\"bh-lbPrev\" aria-label=\"Vorheriges\">\u2039<\/button>\n    <img id=\"bh-lbImg\" alt=\"\">\n    <button class=\"nv next\" id=\"bh-lbNext\" aria-label=\"N\u00e4chstes\">\u203a<\/button>\n  <\/div>\n<\/div>\n\n<\/div>\n<script src=\"\/wp-content\/uploads\/bh3d\/three.min.js\"><\/script>\n<script><!--\n(function(){'use strict';const SITE='https:\/\/boogie-hebel.eu';const ON_SITE=\/(^|[.])boogie-hebel[.]eu$\/.test(location.hostname);const BASE=ON_SITE?location.origin:SITE;const UP=p=>BASE+'\/wp-content\/uploads\/'+p;const CONTACT=SITE+'\/?page_id=1179';const DEMO=new URLSearchParams(location.search).has('demo');const CATS={fig:{name:'Figurative Darstellungen',single:'Figurative Darstellung',page:SITE+'\/?page_id=158',room:'Salon'},abs:{name:'Abstrakte Kompositionen',single:'Abstrakte Komposition',page:SITE+'\/?page_id=151',room:'Loft'},geo:{name:'Geometrische Strukturen',single:'Geometrische Struktur',page:SITE+'\/?page_id=155',room:'Loft'}};const WORKS={fig:[['2025\/05\/1-13.jpg',453,640],['2025\/05\/3-5.jpg',497,640],['2025\/05\/fcfae962-4a63-4fe4-8136-f93bb57329ce.jpg',739,1600],['2025\/05\/5-5.jpg',505,640],['2025\/05\/7-5.jpg',476,640],['2025\/05\/4-8.jpg',508,1828],['2025\/05\/8-5.jpg',828,815]],abs:[['2025\/07\/3-1024x684.jpg',1024,684],['2025\/07\/IMG_55121-1024x647.jpg',1024,647],['2025\/05\/1-12.jpg',1657,1079],['2025\/05\/2-11.jpg',1016,671],['2025\/05\/10-2.jpg',639,640],['2025\/05\/4-7.jpg',1160,828],['2025\/05\/12-3.jpg',828,816],['2025\/05\/B4-15x15-4.jpg',635,640],['2025\/05\/IMG_6351-3.jpg',828,522],['2025\/05\/IMG_6345-3.jpg',384,640],['2025\/05\/IMG_5538-3.jpg',640,533],['2025\/05\/IMG_5527-3.jpg',636,640],['2025\/05\/IMG_6258-3.jpg',640,428],['2025\/05\/IMG_5499-3.jpg',478,640],['2025\/05\/IMG_5504-3.jpg',640,416],['2025\/05\/IMG_5495m-3.jpg',636,640],['2025\/05\/11-3.jpg',640,474],['2025\/05\/B3-08x120-4.jpg',640,414],['2025\/05\/7-4.jpg',640,427],['2025\/05\/9-4.jpg',828,558],['2025\/05\/6-4.jpg',622,640],['2025\/05\/8-4.jpg',640,400],['2025\/05\/IMG_5548-3-328x1024.jpg',328,1024]],geo:[['2025\/05\/1-10.jpg',1036,1037],['2025\/05\/2-12.jpg',625,640],['2025\/05\/5-4.jpg',1220,896],['2025\/05\/002-1.jpg',800,800],['2025\/05\/6-3-1024x786.jpg',1024,786],['2025\/05\/006.jpg',2167,2151],['2025\/05\/4-9.jpg',1263,948],['2025\/05\/IMG_6337-1.jpg',508,640],['2025\/07\/IMG_5539-1-scaled.jpg',1987,2560],['2025\/07\/IMG_7802-2-scaled.jpg',1861,2560],['2025\/05\/B7-09x12-2.jpg',640,460],['2025\/05\/IMG_5526-rotated.jpg',486,640],['2025\/05\/IMG_5546-1.jpg',474,640],['2025\/05\/IMG_6256-1.jpg',640,503],['2025\/05\/IMG_5530.jpg',640,510],['2025\/05\/IMG_5505.jpg',587,640],['2025\/05\/IMG_5507m-rotated.jpg',512,640],['2025\/05\/B5-10x10-2.jpg',638,640],['2025\/05\/A14-1.jpg',640,417],['2025\/05\/B1-12x16-2-1.jpg',828,650],['2025\/05\/A10-1.jpg',640,415],['2025\/05\/A12-1.jpg',640,429],['2025\/05\/13.jpg',975,994],['2025\/05\/A8-1.jpg',640,416],['2025\/05\/015-1.jpg',640,305],['2025\/05\/9-3.jpg',1016,1050]]};const EYE=1.62;const SALON={x0:-9,x1:-.1,z0:-4,z1:4,H:4.4};const LOFT={x0:.1,x1:36,z0:-7,z1:7,H:3.8};const DOOR={z0:2.6,z1:3.7,h:2.45};const stage=document.getElementById('bh-stage');const root=document.getElementById('bh3d')||document.body;let active=false;root.addEventListener('pointerenter',()=>active=true);root.addEventListener('pointerleave',()=>active=false);root.addEventListener('focusin',()=>active=true);root.addEventListener('focusout',e=>{if(!root.contains(e.relatedTarget))active=false});const renderer=new THREE.WebGLRenderer({antialias:true,powerPreference:'high-performance',preserveDrawingBuffer:DEMO});renderer.setPixelRatio(Math.min(window.devicePixelRatio||1,1.75));renderer.outputColorSpace=THREE.SRGBColorSpace;renderer.toneMapping=THREE.ACESFilmicToneMapping;renderer.toneMappingExposure=1.05;stage.appendChild(renderer.domElement);const scene=new THREE.Scene;scene.background=new THREE.Color(1709587);const camera=new THREE.PerspectiveCamera(70,1,.05,220);camera.rotation.order='YXZ';const maxAniso=renderer.capabilities.getMaxAnisotropy();const rnd=(()=>{let s=7;return()=>(s=s*16807%2147483647)\/2147483647})();function canvas(w,h){const c=document.createElement('canvas');c.width=w;c.height=h;return c}function tex(c,repeat,srgb=true){const t=new THREE.CanvasTexture(c);if(srgb)t.colorSpace=THREE.SRGBColorSpace;t.anisotropy=Math.min(8,maxAniso);if(repeat){t.wrapS=t.wrapT=THREE.RepeatWrapping;t.repeat.set(repeat[0],repeat[1])}return t}function std(color,o={}){return new THREE.MeshStandardMaterial(Object.assign({color:color,roughness:.9,metalness:0},o))}function box(w,h,d,mat,x,y,z,parent=scene){const m=new THREE.Mesh(new THREE.BoxGeometry(w,h,d),mat);m.position.set(x,y,z);parent.add(m);return m}function cyl(rt,rb,h,mat,x,y,z,seg=24,parent=scene){const m=new THREE.Mesh(new THREE.CylinderGeometry(rt,rb,h,seg),mat);m.position.set(x,y,z);parent.add(m);return m}function noRay(o){o.traverse(c=>{c.raycast=()=>{}});return o}const obstacles=[];function block(cx,cz,w,d){obstacles.push([cx-w\/2,cz-d\/2,cx+w\/2,cz+d\/2])}function noiseFill(ctx,w,h,n,alpha,light,dark){for(let i=0;i<n;i++){ctx.fillStyle=(rnd()<.5?light:dark).replace('A',(rnd()*alpha).toFixed(3));ctx.fillRect(rnd()*w,rnd()*h,1+rnd()*2,1+rnd()*2)}}function floorTexture(){const S=2048,c=canvas(S,S),g=c.getContext('2d');g.fillStyle='#9a968f';g.fillRect(0,0,S,S);const wrap=(x,y,r,fn)=>{for(const ox of[-S,0,S])for(const oy of[-S,0,S]){const X=x+ox,Y=y+oy;if(X+r<0||X-r>S||Y+r<0||Y-r>S)continue;fn(X,Y)}};for(let i=0;i<6e4;i++){const x=rnd()*S,y=rnd()*S,r=2.2+rnd()*3.6,l=128+rnd()*40|0;wrap(x,y,r+2,(X,Y)=>{g.fillStyle='rgba(0,0,0,.10)';g.beginPath();g.ellipse(X+.8,Y+1,r,r*.8,0,0,7);g.fill();g.fillStyle=`rgb(${l},${l-2},${l-5})`;g.beginPath();g.ellipse(X,Y,r,r*(.65+rnd()*.35),rnd()*3,0,7);g.fill();g.fillStyle='rgba(255,255,255,.18)';g.beginPath();g.arc(X-r*.3,Y-r*.3,r*.35,0,7);g.fill()})}for(let i=0;i<70;i++){const x=rnd()*S,y=rnd()*S,r=50+rnd()*420,dark=rnd()<.65;wrap(x,y,r,(X,Y)=>{const gr=g.createRadialGradient(X,Y,0,X,Y,r);const col=dark?'40,36,32,':'235,230,220,';gr.addColorStop(0,`rgba(${col}${(.08+rnd()*.16).toFixed(2)})`);gr.addColorStop(.6,`rgba(${col}${(.04+rnd()*.07).toFixed(2)})`);gr.addColorStop(1,`rgba(${col}0)`);g.fillStyle=gr;g.beginPath();g.ellipse(X,Y,r,r*(.4+rnd()*.6),rnd()*3,0,7);g.fill()})}for(let i=0;i<34;i++){const x=rnd()*S,y=rnd()*S,r=60+rnd()*340;wrap(x,y,r,(X,Y)=>{const gr=g.createRadialGradient(X,Y,0,X,Y,r);gr.addColorStop(0,`rgba(160,78,46,${(.1+rnd()*.11).toFixed(2)})`);gr.addColorStop(.55,`rgba(140,82,50,${(.03+rnd()*.05).toFixed(2)})`);gr.addColorStop(1,'rgba(140,82,50,0)');g.fillStyle=gr;g.beginPath();g.ellipse(X,Y,r,r*(.35+rnd()*.65),rnd()*3,0,7);g.fill()})}for(let i=0;i<260;i++){const x=rnd()*S,y=rnd()*S,r=2+rnd()*14,rust=rnd()<.6;wrap(x,y,r,(X,Y)=>{g.fillStyle=rust?`rgba(135,72,38,${(.12+rnd()*.2).toFixed(2)})`:`rgba(30,26,22,${(.08+rnd()*.14).toFixed(2)})`;g.beginPath();g.ellipse(X,Y,r,r*(.5+rnd()*.5),rnd()*3,0,7);g.fill()})}for(let i=0;i<40;i++){const x=rnd()*S,y=rnd()*S,a=rnd()*6.3,L=30+rnd()*160;g.strokeStyle=`rgba(${rnd()<.5?'255,250,240':'30,26,22'},${(.08+rnd()*.12).toFixed(2)})`;g.lineWidth=.6+rnd();g.beginPath();g.moveTo(x,y);g.lineTo(x+Math.cos(a)*L,y+Math.sin(a)*L);g.stroke()}for(let i=0;i<16;i++){let x=rnd()*S,y=rnd()*S,a=rnd()*6.3;g.strokeStyle='rgba(30,26,22,.35)';g.lineWidth=1+rnd();g.beginPath();g.moveTo(x,y);for(let k=0;k<14;k++){a+=(rnd()-.5)*.9;x+=Math.cos(a)*18;y+=Math.sin(a)*18;g.lineTo(x,y)}g.stroke()}g.fillStyle='rgba(25,22,20,.55)';g.fillRect(0,0,S,5);g.fillRect(0,0,5,S);g.fillStyle='rgba(255,255,255,.12)';g.fillRect(0,5,S,2);g.fillRect(5,0,2,S);return tex(c,[1,1])}function putzTexture(){const S=1024,c=canvas(S,S),g=c.getContext('2d');g.fillStyle='#e4e0d9';g.fillRect(0,0,S,S);const wrap=(x,y,r,fn)=>{for(const ox of[-S,0,S])for(const oy of[-S,0,S]){const X=x+ox,Y=y+oy;if(X+r<0||X-r>S||Y+r<0||Y-r>S)continue;fn(X,Y)}};for(let i=0;i<40;i++){const x=rnd()*S,y=rnd()*S,r=40+rnd()*160,l=rnd()<.5;wrap(x,y,r,(X,Y)=>{const gr=g.createRadialGradient(X,Y,0,X,Y,r);gr.addColorStop(0,l?'rgba(255,255,255,.14)':'rgba(110,100,90,.07)');gr.addColorStop(1,'rgba(0,0,0,0)');g.fillStyle=gr;g.beginPath();g.ellipse(X,Y,r,r*(.4+rnd()*.5),rnd()*3,0,7);g.fill()})}for(let i=0;i<9e3;i++){const x=rnd()*S,y=rnd()*S,r=.8+rnd()*2.6,l=rnd()<.5;wrap(x,y,r+2,(X,Y)=>{g.fillStyle=l?'rgba(255,255,255,.55)':'rgba(80,72,64,.26)';g.beginPath();g.arc(X,Y,r,0,7);g.fill();g.fillStyle=l?'rgba(70,64,58,.18)':'rgba(255,255,255,.3)';g.beginPath();g.arc(X+r*.6,Y+r*.6,r*.7,0,7);g.fill()})}for(let i=0;i<7;i++){const x=rnd()*S,y=rnd()*S,r=50+rnd()*120;wrap(x,y,r,(X,Y)=>{g.strokeStyle='rgba(120,100,70,.1)';g.lineWidth=1.5+rnd()*2;g.beginPath();g.ellipse(X,Y,r,r*.7,rnd()*3,0,7);g.stroke();g.fillStyle='rgba(140,120,90,.035)';g.fill()})}for(let i=0;i<4;i++){let x=rnd()*S,y=rnd()*S,a=rnd()*6.3;g.strokeStyle='rgba(60,54,48,.3)';g.lineWidth=.8;g.beginPath();g.moveTo(x,y);for(let k=0;k<12;k++){a+=rnd()-.5;x+=Math.cos(a)*14;y+=Math.sin(a)*14;g.lineTo(x,y)}g.stroke()}noiseFill(g,S,S,4e4,.07,'rgba(255,255,255,A)','rgba(40,35,30,A)');return tex(c,[1,1])}function plasterTexture(base){const S=512,c=canvas(S,S),g=c.getContext('2d');g.fillStyle=base;g.fillRect(0,0,S,S);noiseFill(g,S,S,9e3,.035,'rgba(255,255,255,A)','rgba(60,50,40,A)');return tex(c,[1,1])}function woodPanelTexture(){const W=512,H=540,c=canvas(W,H),g=c.getContext('2d');g.fillStyle='#3a2014';g.fillRect(0,0,W,H);for(let i=0;i<260;i++){g.strokeStyle=`rgba(${rnd()<.5?'90,50,30':'20,8,4'},${.12+rnd()*.2})`;g.lineWidth=.6+rnd()*1.6;const x=rnd()*W;g.beginPath();g.moveTo(x,0);g.bezierCurveTo(x+rnd()*10-5,H\/3,x+rnd()*10-5,H*2\/3,x+rnd()*8-4,H);g.stroke()}const pan=(x,y,w,h)=>{g.fillStyle='rgba(0,0,0,.28)';g.fillRect(x,y,w,h);g.fillStyle='rgba(120,70,40,.18)';g.fillRect(x+10,y+10,w-20,h-20);g.strokeStyle='rgba(0,0,0,.55)';g.lineWidth=4;g.strokeRect(x+10,y+10,w-20,h-20);g.strokeStyle='rgba(170,110,70,.35)';g.lineWidth=2;g.strokeRect(x+2,y+2,w-4,h-4)};pan(28,70,W\/2-42,H-120);pan(W\/2+14,70,W\/2-42,H-120);g.fillStyle='rgba(0,0,0,.45)';g.fillRect(0,0,W,34);g.fillStyle='rgba(160,100,60,.25)';g.fillRect(0,34,W,4);g.fillStyle='rgba(0,0,0,.5)';g.fillRect(0,H-26,W,26);return tex(c,[1,1])}function doorTexture(){const W=256,H=540,c=canvas(W,H),g=c.getContext('2d');g.fillStyle='#3b2015';g.fillRect(0,0,W,H);for(let i=0;i<120;i++){g.strokeStyle=`rgba(${rnd()<.5?'95,55,30':'15,6,2'},${.15+rnd()*.2})`;g.lineWidth=.6+rnd()*1.4;const x=rnd()*W;g.beginPath();g.moveTo(x,0);g.lineTo(x+rnd()*6-3,H);g.stroke()}const rows=[[24,150],[190,170],[376,140]];for(const[y,h]of rows)for(const x of[22,136]){g.fillStyle='rgba(0,0,0,.35)';g.fillRect(x,y,98,h);g.strokeStyle='rgba(160,100,60,.3)';g.lineWidth=3;g.strokeRect(x+8,y+8,82,h-16)}g.fillStyle='#c9b48a';g.beginPath();g.arc(218,290,6,0,7);g.fill();return tex(c)}function rugTexture(base,dots){const S=512,c=canvas(S,S),g=c.getContext('2d');g.fillStyle=base;g.fillRect(0,0,S,S);noiseFill(g,S,S,dots,.22,'rgba(255,255,255,A)','rgba(80,70,60,A)');return tex(c,[2,2])}function cowhideTexture(){const S=512,c=canvas(S,S),g=c.getContext('2d');g.translate(S\/2,S\/2);g.beginPath();const pts=26;for(let i=0;i<=pts;i++){const a=i\/pts*Math.PI*2;let r=210+Math.sin(a*4)*30+Math.sin(a*9+1)*12;if(Math.abs(Math.cos(a))>.92)r+=25;const x=Math.cos(a)*r,y=Math.sin(a)*r*.78;i?g.lineTo(x,y):g.moveTo(x,y)}g.closePath();g.fillStyle='#7a3f1e';g.fill();g.save();g.clip();for(let i=0;i<5;i++){g.fillStyle='rgba(240,232,220,.92)';g.beginPath();const x=(rnd()-.5)*360,y=(rnd()-.5)*300;g.ellipse(x,y,20+rnd()*45,12+rnd()*30,rnd()*3,0,7);g.fill()}noiseFill(g,400,400,6e3,.15,'rgba(255,220,190,A)','rgba(30,10,0,A)');g.restore();const t=tex(c);return t}function outsideTexture(){const W=256,H=384,c=canvas(W,H),g=c.getContext('2d');const sky=g.createLinearGradient(0,0,0,H);sky.addColorStop(0,'#f4efe4');sky.addColorStop(1,'#e9e2d2');g.fillStyle=sky;g.fillRect(0,0,W,H);g.filter='blur(6px)';g.fillStyle='#9a5a44';g.fillRect(-10,H*.25,W*.55,H);g.fillStyle='#b06a52';g.fillRect(W*.62,H*.45,W,H);for(let i=0;i<70;i++){g.fillStyle=`rgba(${60+rnd()*60},${100+rnd()*70},${40+rnd()*40},${.5+rnd()*.4})`;g.beginPath();g.arc(rnd()*W,H*.15+rnd()*H*.9,10+rnd()*30,0,7);g.fill()}g.filter='none';return tex(c)}function glowTexture(){const S=256,c=canvas(S,S),g=c.getContext('2d');const gr=g.createRadialGradient(S\/2,S*.38,0,S\/2,S*.45,S*.5);gr.addColorStop(0,'rgba(255,214,160,1)');gr.addColorStop(.5,'rgba(255,200,140,.45)');gr.addColorStop(1,'rgba(255,190,120,0)');g.fillStyle=gr;g.fillRect(0,0,S,S);return tex(c)}function textTexture(lines,w,h,opts={}){const c=canvas(w,h),g=c.getContext('2d');g.fillStyle=opts.bg||'#f7f5f1';g.fillRect(0,0,w,h);g.fillStyle=opts.color||'#111';g.textBaseline='middle';lines.forEach((l,i)=>{g.font=l.font;g.textAlign=opts.align||'left';if(g.letterSpacing!==undefined)g.letterSpacing=l.ls||'0px';g.fillText(l.text,opts.align==='center'?w\/2:opts.pad||16,l.y)});return tex(c)}(function makeEnv(){const env=new THREE.Scene;const room=new THREE.Mesh(new THREE.BoxGeometry(40,8,16),new THREE.MeshBasicMaterial({color:8750469,side:THREE.BackSide}));env.add(room);const floorE=new THREE.Mesh(new THREE.PlaneGeometry(40,16),new THREE.MeshBasicMaterial({color:3947580}));floorE.rotation.x=-Math.PI\/2;floorE.position.y=-3.9;env.add(floorE);for(let i=0;i<6;i++){const p=new THREE.Mesh(new THREE.PlaneGeometry(2,3),new THREE.MeshBasicMaterial({color:16777215}));p.position.set(-15+i*6,.5,-7.9);env.add(p);const q=p.clone();q.position.z=7.9;q.rotation.y=Math.PI;env.add(q)}const pm=new THREE.PMREMGenerator(renderer);scene.environment=pm.fromScene(env,.04).texture;pm.dispose()})();const M={wall:std(15854820,{map:plasterTexture('#f3eee6')}),wallLoft:std(16052716,{map:plasterTexture('#f6f3ee')}),ceil:std(16184042,{map:putzTexture(),emissive:4866104,emissiveIntensity:1}),floor:std(16777215,{map:floorTexture(),roughness:.96,envMapIntensity:.12}),wood:std(4860442,{roughness:.55}),woodWin:std(5779996,{roughness:.6}),woodLight:std(11565637,{roughness:.65}),white:std(16250353,{roughness:.6}),partition:std(16316146,{roughness:.85}),dark:std(2763308,{roughness:.5}),black:std(921102,{roughness:.45}),steel:std(12172480,{roughness:.28,metalness:.9}),sofa:std(15326384,{roughness:.95}),fur:std(16052714,{roughness:1}),glass:new THREE.MeshPhysicalMaterial({color:16777215,roughness:.05,transmission:0,transparent:true,opacity:.18,metalness:0,depthWrite:false}),outside:new THREE.MeshBasicMaterial({map:outsideTexture(),toneMapped:false}),frosted:new THREE.MeshStandardMaterial({color:15921386,transparent:true,opacity:.55,roughness:.3,depthWrite:false}),wicker:std(9071178,{roughness:1}),green:std(2054714,{roughness:.9})};const woodPanelTex=woodPanelTexture();const doorTex=doorTexture();const glowTex=glowTexture();const floors=[],ceilings=[];function floorAndCeiling(R,floorMat){const w=R.x1-R.x0,d=R.z1-R.z0,cx=(R.x0+R.x1)\/2,cz=(R.z0+R.z1)\/2;const fm=floorMat.clone();fm.map=floorMat.map.clone();fm.map.needsUpdate=true;fm.map.repeat.set(w\/3,d\/3);fm.bumpMap=fm.map;fm.bumpScale=.5;fm.userData.keepColor=true;fm.color.setHex(16375250);const f=new THREE.Mesh(new THREE.PlaneGeometry(w+.4,d+.4),fm);f.rotation.x=-Math.PI\/2;f.position.set(cx,0,cz);f.userData.floor=true;scene.add(f);floors.push(f);const cm=M.ceil.clone();cm.map=M.ceil.map.clone();cm.map.needsUpdate=true;cm.map.repeat.set(w\/3,d\/3);cm.emissiveMap=cm.map;cm.bumpMap=cm.map;cm.bumpScale=.9;const c=new THREE.Mesh(new THREE.PlaneGeometry(w+.4,d+.4),cm);c.rotation.x=Math.PI\/2;c.position.set(cx,R.H,cz);scene.add(c);ceilings.push(c);return{f:f,c:c}}floorAndCeiling(SALON,M.floor);floorAndCeiling(LOFT,M.floor);{const f=new THREE.Mesh(new THREE.PlaneGeometry(.4,DOOR.z1-DOOR.z0),M.floor);f.rotation.x=-Math.PI\/2;f.position.set(0,.001,(DOOR.z0+DOOR.z1)\/2);f.userData.floor=true;scene.add(f);floors.push(f)}function wall(a,b,n,H,mat,ops=[],T=.3,centered=false){const dx=b[0]-a[0],dz=b[1]-a[1],L=Math.hypot(dx,dz);const dir=[dx\/L,dz\/L];const off=centered?0:-T\/2;const alongX=Math.abs(dir[0])>.5;const piece=(u0,u1,y0,y1)=>{if(u1-u0<.001||y1-y0<.001)return;const uc=(u0+u1)\/2,len=u1-u0;const x=a[0]+dir[0]*uc+n[0]*off,z=a[1]+dir[1]*uc+n[1]*off;const m=box(alongX?len:T,y1-y0,alongX?T:len,mat,x,(y0+y1)\/2,z);m.userData.wall=true};ops=ops.slice().sort((p,q)=>p.u0-q.u0);let u=0;for(const o of ops){piece(u,o.u0,0,H);piece(o.u0,o.u1,0,o.y0);piece(o.u0,o.u1,o.y1+(o.rise||0),H);if(o.rise)spandrels(a,dir,n,o,T,off,mat);u=o.u1}piece(u,L,0,H);return{a:a,dir:dir,n:n,L:L}}function archShape(w,hs,rise,inset=0){const s=new THREE.Shape,hw=w\/2-inset;s.moveTo(-hw,inset);s.lineTo(hw,inset);s.lineTo(hw,hs);s.absellipse(0,hs,hw,rise-inset,0,Math.PI,false);s.lineTo(-hw,inset);return s}function orient(obj,n){obj.rotation.y=Math.atan2(n[0],n[1])}function spandrels(a,dir,n,o,T,off,mat){const w=o.u1-o.u0,hs=o.y1-o.y0,r=o.rise;const L=new THREE.Shape;L.moveTo(-w\/2,hs);L.lineTo(-w\/2,hs+r);L.lineTo(0,hs+r);L.absellipse(0,hs,w\/2,r,Math.PI\/2,Math.PI,false);const R=new THREE.Shape;R.moveTo(w\/2,hs);R.lineTo(w\/2,hs+r);R.lineTo(0,hs+r);R.absellipse(0,hs,w\/2,r,Math.PI\/2,0,true);const g=new THREE.ExtrudeGeometry([L,R],{depth:T,bevelEnabled:false,curveSegments:24});const m=new THREE.Mesh(g,mat);const uc=(o.u0+o.u1)\/2;orient(m,n);m.position.set(a[0]+dir[0]*uc+n[0]*(off-T\/2),o.y0,a[1]+dir[1]*uc+n[1]*(off-T\/2));m.userData.wall=true;scene.add(m)}function archWindow(pos,n,w,hs,rise,glassMat,recess=.12,fw=.07){const g=new THREE.Group;const frameShape=archShape(w,hs,rise,0);frameShape.holes.push(archShape(w,hs,rise,fw));const fr=new THREE.Mesh(new THREE.ExtrudeGeometry(frameShape,{depth:.07,bevelEnabled:false,curveSegments:24}),M.woodWin);g.add(fr);const gl=new THREE.Mesh(new THREE.ShapeGeometry(archShape(w,hs,rise,fw*.5),24),glassMat);const uv=gl.geometry.attributes.uv,P=gl.geometry.attributes.position;for(let i=0;i<uv.count;i++)uv.setXY(i,(P.getX(i)+w\/2)\/w,P.getY(i)\/(hs+rise));gl.position.z=.03;g.add(gl);const bar=(bw,bh,x,y)=>{const m=new THREE.Mesh(new THREE.BoxGeometry(bw,bh,.06),M.woodWin);m.position.set(x,y,.035);g.add(m)};bar(.06,hs+rise-fw*2,0,(hs+rise)\/2);bar(w-fw,.07,0,hs);bar(w-fw,.05,0,hs*.5);for(const sx of[-1,1])bar(.04,hs-fw,sx*w\/4,hs\/2);bar(w+.12,.05,0,-.02);orient(g,n);g.position.set(pos[0]-n[0]*recess,pos[1],pos[2]-n[1]*recess);scene.add(g);return g}const sH=SALON.H;const salonWin={zc:0,w:4,y0:1.2,y1:2.75,rise:.75};wall([0,-7],[0,7],[1,0],LOFT.H,M.wallLoft,[{u0:7+salonWin.zc-salonWin.w\/2,u1:7+salonWin.zc+salonWin.w\/2,y0:salonWin.y0,y1:salonWin.y1,rise:salonWin.rise},{u0:7+DOOR.z0,u1:7+DOOR.z1,y0:0,y1:DOOR.h}],.2,true);box(.2,sH-LOFT.H,8,M.wall,0,(LOFT.H+sH)\/2,0);wall([-9,-4],[0,-4],[0,1],sH,M.wall);wall([0,4],[-9,4],[0,-1],sH,M.wall);wall([-9,4],[-9,-4],[1,0],sH,M.wall);const winGlass=M.glass;archWindow([0,salonWin.y0,salonWin.zc],[-1,0],salonWin.w,salonWin.y1-salonWin.y0,salonWin.rise,winGlass,-.035);{const etch=new THREE.Mesh(new THREE.PlaneGeometry(salonWin.w-.2,.55),M.frosted);etch.position.set(0,salonWin.y0+.36,0);etch.rotation.y=Math.PI\/2;noRay(etch);scene.add(etch)}for(const zz of[DOOR.z0,DOOR.z1])box(.3,DOOR.h,.08,M.wood,0,DOOR.h\/2,zz+(zz===DOOR.z0?.04:-.04));box(.3,.1,DOOR.z1-DOOR.z0,M.wood,0,DOOR.h+.05,(DOOR.z0+DOOR.z1)\/2);const WH=1.15;function wainscot(a,b,n,skip=[]){const dx=b[0]-a[0],dz=b[1]-a[1],L=Math.hypot(dx,dz),dir=[dx\/L,dz\/L];let segs=[[0,L]];for(const[s0,s1]of skip)segs=segs.flatMap(([u0,u1])=>s1<=u0||s0>=u1?[[u0,u1]]:[[u0,s0],[s1,u1]].filter(p=>p[1]-p[0]>.02));for(const[u0,u1]of segs){const len=u1-u0,uc=(u0+u1)\/2;const t=woodPanelTex.clone();t.needsUpdate=true;t.wrapS=THREE.RepeatWrapping;t.repeat.set(len\/1.1,1);const m=new THREE.Mesh(new THREE.PlaneGeometry(len,WH),std(16777215,{map:t,roughness:.6}));orient(m,n);m.position.set(a[0]+dir[0]*uc+n[0]*.035,WH\/2,a[1]+dir[1]*uc+n[1]*.035);scene.add(m);const rail=new THREE.Mesh(new THREE.BoxGeometry(len,.06,.07),M.wood);orient(rail,n);rail.position.set(a[0]+dir[0]*uc+n[0]*.035,WH+.03,a[1]+dir[1]*uc+n[1]*.035);scene.add(rail)}}wainscot([-9,-4],[-.1,-4],[0,1]);wainscot([-.1,4],[-9,4],[0,-1]);wainscot([-9,4],[-9,-4],[1,0]);wainscot([-.1,-4],[-.1,4],[-1,0],[[4+DOOR.z0-.02,4+DOOR.z1+.02]]);for(const[x,z,w,d]of[[-4.55,-3.93,9,.14],[-4.55,3.93,9,.14],[-8.93,0,.14,8],[-.17,0,.14,8]]){box(w,.22,d,M.white,x,sH-.11,z);box(w+(w>1?0:.08),.06,d+(d>1?0:.08),M.white,x,sH-.3,z)}for(const[x,z,w,d]of[[-4.55,-3.1,7.4,.06],[-4.55,3.1,7.4,.06],[-8.15,0,.06,6.26],[-.95,0,.06,6.26]])box(w,.05,d,M.white,x,sH-.03,z);{const R=new THREE.Group;R.position.set(-4.55,sH,0);const t1=new THREE.Mesh(new THREE.TorusGeometry(.55,.05,10,48),M.white);t1.rotation.x=Math.PI\/2;t1.position.y=-.04;R.add(t1);const t2=new THREE.Mesh(new THREE.TorusGeometry(.3,.06,10,40),M.white);t2.rotation.x=Math.PI\/2;t2.position.y=-.06;R.add(t2);for(let i=0;i<16;i++){const a=i\/16*Math.PI*2;const leaf=new THREE.Mesh(new THREE.SphereGeometry(.12,10,6),M.white);leaf.scale.set(1,.35,.45);leaf.position.set(Math.cos(a)*.78,-.03,Math.sin(a)*.78);leaf.rotation.y=-a;R.add(leaf)}const boss=new THREE.Mesh(new THREE.SphereGeometry(.12,14,8),M.white);boss.scale.y=.5;boss.position.y=-.05;R.add(boss);scene.add(R)}{const cloud=new THREE.Group;cloud.position.set(-4.55,3.05,0);const mat=new THREE.MeshStandardMaterial({color:16513266,emissive:16769720,emissiveIntensity:.35,roughness:1,flatShading:true});for(let i=0;i<46;i++){const r=.1+rnd()*.17;const m=new THREE.Mesh(new THREE.IcosahedronGeometry(r,0),mat);const a=rnd()*Math.PI*2,b=Math.acos(2*rnd()-1),d=.18+rnd()*.28;m.position.set(Math.sin(b)*Math.cos(a)*d*1.15,Math.cos(b)*d*.95,Math.sin(b)*Math.sin(a)*d);m.rotation.set(rnd()*3,rnd()*3,rnd()*3);m.scale.set(1,.5+rnd()*.6,1);cloud.add(m)}scene.add(cloud);const cord=new THREE.Mesh(new THREE.CylinderGeometry(.006,.006,sH-3.4),M.white);cord.position.set(-4.55,(sH+3.4)\/2,0);scene.add(cord);const pl=new THREE.PointLight(16766624,22,14,1.6);pl.position.set(-4.55,2.95,0);scene.add(pl)}function pedimentDoor(x,z,n){const g=new THREE.Group;const leaf=new THREE.Mesh(new THREE.PlaneGeometry(1.05,2.3),std(16777215,{map:doorTex,roughness:.6}));leaf.position.set(0,1.15,.05);g.add(leaf);const fr=(w,h,x2,y2)=>{const m=new THREE.Mesh(new THREE.BoxGeometry(w,h,.1),M.wood);m.position.set(x2,y2,.05);g.add(m)};fr(.14,2.45,-.6,1.225);fr(.14,2.45,.6,1.225);fr(1.5,.24,0,2.45);const tri=new THREE.Shape;tri.moveTo(-.85,0);tri.lineTo(.85,0);tri.lineTo(0,.42);tri.lineTo(-.85,0);const ped=new THREE.Mesh(new THREE.ExtrudeGeometry(tri,{depth:.16,bevelEnabled:false}),M.wood);ped.position.set(0,2.6,0);g.add(ped);fr(1.75,.07,0,2.6);orient(g,n);g.position.set(x,0,z);scene.add(g)}pedimentDoor(-6,-4,[0,1]);pedimentDoor(-2.6,-4,[0,1]);{const sx=-1.05;box(.95,.42,4.6,M.sofa,sx,.25,-1.1);box(.25,.42,4.6,M.sofa,sx+.38,.62,-1.1);box(2.2,.42,.95,M.sofa,sx-.65,.25,-3.05);box(2.2,.42,.25,M.sofa,sx-.65,.62,-3.45);box(.95,.3,.22,M.sofa,sx,.55,1.2);for(const[z,s]of[[.6,1],[-.4,.9],[-1.5,1],[-2.5,.8]]){const c=new THREE.Mesh(new THREE.BoxGeometry(.18,.42*s,.6*s),M.fur);c.position.set(sx+.18,.7,z);c.rotation.z=.15;scene.add(c)}const throwB=box(.9,.03,1.6,M.fur,sx-.05,.48,-.4);throwB.rotation.x=.02;block(sx,-1.1,1,4.7);block(sx-.65,-3.05,2.3,1);const ct=new THREE.Group;ct.position.set(-2.9,0,-.9);scene.add(ct);box(1,.07,1.4,M.white,0,.36,0,ct);for(const[x,z]of[[-.4,-.58],[.4,-.58],[-.4,.58],[.4,.58]]){const wh=new THREE.Mesh(new THREE.CylinderGeometry(.13,.13,.06,20),M.black);wh.rotation.z=Math.PI\/2;wh.position.set(x,.14,z);ct.add(wh);box(.05,.2,.05,M.steel,x,.27,z,ct)}const vase=new THREE.Mesh(new THREE.SphereGeometry(.15,20,14),M.white);vase.scale.set(1,.85,.5);vase.position.set(0,.52,.1);ct.add(vase);block(-2.9,-.9,1.05,1.45);for(const[x,z]of[[-3.9,-.1],[-3.4,-1.9]]){box(.5,.5,.5,M.fur,x,.25,z);block(x,z,.55,.55)}const rug=new THREE.Mesh(new THREE.PlaneGeometry(4.2,4.6),std(16777215,{map:rugTexture('#cfc6b6',3e4),roughness:1}));rug.rotation.x=-Math.PI\/2;rug.position.set(-2.8,.006,-1);rug.userData.floor=true;scene.add(rug);floors.push(rug);const rt=new THREE.Group;rt.position.set(-7.8,0,2.9);scene.add(rt);cyl(.55,.55,.04,M.woodLight,0,.74,0,32,rt);cyl(.03,.03,.72,M.black,0,.37,0,8,rt);cyl(.25,.25,.02,M.black,0,.01,0,20,rt);const lampShade=new THREE.Mesh(new THREE.CylinderGeometry(.12,.17,.24,24,1,true),new THREE.MeshStandardMaterial({color:16765578,emissive:16756816,emissiveIntensity:1.4,side:THREE.DoubleSide}));lampShade.position.set(-.25,1.12,.2);rt.add(lampShade);cyl(.06,.09,.28,M.wicker,-.25,.9,.2,16,rt);const pl=new THREE.PointLight(16758888,6,6,1.8);pl.position.set(-7.95,1.2,3.1);scene.add(pl);const chair=new THREE.Group;chair.position.set(-6.9,0,2.6);chair.rotation.y=-.6;scene.add(chair);box(.75,.45,.75,M.wicker,0,.23,0,chair);box(.75,.45,.12,M.wicker,0,.65,.32,chair);box(.12,.25,.75,M.wicker,-.32,.55,0,chair);box(.12,.25,.75,M.wicker,.32,.55,0,chair);const rug2=new THREE.Mesh(new THREE.PlaneGeometry(2.6,2.2),std(16777215,{map:rugTexture('#ebe6dc',26e3),roughness:1}));rug2.rotation.x=-Math.PI\/2;rug2.position.set(-7.5,.006,2.75);rug2.userData.floor=true;scene.add(rug2);floors.push(rug2);block(-7.8,2.9,1.2,1.2);block(-6.9,2.6,.9,.9);box(1.6,.75,.45,M.white,-8.7,.375,-1.6).rotation.y=Math.PI\/2;block(-8.7,-1.6,.5,1.6)}const LH=LOFT.H;const WIN_X=[3,9,15,21,27,33];const LW={w:2,y0:.95,y1:2.55,rise:.6};const winOps=WIN_X.map(x=>({u0:x-LW.w\/2,u1:x+LW.w\/2,y0:LW.y0,y1:LW.y1,rise:LW.rise}));wall([0,-7],[36,-7],[0,1],LH,M.wallLoft,winOps);wall([36,7],[0,7],[0,-1],LH,M.wallLoft,WIN_X.map(x=>({u0:36-x-LW.w\/2,u1:36-x+LW.w\/2,y0:LW.y0,y1:LW.y1,rise:LW.rise})));wall([36,-7],[36,7],[-1,0],LH,M.wallLoft,[{u0:5.2,u1:8.8,y0:0,y1:2.9}]);for(const x of WIN_X){archWindow([x,LW.y0,-7],[0,1],LW.w,LW.y1-LW.y0,LW.rise,M.outside);archWindow([x,LW.y0,7],[0,-1],LW.w,LW.y1-LW.y0,LW.rise,M.outside)}{const g=new THREE.Group;g.position.set(36-.1,0,0);scene.add(g);const backMat=new THREE.MeshBasicMaterial({color:9207152});const back=new THREE.Mesh(new THREE.PlaneGeometry(3.6,2.9),backMat);back.rotation.y=-Math.PI\/2;back.position.set(.05,1.45,0);g.add(back);for(let i=0;i<=6;i++)box(.06,2.9,.06,M.woodWin,-.02,1.45,-1.8+i*.6,g);for(const y of[.05,.9,1.9,2.87])box(.06,.06,3.6,M.woodWin,-.02,y,0,g);const gl=new THREE.Mesh(new THREE.PlaneGeometry(3.6,2.9),M.glass);gl.rotation.y=-Math.PI\/2;gl.position.set(-.03,1.45,0);g.add(gl);const lampB=new THREE.Mesh(new THREE.SphereGeometry(.18,16,10),new THREE.MeshBasicMaterial({color:16769712}));lampB.position.set(.6,1.4,1);g.add(lampB)}const COL_Z=-1;for(const x of[6,12,18,24,30]){cyl(.16,.17,.95,M.dark,x,.475,COL_Z,28);cyl(.12,.12,LH-1.4,M.white,x,.95+(LH-1.4)\/2,COL_Z,28);cyl(.15,.15,.06,M.white,x,.98,COL_Z,28);const cap=new THREE.Mesh(new THREE.CylinderGeometry(.24,.13,.32,16,1),M.white);cap.position.set(x,LH-.6,COL_Z);scene.add(cap);for(let i=0;i<8;i++){const a=i\/8*Math.PI*2;const leaf=new THREE.Mesh(new THREE.SphereGeometry(.07,8,6),M.white);leaf.scale.set(1,1.6,.6);leaf.position.set(x+Math.cos(a)*.17,LH-.62,COL_Z+Math.sin(a)*.17);leaf.rotation.y=-a;scene.add(leaf)}box(.5,.08,.5,M.white,x,LH-.4,COL_Z);block(x,COL_Z,.36,.36)}box(36,.36,.34,M.white,18,LH-.18,COL_Z);const shadeGeo=new THREE.LatheGeometry([new THREE.Vector2(.02,.18),new THREE.Vector2(.05,.17),new THREE.Vector2(.08,.1),new THREE.Vector2(.17,.02),new THREE.Vector2(.2,0)],24);const shadeMat=new THREE.MeshStandardMaterial({color:15921128,roughness:.3,side:THREE.DoubleSide});const bulbMat=new THREE.MeshBasicMaterial({color:16771008});function pendant(x,z,y=2.75,light=true){const cord=new THREE.Mesh(new THREE.CylinderGeometry(.005,.005,LH-y),M.black);cord.position.set(x,(LH+y)\/2,z);scene.add(cord);const s=new THREE.Mesh(shadeGeo,shadeMat);s.position.set(x,y-.18,z);scene.add(s);const b=new THREE.Mesh(new THREE.SphereGeometry(.07,14,10),bulbMat);b.position.set(x,y-.17,z);scene.add(b);if(light){const p=new THREE.PointLight(16766883,9,10,1.6);p.position.set(x,y-.3,z);scene.add(p)}}[[3,.3],[9,-2.6],[15,2.2],[21,-2.6],[27,2.2],[33,0]].forEach(([x,z],i)=>pendant(x,z,2.8,i%1===0));{const cone=new THREE.Mesh(new THREE.CylinderGeometry(.16,.3,.7,28,1,true),new THREE.MeshStandardMaterial({color:1118481,roughness:.6,side:THREE.DoubleSide}));cone.position.set(21,2.15,2.4);scene.add(cone);const cord=new THREE.Mesh(new THREE.CylinderGeometry(.005,.005,LH-2.5),M.black);cord.position.set(21,(LH+2.5)\/2,2.4);scene.add(cord);const p=new THREE.PointLight(16765344,5,5,1.8);p.position.set(21,1.8,2.4);scene.add(p)}const PW=3.6,PH=2.6,PT=.16;const PART_L=[4.5,10.5,16.5,22.5,28.5].map(x=>({x:x,z:-4.3}));const PART_R=[4.5,10.5,16.5].map(x=>({x:x,z:4}));for(const p of[...PART_L,...PART_R]){const m=box(PW,PH,PT,M.partition,p.x,PH\/2,p.z);m.userData.wall=true;box(PW+.01,.06,PT+.01,M.dark,p.x,.03,p.z);block(p.x,p.z,PW,PT)}{const tx=21,tz=2.4;const top=new THREE.Mesh(new THREE.BoxGeometry(1.7,.02,1),new THREE.MeshPhysicalMaterial({color:14217192,transparent:true,opacity:.35,roughness:.05}));top.position.set(tx,.74,tz);scene.add(top);box(1.2,.72,.04,M.frosted,tx,.37,tz);for(const[dx,dz,r]of[[-.45,-.75,0],[.45,-.75,0],[-.45,.75,Math.PI],[.45,.75,Math.PI]]){const c=new THREE.Group;c.position.set(tx+dx,0,tz+dz);c.rotation.y=r;scene.add(c);box(.42,.04,.42,M.white,0,.45,0,c);box(.42,.5,.04,M.white,0,.7,-.2,c);const b=box(.4,.04,.52,M.white,0,.22,.02,c);b.rotation.x=-.8;box(.42,.03,.5,M.white,0,.015,.05,c)}block(tx,tz,1.8,2.2);for(const sx of[-1,1]){const cnd=cyl(.025,.025,.28,M.white,tx+sx*.2,.89,tz,10)}box(3,.92,.75,M.white,27.5,.46,1.9);block(27.5,1.9,3.1,.85);box(3.1,.04,.8,std(15131613,{roughness:.25}),27.5,.94,1.9);box(.9,.9,.65,M.steel,29.6,.45,3.3);box(.9,.04,.65,M.black,29.6,.92,3.3);block(29.6,3.3,1,.75);box(1,1.25,.12,M.white,29.6,.62,3.7);const bench=new THREE.Group;bench.position.set(25.2,0,3.6);scene.add(bench);box(2.2,.06,.7,M.woodLight,0,.9,0,bench);for(const[x,z]of[[-1.05,-.3],[1.05,-.3],[-1.05,.3],[1.05,.3]])box(.06,.9,.06,M.woodLight,x,.45,z,bench);box(2.1,.03,.62,M.woodLight,0,.18,0,bench);block(25.2,3.6,2.3,.8);const kettle=cyl(.07,.1,.18,M.steel,29.4,1.03,3.2,16);const fruit=new THREE.Mesh(new THREE.SphereGeometry(.05,10,8),std(15305244));fruit.position.set(27.2,1,1.9);scene.add(fruit);box(.75,1.9,.7,std(3816512,{roughness:.35,metalness:.5}),32.6,.95,6.5);block(32.6,6.5,.8,.8);const cow=new THREE.Mesh(new THREE.PlaneGeometry(2.4,2.4),new THREE.MeshStandardMaterial({map:cowhideTexture(),transparent:true,alphaTest:.5,roughness:.95}));cow.rotation.x=-Math.PI\/2;cow.rotation.z=.3;cow.position.set(14.5,.006,.6);cow.userData.floor=true;scene.add(cow);floors.push(cow);const arm=new THREE.Group;arm.position.set(15.4,0,1.6);arm.rotation.y=-2.3;scene.add(arm);box(.62,.08,.62,M.black,0,.42,0,arm);box(.62,.55,.08,M.black,0,.72,-.28,arm);for(const sx of[-1,1]){box(.03,.03,.7,M.steel,sx*.3,.03,0,arm);box(.03,.4,.03,M.steel,sx*.3,.22,.3,arm)}block(15.4,1.6,.75,.75);const bt=new THREE.Group;bt.position.set(33.2,0,-3.6);scene.add(bt);box(2.4,.12,1.3,M.wood,0,.78,0,bt);box(2.2,.02,1.1,M.green,0,.85,0,bt);for(const[x,z]of[[-1,-.5],[1,-.5],[-1,.5],[1,.5]])box(.12,.72,.12,M.wood,x,.36,z,bt);block(33.2,-3.6,2.5,1.4)}{const t=textTexture([{text:'B O O G I E  \u2014  H E B E L',font:'600 46px Helvetica, Arial, sans-serif',y:70},{text:'C O N T E M P O R A R Y   A R T',font:'28px Helvetica, Arial, sans-serif',y:140},{text:'B L A C K   A N D   W H I T E',font:'28px Helvetica, Arial, sans-serif',y:185}],900,300,{bg:'#f6f3ee',align:'center'});const m=new THREE.Mesh(new THREE.PlaneGeometry(2.4,.8),new THREE.MeshStandardMaterial({map:t,roughness:.9}));m.rotation.y=Math.PI\/2;m.position.set(.12,1.75,5.6);scene.add(m)}scene.add(new THREE.HemisphereLight(16774374,5914675,.55));const sun=new THREE.DirectionalLight(16769208,1.1);sun.position.set(-10,14,18);scene.add(sun);const fill=new THREE.DirectionalLight(16774892,.35);fill.position.set(20,10,-20);scene.add(fill);const SLOTS={fig:[],abs:[],geo:[],spare:[]};const S=(list,x,y,z,n,mw,mh)=>list.push({x:x,y:y,z:z,n:n,mw:mw,mh:mh});const sy=2.3;S(SLOTS.fig,-1,sy,-3.97,[0,1],1.2,1.7);S(SLOTS.fig,-4.3,sy,-3.97,[0,1],1.55,1.8);S(SLOTS.fig,-7.9,sy,-3.97,[0,1],1.6,1.8);S(SLOTS.fig,-8.97,sy,-1.9,[1,0],2.2,1.9);S(SLOTS.fig,-8.97,sy,1.9,[1,0],2.2,1.9);S(SLOTS.fig,-6.5,sy,3.97,[0,-1],2,1.8);S(SLOTS.fig,-3,sy,3.97,[0,-1],2,1.9);const ly=1.6;S(SLOTS.abs,.13,ly,-5.6,[1,0],2.2,1.7);for(const p of PART_L){for(const s of[-1,1])for(const n of[[0,-1],[0,1]])S(SLOTS.abs,p.x+s*.88*(n[1]>0?1:-1),ly,p.z+n[1]*(PT\/2+.005),n,1.55,1.75)}for(let i=0;i<WIN_X.length-1;i++){const c=(WIN_X[i]+WIN_X[i+1])\/2;for(const s of[-1,1])S(SLOTS.abs,c+s*.95,ly,-6.97,[0,1],1.45,1.75)}for(const p of PART_R){for(const s of[-1,1])for(const n of[[0,-1],[0,1]])S(SLOTS.geo,p.x+s*.88*(n[1]>0?1:-1),ly,p.z+n[1]*(PT\/2+.005),n,1.55,1.75)}for(let i=0;i<WIN_X.length-1;i++){const c=(WIN_X[i]+WIN_X[i+1])\/2;for(const s of[-1,1])S(SLOTS.geo,c+s*.95,ly,6.97,[0,-1],1.45,1.75)}for(const z of[-5.5,-3,3,5.5])S(SLOTS.geo,35.97,ly,z,[-1,0],1.9,1.8);function sortSlots(list,key){return list.sort(key)}sortSlots(SLOTS.fig,()=>0);SLOTS.abs.sort((a,b)=>a.x-b.x||a.z-b.z);SLOTS.geo.sort((a,b)=>(a.x===35.97)-(b.x===35.97)||a.x-b.x||b.z-a.z);const paintings=[];const frameMat=new THREE.MeshStandardMaterial({color:1118481,roughness:.4,metalness:.1});const glowMat=new THREE.MeshBasicMaterial({map:glowTex,transparent:true,opacity:.32,blending:THREE.AdditiveBlending,depthWrite:false,toneMapped:false});function placeholderTexture(label,failed){const c=canvas(256,256),g=c.getContext('2d');g.fillStyle=failed?'#e8e4dd':'#f2efe9';g.fillRect(0,0,256,256);g.fillStyle='#8a8580';g.font='13px Helvetica, Arial';g.textAlign='center';g.fillText(failed?'Bild antippen zum Ansehen':'l\u00e4dt \u2026',128,132);return tex(c)}const loadingTex=placeholderTexture('',false);const failedTex=placeholderTexture('',true);let idx=0;for(const cat of['fig','abs','geo']){WORKS[cat].forEach((w,i)=>{const slot=SLOTS[cat][i];if(!slot)return;const[file,pw,ph,title]=w;const ar=pw\/ph;let h=Math.min(slot.mh,slot.mw\/ar,ar<.6?1.9:1.45);if(ar>=.6&&ar<=1.6)h=Math.min(h,1.25+.15*Math.min(1,pw\/1500));const wd=h*ar;const g=new THREE.Group;orient(g,slot.n);g.position.set(slot.x,slot.y,slot.z);const fd=.04,ft=.03;const back=new THREE.Mesh(new THREE.BoxGeometry(wd+ft*2,h+ft*2,fd),frameMat);back.position.z=fd\/2;g.add(back);const mat=new THREE.MeshStandardMaterial({map:loadingTex,roughness:.75});const pic=new THREE.Mesh(new THREE.PlaneGeometry(wd,h),mat);pic.position.z=fd+.002;g.add(pic);const glow=new THREE.Mesh(new THREE.PlaneGeometry(wd*1.9+.8,h*1.7+.8),glowMat.clone());glow.position.set(0,.12,.004);noRay(glow);g.add(glow);const no=String(i+1).padStart(2,'0');const name=title||'Ohne Titel';const lab=new THREE.Mesh(new THREE.PlaneGeometry(.36,.108),new THREE.MeshStandardMaterial({map:textTexture([{text:name,font:'500 19px Helvetica, Arial',y:30},{text:'Boogie Hebel',font:'16px Helvetica, Arial',y:62}],330,99,{pad:14}),roughness:.9}));lab.position.set(wd\/2+.31,-h\/2+.05,.006);if(wd\/2+.45>slot.mw\/2+.25)lab.position.set(wd\/2-.15,-h\/2-.16,.006);scene.add(g);const P={i:idx++,cat:cat,num:i+1,name:name,url:UP(file),w:wd,h:h,slot:slot,group:g,pic:pic,glow:glow,mat:mat,loaded:false};g.traverse(o=>{o.userData.painting=P});paintings.push(P)})}function grayCanvas(c){const g=c.getContext('2d'),d=g.getImageData(0,0,c.width,c.height),p=d.data;for(let i=0;i<p.length;i+=4){const l=p[i]*.2126+p[i+1]*.7152+p[i+2]*.0722;p[i]=p[i+1]=p[i+2]=l}g.putImageData(d,0,0)}(function desaturate(){const seen=new Set;const gc=col=>{const l=col.r*.2126+col.g*.7152+col.b*.0722;col.setRGB(l,l,l)};const gm=t=>{if(!t||!t.image||!t.image.getContext)return;if(!seen.has(t.image)){seen.add(t.image);grayCanvas(t.image)}t.needsUpdate=true};scene.traverse(o=>{if(o.isLight){gc(o.color);if(o.groundColor)gc(o.groundColor)}if(!o.material)return;[].concat(o.material).forEach(m=>{if(m.userData.keepColor||o.userData.painting&&o===o.userData.painting.pic)return;if(m.color)gc(m.color);if(m.emissive)gc(m.emissive);gm(m.map)})});gc(scene.background)})();const MAX_TEX=renderer.capabilities.maxTextureSize>=4096?1600:1024;function demoArt(P){const c=canvas(512,Math.round(512\/(P.w\/P.h))),g=c.getContext('2d');g.fillStyle='#f7f6f2';g.fillRect(0,0,c.width,c.height);g.strokeStyle='#111';g.lineCap='round';for(let k=0;k<7;k++){g.lineWidth=4+rnd()*26;g.beginPath();g.moveTo(rnd()*c.width,rnd()*c.height);g.bezierCurveTo(rnd()*c.width,rnd()*c.height,rnd()*c.width,rnd()*c.height,rnd()*c.width,rnd()*c.height);g.stroke()}return tex(c)}function loadImage(P){return new Promise(res=>{if(DEMO){P.mat.map=demoArt(P);P.mat.needsUpdate=true;P.loaded=true;return res()}const img=new Image;img.crossOrigin='anonymous';img.decoding='async';img.onload=()=>{const s=Math.min(1,MAX_TEX\/Math.max(img.naturalWidth,img.naturalHeight));const src=canvas(Math.round(img.naturalWidth*s),Math.round(img.naturalHeight*s));src.getContext('2d').drawImage(img,0,0,src.width,src.height);grayCanvas(src);const t=new THREE.Texture(src);t.colorSpace=THREE.SRGBColorSpace;t.anisotropy=Math.min(8,maxAniso);t.needsUpdate=true;P.mat.map=t;P.mat.needsUpdate=true;P.loaded=true;res()};img.onerror=()=>{P.mat.map=failedTex;P.mat.needsUpdate=true;P.failed=true;res()};img.src=P.url})}let loadedCount=0;const progEl=document.querySelector('#bh-prog i');function startLoading(){const queue=paintings.slice().sort((a,b)=>camera.position.distanceToSquared(a.group.position)-camera.position.distanceToSquared(b.group.position));const take=()=>{const P=queue.shift();if(!P)return;loadImage(P).then(()=>{loadedCount++;progEl.style.width=loadedCount\/paintings.length*100+'%';take()})};for(let k=0;k<6;k++)take()}const state={yaw:0,pitch:0,mode:'walk',tween:null,walkTarget:null,focus:null};camera.position.set(2.2,EYE,.9);state.yaw=-Math.PI\/2+.12;state.pitch=-.02;function inRect(x,z,r,x0,x1,z0,z1){return x>x0+r&&x<x1-r&&z>z0+r&&z<z1-r}function walkable(x,z){const r=.28;const ok=inRect(x,z,r,SALON.x0,SALON.x1,SALON.z0,SALON.z1)||inRect(x,z,r,LOFT.x0,LOFT.x1,LOFT.z0,LOFT.z1)||x>-.7&&x<.7&&z>DOOR.z0+r&&z<DOOR.z1-r;if(!ok)return false;for(const o of obstacles)if(x>o[0]-r&&x<o[2]+r&&z>o[1]-r&&z<o[3]+r)return false;return true}function tryMove(dx,dz){const p=camera.position;if(walkable(p.x+dx,p.z+dz)){p.x+=dx;p.z+=dz;return true}if(walkable(p.x+dx,p.z)){p.x+=dx;return true}if(walkable(p.x,p.z+dz)){p.z+=dz;return true}return false}const ease=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)\/2;function angDiff(a,b){let d=(b-a)%(Math.PI*2);if(d>Math.PI)d-=Math.PI*2;if(d<-Math.PI)d+=Math.PI*2;return d}function flyTo(pos,yaw,pitch,dur=1.4,done){const from=camera.position.clone();state.tween={from:from,to:pos.clone(),y0:state.yaw,dy:angDiff(state.yaw,yaw),p0:state.pitch,p1:pitch,t:0,dur:dur,done:done};state.walkTarget=null}function lookAngles(from,to){const d=(new THREE.Vector3).subVectors(to,from);return{yaw:Math.atan2(-d.x,-d.z),pitch:Math.atan2(d.y,Math.hypot(d.x,d.z))}}const infoEl=document.getElementById('bh-info');const tourLbl=document.getElementById('bh-tourLbl');function viewPoint(P){const n=P.slot.n;const dist=Math.max(1.75,Math.max(P.w,P.h*.85)*1.25+.55);const pos=new THREE.Vector3(P.slot.x+n[0]*dist,EYE,P.slot.z+n[1]*dist);const target=new THREE.Vector3(P.slot.x,P.slot.y+(P.slot.y>2?-.05:0),P.slot.z);return{pos:pos,...lookAngles(pos,target)}}function focus(P,dur){if(state.mode==='overview')leaveOverview(false);const v=viewPoint(P);state.focus=P;const d=camera.position.distanceTo(v.pos);flyTo(v.pos,v.yaw,v.pitch,dur||Math.min(2.4,.9+d*.08));showInfo(P);setNav(P.cat)}function showInfo(P){infoEl.classList.add('show');infoEl.querySelector('.cat').textContent=CATS[P.cat].name;infoEl.querySelector('.name').textContent='';infoEl.querySelector('.thumb').src=P.url;document.getElementById('bh-ask').href=CONTACT;tourLbl.textContent=`${P.i+1} \/ ${paintings.length}`}function clearFocus(){if(!state.focus)return;state.focus=null;infoEl.classList.remove('show');tourLbl.textContent='Rundgang'}function step(dir){const cur=state.focus?state.focus.i:dir>0?-1:0;const n=(cur+dir+paintings.length)%paintings.length;focus(paintings[n])}document.getElementById('bh-prev').onclick=()=>step(-1);document.getElementById('bh-next').onclick=()=>step(1);const navBtns=[...document.querySelectorAll('#bh-nav button[data-go]')];function setNav(key){navBtns.forEach(b=>b.classList.toggle('on',b.dataset.go===key))}const ovCenter=new THREE.Vector3(13.5,0,0);let ovYaw=-.55,ovDist=34;function overviewPose(){const el=.95;const pos=new THREE.Vector3(ovCenter.x+Math.sin(ovYaw)*Math.cos(el)*ovDist,Math.sin(el)*ovDist,ovCenter.z+Math.cos(ovYaw)*Math.cos(el)*ovDist);return{pos:pos,...lookAngles(pos,ovCenter)}}function enterOverview(){clearFocus();state.mode='overview';ceilings.forEach(c=>c.visible=false);ceilingExtras.forEach(c=>c.visible=false);const v=overviewPose();flyTo(v.pos,v.yaw,v.pitch,1.6);setNav('overview')}function leaveOverview(fly=true,pos){state.mode='walk';const restore=()=>{ceilings.forEach(c=>c.visible=true);ceilingExtras.forEach(c=>c.visible=true)};if(fly){const p=pos||new THREE.Vector3(2.2,EYE,.9);flyTo(p,state.yaw,-.03,1.6,restore)}else restore();setNav(null)}const ceilingExtras=[];scene.traverse(o=>{if(o.isMesh&&o.position.y>LOFT.H-.45&&!o.userData.wall&&!o.userData.painting)ceilingExtras.push(o)});navBtns.forEach(b=>b.onclick=()=>{const k=b.dataset.go;if(k==='overview'){state.mode==='overview'?leaveOverview(true,camera.position.clone().setY(EYE).clamp(new THREE.Vector3(.6,EYE,-6.4),new THREE.Vector3(35.4,EYE,6.4))):enterOverview();return}const first=paintings.find(p=>p.cat===k);if(first)focus(first)});document.getElementById('bh-fsBtn').onclick=()=>{const d=document;if(!d.fullscreenElement)(root.requestFullscreen||root.webkitRequestFullscreen||(()=>{})).call(root);else(d.exitFullscreen||d.webkitExitFullscreen).call(d)};const lb=document.getElementById('bh-lb'),lbImg=document.getElementById('bh-lbImg');function openLb(P){lb.classList.add('show');lbImg.src=P.url;lbImg.alt=P.name;document.getElementById('bh-lbCat').textContent=CATS[P.cat].name;document.getElementById('bh-lbName').textContent='';document.getElementById('bh-lbAsk').href=CONTACT;lb.dataset.i=P.i}function closeLb(){lb.classList.remove('show')}document.getElementById('bh-openLb').onclick=()=>state.focus&&openLb(state.focus);document.getElementById('bh-lbClose').onclick=closeLb;lb.addEventListener('click',e=>{if(e.target===lb||e.target.classList.contains('wrap'))closeLb()});function lbStep(d){const n=(+lb.dataset.i+d+paintings.length)%paintings.length;openLb(paintings[n]);focus(paintings[n],.01)}document.getElementById('bh-lbPrev').onclick=()=>lbStep(-1);document.getElementById('bh-lbNext').onclick=()=>lbStep(1);const keys={};addEventListener('keydown',e=>{if(!active&&!lb.classList.contains('show')&&!document.fullscreenElement)return;if(lb.classList.contains('show')){if(e.key==='Escape')closeLb();if(e.key==='ArrowRight')lbStep(1);if(e.key==='ArrowLeft')lbStep(-1);return}if(e.key==='Escape'){clearFocus();if(state.mode==='overview')leaveOverview()}if(state.focus&&(e.key==='ArrowRight'||e.key==='ArrowLeft')){step(e.key==='ArrowRight'?1:-1);e.preventDefault();return}if(state.focus&&e.key==='Enter'){openLb(state.focus);return}keys[e.code]=true;if(\/^(Arrow|Key[WASD])\/.test(e.code))e.preventDefault()});addEventListener('keyup',e=>{keys[e.code]=false});addEventListener('blur',()=>{for(const k in keys)keys[k]=false});const ray=new THREE.Raycaster;const ndc=new THREE.Vector2;const pointers=new Map;let drag=null,pinchD=0;const tip=document.getElementById('bh-tip');function pick(cx,cy){const r=renderer.domElement.getBoundingClientRect();ndc.set((cx-r.left)\/r.width*2-1,-((cy-r.top)\/r.height)*2+1);ray.setFromCamera(ndc,camera);const hit=ray.intersectObjects(scene.children,true).find(h=>h.object.visible&&h.object.material!==M.glass);if(!hit)return null;if(hit.object.userData.painting)return{painting:hit.object.userData.painting,point:hit.point};if(hit.object.userData.floor&&hit.face&&hit.face.normal)return{floor:true,point:hit.point};return{other:true,point:hit.point}}const marker=new THREE.Mesh(new THREE.RingGeometry(.18,.24,40),new THREE.MeshBasicMaterial({color:16777215,transparent:true,opacity:.75,depthWrite:false}));marker.rotation.x=-Math.PI\/2;marker.visible=false;noRay(marker);scene.add(marker);stage.addEventListener('pointerdown',e=>{stage.setPointerCapture(e.pointerId);pointers.set(e.pointerId,{x:e.clientX,y:e.clientY});if(pointers.size===1)drag={x:e.clientX,y:e.clientY,sx:e.clientX,sy:e.clientY,moved:0,t:performance.now()};if(pointers.size===2){const[a,b]=[...pointers.values()];pinchD=Math.hypot(a.x-b.x,a.y-b.y);drag=null}});stage.addEventListener('pointermove',e=>{if(pointers.has(e.pointerId))pointers.set(e.pointerId,{x:e.clientX,y:e.clientY});if(pointers.size===2){const[a,b]=[...pointers.values()];const d=Math.hypot(a.x-b.x,a.y-b.y);const delta=(d-pinchD)*.012;pinchD=d;if(state.mode==='overview')ovDist=THREE.MathUtils.clamp(ovDist-delta*6,14,48),state.tween||applyOverview();else{const f=new THREE.Vector3(-Math.sin(state.yaw),0,-Math.cos(state.yaw));tryMove(f.x*delta,f.z*delta);clearFocus()}return}if(drag){const dx=e.clientX-drag.x,dy=e.clientY-drag.y;drag.x=e.clientX;drag.y=e.clientY;drag.moved+=Math.abs(dx)+Math.abs(dy);if(drag.moved>6){stage.classList.add('drag');const k=e.pointerType==='touch'?.006:.0042;if(state.mode==='overview'){ovYaw-=dx*k;state.tween=null;applyOverview()}else{state.tween=null;state.yaw+=dx*k;state.pitch=THREE.MathUtils.clamp(state.pitch+dy*k,-1.2,1.2)}}return}if(e.pointerType==='mouse')hover(e.clientX,e.clientY)});function endPointer(e){pointers.delete(e.pointerId);stage.classList.remove('drag');if(drag&&drag.moved<=6&&performance.now()-drag.t<600)click(e.clientX,e.clientY);if(pointers.size===0)drag=null}stage.addEventListener('pointerup',endPointer);stage.addEventListener('pointercancel',e=>{pointers.delete(e.pointerId);drag=null});stage.addEventListener('wheel',e=>{e.preventDefault();if(state.mode==='overview'){ovDist=THREE.MathUtils.clamp(ovDist+e.deltaY*.02,14,48);state.tween=null;applyOverview();return}const f=new THREE.Vector3(-Math.sin(state.yaw),0,-Math.cos(state.yaw));const s=-Math.sign(e.deltaY)*.35;state.tween=null;clearFocus();tryMove(f.x*s,f.z*s)},{passive:false});function applyOverview(){const v=overviewPose();camera.position.copy(v.pos);state.yaw=v.yaw;state.pitch=v.pitch}let hovered=null;function hover(x,y){const h=pick(x,y);const P=h&&h.painting;if(hovered&&hovered!==P)hovered.glow.material.opacity=.32;hovered=P||null;if(P){P.glow.material.opacity=.55;tip.style.display='none';tip.style.left=x+'px';tip.style.top=y+'px';tip.textContent=P.name}else tip.style.display='none';stage.classList.toggle('hand',!!P||!!(h&&h.floor));marker.visible=!!(h&&h.floor&&state.mode==='walk');if(marker.visible)marker.position.set(h.point.x,.012,h.point.z)}function click(x,y){const h=pick(x,y);if(!h)return;if(h.painting){if(state.focus===h.painting&&!state.tween)openLb(h.painting);else focus(h.painting);return}if(h.floor){const p=h.point;if(state.mode==='overview'){const tgt=nearestWalkable(p.x,p.z);state.yaw=openestYaw(tgt.x,tgt.z,state.yaw);leaveOverview(true,tgt);return}clearFocus();walkTo(p.x,p.z)}}function nearestWalkable(x,z){for(let r=0;r<4;r+=.15)for(let k=0;k<16;k++){const a=k\/16*Math.PI*2,px=x+Math.cos(a)*r,pz=z+Math.sin(a)*r;if(walkable(px,pz))return new THREE.Vector3(px,EYE,pz)}return new THREE.Vector3(2.2,EYE,.9)}function openestYaw(x,z,pref){let best=pref,bestD=-1;for(let k=0;k<24;k++){const yaw=pref+k\/24*Math.PI*2,fx=-Math.sin(yaw),fz=-Math.cos(yaw);let d=0;while(d<14&&walkable(x+fx*d,z+fz*d))d+=.25;if(d>bestD+.5){bestD=d;best=yaw}}return best}function walkTo(x,z){const cur=camera.position;const path=[];const inSalon=v=>v<-.05;if(inSalon(cur.x)!==inSalon(x)){const dz=(DOOR.z0+DOOR.z1)\/2;if(inSalon(cur.x))path.push([-.9,dz],[.9,dz]);else path.push([.9,dz],[-.9,dz])}path.push([x,z]);state.walkTarget=path;state.tween=null}function resize(){const w=stage.clientWidth||innerWidth,h=stage.clientHeight||innerHeight;renderer.setSize(w,h,false);renderer.domElement.style.width=w+'px';renderer.domElement.style.height=h+'px';camera.aspect=w\/h;camera.fov=w\/h<.8?82:68;camera.updateProjectionMatrix()}addEventListener('resize',resize);resize();if(window.ResizeObserver)new ResizeObserver(resize).observe(stage);const clock=new THREE.Clock;let stuck=0;function frame(){const dt=Math.min(clock.getDelta(),.05);if(state.mode==='walk'){let fwd=0,side=0,turn=0;if(keys.KeyW||keys.ArrowUp)fwd+=1;if(keys.KeyS||keys.ArrowDown)fwd-=1;if(keys.KeyA)side-=1;if(keys.KeyD)side+=1;if(keys.ArrowLeft)turn+=1;if(keys.ArrowRight)turn-=1;if(fwd||side||turn){state.tween=null;state.walkTarget=null;clearFocus();state.yaw+=turn*dt*1.8;const sp=(keys.ShiftLeft||keys.ShiftRight?4.2:2.4)*dt;const fx=-Math.sin(state.yaw),fz=-Math.cos(state.yaw);const rx=Math.cos(state.yaw),rz=-Math.sin(state.yaw);tryMove((fx*fwd+rx*side)*sp,(fz*fwd+rz*side)*sp)}}if(state.walkTarget&&!state.tween){const[tx,tz]=state.walkTarget[0];const p=camera.position,dx=tx-p.x,dz=tz-p.z,d=Math.hypot(dx,dz);if(d<.08){state.walkTarget.shift();if(!state.walkTarget.length)state.walkTarget=null;stuck=0}else{const sp=Math.min(d,2.6*dt);const want=Math.atan2(-dx,-dz);state.yaw+=angDiff(state.yaw,want)*Math.min(1,dt*3.2);const bx=p.x,bz=p.z;tryMove(dx\/d*sp,dz\/d*sp);if(Math.hypot(p.x-bx,p.z-bz)<sp*.2){if(++stuck>20){state.walkTarget=null;stuck=0}}else stuck=0}}if(state.tween){const T=state.tween;T.t+=dt\/T.dur;const k=ease(Math.min(1,T.t));camera.position.lerpVectors(T.from,T.to,k);if(state.mode!=='overview'&&T.from.y>6){}state.yaw=T.y0+T.dy*k;state.pitch=T.p0+(T.p1-T.p0)*k;if(T.t>=1){state.tween=null;T.done&&T.done()}}camera.rotation.set(state.pitch,state.yaw,0);marker.material.opacity=.5+Math.sin(performance.now()\/300)*.2;renderer.render(scene,camera);requestAnimationFrame(frame)}requestAnimationFrame(frame);const intro=document.getElementById('bh-intro');startLoading();document.getElementById('bh-enter').onclick=()=>{intro.classList.add('gone');setTimeout(()=>intro.remove(),700)};if(new URLSearchParams(location.search).has('skipintro'))intro.remove();window.__gallery={focus:i=>focus(paintings[i],.01),overview:enterOverview,cam:camera,state:state,paintings:paintings,pose:(x,z,yaw,pitch=0)=>{camera.position.set(x,EYE,z);state.yaw=yaw;state.pitch=pitch;state.tween=null}}})();\n\/\/--><\/script>\n<script><!--\n(function(){var r=document.getElementById('bh3d');if(!r)return;function f(){if(document.fullscreenElement){r.style.marginLeft='';r.style.width='';return}r.style.marginLeft='0px';var p=r.getBoundingClientRect();r.style.marginLeft=(-p.left-window.scrollX)+'px';r.style.width=document.documentElement.clientWidth+'px';r.style.maxWidth='none'}f();addEventListener('resize',f);addEventListener('load',f);document.addEventListener('fullscreenchange',f)})();\n\/\/--><\/script>\n","protected":false},"excerpt":{"rendered":"<p>Virtuelle Ausstellung Salon Abstrakt Geometrisch \u00dcbersicht \u2922 Ziehen&nbsp;= umsehen \u00b7 Klick auf den Boden&nbsp;= hingehenKlick auf ein Bild&nbsp;= ansehen \u00b7 W A S D \/ Pfeiltasten Ansehen Anfrage \u2039 Rundgang \u203a Boogie \u2014 Hebel Contemporary Art \u00b7 Black and White Willkommen in der virtuellen Ausstellung. Gehen Sie frei durch die R\u00e4ume oder folgen Sie dem &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/boogie-hebel.eu\/?page_id=1255\" class=\"more-link\"><span class=\"screen-reader-text\">\u201eVirtuelle Ausstellung\u201c <\/span>weiterlesen<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1255","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/boogie-hebel.eu\/index.php?rest_route=\/wp\/v2\/pages\/1255","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/boogie-hebel.eu\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/boogie-hebel.eu\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/boogie-hebel.eu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/boogie-hebel.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1255"}],"version-history":[{"count":17,"href":"https:\/\/boogie-hebel.eu\/index.php?rest_route=\/wp\/v2\/pages\/1255\/revisions"}],"predecessor-version":[{"id":1274,"href":"https:\/\/boogie-hebel.eu\/index.php?rest_route=\/wp\/v2\/pages\/1255\/revisions\/1274"}],"wp:attachment":[{"href":"https:\/\/boogie-hebel.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}