MERRY X-MAS
r2.x, r2.y, r2.z, rotationX); const avgZ = (r1.z + r2.z) / 2; allObjects.push({ z: avgZ, draw: () => { const p1 = project(r1.x, r1.y, r1.z); const p2 = project(r2.x, r2.y, r2.z); ctx.strokeStyle = theme.trunk; ctx.lineWidth = 3; ctx.shadowBlur = 15; ctx.shadowColor = theme.trunkGlow; ctx.beginPath(); ctx.moveTo(p1.x, p1.y); ctx.lineTo(p2.x, p2.y); ctx.stroke(); ctx.shadowBlur = 0; } }); }); // Branches tree.branches.forEach(line => { let r1 = rotateY3D(line.x1, line.y1, line.z1, rotationY); r1 = rotateX3D(r1.x, r1.y, r1.z, rotationX); let r2 = rotateY3D(line.x2, line.y2, line.z2, rotationY); r2 = rotateX3D(