const radians=Math.PI/180 export async function createScene({canvas}) { const response=await fetch('/scenes/globe.bin') if(!response.ok)throw new Error('Globe geometry unavailable') const buffer=await response.arrayBuffer(),header=new DataView(buffer) const count=header.getUint32(0,true),offset=4+count*24 const arcs=[] for(let i=0;i=0){ if(previous&&pz>=0)ctx.lineTo(cx+vx*scale,cy-vy*scale) else if(previous){const t=pz/(pz-vz),ix=px+(vx-px)*t,iy=py+(vy-py)*t,n=Math.hypot(ix,iy);ctx.moveTo(cx+ix/n*scale,cy-iy/n*scale);ctx.lineTo(cx+vx*scale,cy-vy*scale)} else ctx.moveTo(cx+vx*scale,cy-vy*scale) }else if(previous&&pz>=0){const t=pz/(pz-vz),ix=px+(vx-px)*t,iy=py+(vy-py)*t,n=Math.hypot(ix,iy);ctx.lineTo(cx+ix/n*scale,cy-iy/n*scale)} px=vx;py=vy;pz=vz;previous=true } } ctx.stroke() ctx.beginPath();ctx.arc(cx,cy,scale,0,Math.PI*2);ctx.lineWidth=1.5;ctx.strokeStyle='rgba(197,208,218,0.8)';ctx.stroke() }, } }