Electron Transitions II
by Chantal Roth
HTML
<body>
<!-- Three.js r124, OrbitControls, dat.GUI -->
<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>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.7.7/dat.gui.min.js"></script>
<style>
html, body { margin:0; height:100%; overflow:hidden; background:#0b0e14; color:#eaeef2;
font: 13px/1.3 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; }
#hud {
position: absolute; left: 12px; top: 10px; z-index: 5; pointer-events: none;
background: rgba(20,24,33,0.7); padding: 10px 12px; border-radius: 8px;
box-shadow: 0 6px 20px rgba(0,0,0,0.25); backdrop-filter: blur(6px);
}
#hud b { color:#fff; }
canvas { display:block; }
</style>
<div id="hud">
<div>
<b>Atomic‑style Lobes</b> — isosurfaces of real \(Y_\ell^m\) with radial
shells
</div>
<div>Drag = rotate • Wheel = zoom • Right/Shift‑drag = pan</div>
<div>
Use <b>Preset</b> to jump to textbook orbitals (1s, 2p<sub>z</sub>,
3d<sub>z²</sub>, …)
</div>
</div>
<script>
// ========= Scene / camera / renderer =========
const scene = new THREE.Scene();
scene.background = new THREE.Color(0x0b0e14);
const camera = new THREE.PerspectiveCamera(45, innerWidth/innerHeight, 0.05, 200);
camera.position.set(0, 1.4, 3.2);
const renderer = new THREE.WebGLRenderer({ antialias:true });
renderer.setPixelRatio(Math.min(devicePixelRatio, 2));
renderer.setSize(innerWidth, innerHeight);
renderer.outputEncoding = THREE.sRGBEncoding;
document.body.appendChild(renderer.domElement);
const controls = new THREE.OrbitControls(camera, renderer.domElement);
controls.enableDamping = true;
// Lights
scene.add(new...