From cadbb5461178acac20d8e4bfce3703efa7ac0a89 Mon Sep 17 00:00:00 2001 From: teahubxyz Date: Fri, 23 Oct 2026 20:30:34 +0000 Subject: [PATCH] Sphere explorer: full yantra (bhupura square and gates), with an outer toggle --- sphere/index.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sphere/index.html b/sphere/index.html index 2ecd366..e46a17d 100644 --- a/sphere/index.html +++ b/sphere/index.html @@ -55,6 +55,7 @@ input[type=range]{width:100%;accent-color:var(--down)} + @@ -90,7 +91,11 @@ function seg(a,b,n=72){const o=[];for(let i=0;i<=n;i++){const t=i/n;o.push([a[0] const tris=T.map(([lx,by,ay,rx,ty])=>{const A=P(lx,by),B=P(150,ay),Cc=P(rx,by);return{up:!!ty,pts:[...seg(A,B),...seg(B,Cc).slice(1),...seg(Cc,A).slice(1)]}}); const circ=(r,n=256)=>Array.from({length:n+1},(_,i)=>{const a=i/n*Math.PI*2;return[r*Math.cos(a),r*Math.sin(a)]}); function petals(r0,r1,k){const o=[];for(let i=0;ic.push([x*co-y*si,x*si+y*co]))}c.push(c[0]);const o=[];for(let i=0;isetMode('stereo');$('m-gnomo').onclick=()=>setMode('gn $('t-sphere').onclick=e=>{showSphere=!showSphere;e.currentTarget.setAttribute('aria-pressed',showSphere);if(!showSphere&&!showPlane){showPlane=true;$('t-plane').setAttribute('aria-pressed','true')} if(!showSphere){cam.position.set(0,3.6,0.0001);ctl.target.set(0,-1,0);ctl.autoRotate=false;$('t-spin').setAttribute('aria-pressed','false')}else{cam.position.set(2.6,-2.4,3.2);ctl.target.set(0,0,0)} ctl.update();build()}; +$('t-outer').onclick=e=>{showOuter=!showOuter;e.currentTarget.setAttribute('aria-pressed',showOuter);decor=showOuter?[...decorInner,...decorOuter]:[...decorInner];build()}; $('t-inv').onclick=e=>{showInv=!showInv;e.currentTarget.setAttribute('aria-pressed',showInv);build()}; $('t-plane').onclick=e=>{showPlane=!showPlane;e.currentTarget.setAttribute('aria-pressed',showPlane);build()}; $('t-spin').onclick=e=>{ctl.autoRotate=!ctl.autoRotate;e.currentTarget.setAttribute('aria-pressed',ctl.autoRotate)};