Skip to content

3D k-Stack Viewer

An interactive, mobile-friendly playground for exploring Naglich Squares in 3D. Each layer (k = 1..N) renders an N×N grid where cells are colored by the value of
M[r,c] = ((r·c + (k−1)) mod N) + 1. Layers stack in depth so you can orbit, slice, and spot symmetries at a glance.

Try it now

Spin it, slice it, share it.

  • Live controls: Choose N (default 9), adjust layer gap and cell padding, and set k-stack direction (default Back → Front).

  • Color schemes: Includes Classic Rainbow (default) plus smooth rainbow, viridis, warm/cool, and grayscale.

  • Focus by value: Click to highlight specific numbers (with quick filters: All/None/Odds/Evens/Primes/×3); others auto-dim (default opacity 0.05).

  • Smart persistence: Your selected numbers survive N changes (out-of-range values drop, the rest stay).

  • Share & export: URL-based state for instant sharing, PNG snapshot, and CSV/JSON exports (all layers or a single k).

  • Presets: Save up to 6 named presets with thumbnail previews (localStorage).

  • Optimized 3D: Instanced cubes + OrbitControls keep interaction smooth on desktop and the new mobile bottom-sheet UI.

Naglich Squares — 3D k-Stack (Updated Formula Set)
Legend — values 1..N
— fps— cubes

Renderer failed to start

Hardware acceleration or WebGL may be disabled. Try another browser/device.