Drum Head Harmonics
by Chantal Roth
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>2D Drum Head Harmonics — Rotatable 3D Simulation</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
html, body { margin: 0; height: 100%; background: #0b0f14; color: #eee; }
#container { width: 100%; height: 100%; }
/* Floating info button */
#infoBtn {
position: absolute; top: 12px; right: 12px; z-index: 10;
width: 40px; height: 40px; border-radius: 20px;
border: 1px solid #3a506b; background: rgba(20,25,35,0.85);
color: #a8dadc; cursor: pointer; font-size: 18px; line-height: 40px; text-align: center;
user-select: none; transition: transform 0.1s ease;
}
#infoBtn:hover { transform: scale(1.05); }
/* Info panel */
#infoPanel {
position: absolute; top: 60px; right: 12px; z-index: 10; max-width: 420px;
background: rgba(10,14,20,0.95); border: 1px solid #3a506b; border-radius: 8px;
padding: 14px 16px; display: none; box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
#infoPanel h3 { margin: 0.25em 0 0.6em; font-weight: 600; color: #e9ecef; }
#infoPanel p { margin: 0.5em 0; color: #cfe0f5; line-height: 1.35; }
#infoPanel .fine { color: #9db6d8; font-size: 0.95em; }
#infoPanel code { color: #f1fa8c; }
/* Dat.GUI placement hint (let it float left) */
.dg { z-index: 9 !important; }
</style>
<!-- MathJax for formulas in the Info panel -->
<script id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<!-- Three.js + OrbitControls (r124 for stability) -->
<script src="https://cdn.jsdelivr.net/npm/three@0.124.0/build/three.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.124.0/examples/js/controls/OrbitControls.js"></script>
<!-- dat.GUI -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.7.7/dat.gui.min.js"></script>
<!-- math.js (for Bessel J_l) -->
<script...