228

Vampire Squid from Hell

Vampyroteuthis infernalis cephalopod anatomy showing the velvety red-black interbrachial web cloak, glowing blue arm tip photophores, and sensory velar filaments.

Playground
60 FPS Canvas 2D
Click + Drag to interact with field
</>

Full Executable Algorithm Code

// 047 - Vampire Squid from Hell (creatures)
// 1:1 Original algorithm engine source
function createVampireSquid() {
  const ARM_COUNT = 8;
  const WEB_LAYERS = 18;
  return {
    setup() {
    },
    render(context, timeState, params) {
      const { ctx, width, height } = context;
      const pulseSpeed = Number(params.swimSpeed || 1);
      const t = timeState.time * pulseSpeed;
      ctx.fillStyle = "#020306";
      ctx.fillRect(0, 0, width, height);
      const cx = width * 0.5;
      const cy = height * 0.46;
      const squidScale = Math.min(width, height) / 480;
      const rotY = Math.sin(t * 0.5) * 0.45;
      const rotX = 0.55 + Math.sin(t * 0.7) * 0.25;
      const rotZ = Math.sin(t * 0.4) * 0.15;
      ctx.save();
      ctx.globalCompositeOperation = "screen";
      const baseHue = (350 + Math.sin(t * 0.6) * 15) % 360;
      for (let layer = 1; layer <= WEB_LAYERS; layer++) {
        const normL = layer / WEB_LAYERS;
        const curR = 120 * normL * squidScale;
        const mantleConeZ = (1 - normL) * (75 * squidScale);
        ctx.beginPath();
        const steps = 64;
        let avgDepth = 0;
        for (let i = 0; i <= steps; i++) {
          const phi = i / steps * Math.PI * 2;
          const armIndex = phi / (Math.PI * 2) * ARM_COUNT;
          const armWave = Math.sin(t * 2.8 + armIndex * 0.8) * (18 * normL * squidScale);
          const rawX = Math.cos(phi) * (curR + armWave);
          const rawY = Math.sin(phi) * (curR * 0.7 + armWave) + 20 * normL * squidScale;
          const rawZ = -mantleConeZ + Math.sin(phi * ARM_COUNT) * (12 * normL * squidScale);
          const p = project3D(rawX, rawY, rawZ, rotX, rotY, rotZ, cx, cy, 450, 520);
          avgDepth += p.depth;
          if (i === 0) ctx.moveTo(p.x, p.y);
          else ctx.lineTo(p.x, p.y);
        }
        avgDepth /= steps + 1;
        const layerHue = (baseHue + normL * 25) % 360;
        const alpha = (0.06 + normL * 0.32) * avgDepth;
        ctx.strokeStyle = hsla(layerHue, 90, 65, alpha);
        ctx.lineWidth = Math.max(0.8, (layer === WEB_LAYERS ? 2 : 0.9) * avgDepth);
        ctx.stroke();
      }
      for (let a = 0; a < ARM_COUNT; a++) {
        const phi = a / ARM_COUNT * Math.PI * 2;
        const armWave = Math.sin(t * 2.8 + a * 0.8) * (18 * squidScale);
        const armR = (120 + armWave) * squidScale;
        const tipX = Math.cos(phi) * armR;
        const tipY = Math.sin(phi) * (armR * 0.7) + 20 * squidScale;
        const tipZ = Math.sin(phi * ARM_COUNT) * (12 * squidScale);
        const pOrigin = project3D(0, -35 * squidScale, -60 * squidScale, rotX, rotY, rotZ, cx, cy, 450, 520);
        const pTip = project3D(tipX, tipY, tipZ, rotX, rotY, rotZ, cx, cy, 450, 520);
        ctx.beginPath();
        ctx.moveTo(pOrigin.x, pOrigin.y);
        ctx.lineTo(pTip.x, pTip.y);
        ctx.strokeStyle = hsla(350, 80, 50, 0.45 * pTip.depth);
        ctx.lineWidth = Math.max(0.8, 1.4 * pTip.depth);
        ctx.stroke();
        const pulse = 1 + 0.35 * Math.sin(t * 4 + a);
        const glowR = 5.5 * pulse * squidScale * pTip.depth;
        ctx.fillStyle = hsla(190, 100, 75, 0.95);
        ctx.shadowColor = "#38bdf8";
        ctx.shadowBlur = 12 * pTip.depth;
        ctx.beginPath();
        ctx.arc(pTip.x, pTip.y, glowR, 0, Math.PI * 2);
        ctx.fill();
        ctx.shadowBlur = 0;
      }
      for (let s = -1; s <= 1; s += 2) {
        ctx.beginPath();
        const filSteps = 30;
        const maxDrop = 190 * squidScale;
        for (let st = 0; st <= filSteps; st++) {
          const nst = st / filSteps;
          const fx = s * (16 * squidScale) + Math.sin(t * 2.2 - nst * 6 + s) * (22 * nst * squidScale);
          const fy = (20 + nst * maxDrop) * squidScale;
          const fz = Math.cos(t * 1.8 + nst * 8 + s) * (35 * nst * squidScale);
          const p = project3D(fx, fy, fz, rotX, rotY, rotZ, cx, cy, 450, 520);
          if (st === 0) ctx.moveTo(p.x, p.y);
          else ctx.lineTo(p.x, p.y);
        }
        ctx.strokeStyle = "rgba(244, 114, 182, 0.65)";
        ctx.lineWidth = 1.2;
        ctx.stroke();
      }
      ctx.restore();
    }
  };
}

// Default parameters from content metadata
const defaultParams = [
  {
    "key": "swimSpeed",
    "label": "Mantle Pulse Velocity",
    "type": "range",
    "min": 0.4,
    "max": 2.2,
    "step": 0.1,
    "defaultValue": 1,
    "description": "Cloaked umbrella contraction rate"
  },
  {
    "key": "cloakInversion",
    "label": "Web Flaring Angle",
    "type": "range",
    "min": 0.2,
    "max": 1.5,
    "step": 0.1,
    "defaultValue": 0.5,
    "description": "Interbrachial webbing spread"
  }
];

if (!window.__art_instances) window.__art_instances = {};
if (!window.__art_instances['vampire-squid']) {
  const inst = typeof createVampireSquid === 'function' ? createVampireSquid() : null;
  if (inst && inst.setup) {
    inst.setup({ ctx, width, height, dpr: 1, aspectRatio: width / height }, defaultParams);
  }
  window.__art_instances['vampire-squid'] = inst;
}

const instance = window.__art_instances['vampire-squid'];
if (instance && instance.render) {
  instance.render(
    { ctx, width, height, dpr: 1, aspectRatio: width / height },
    { time, deltaTime: dt, frameCount: Math.floor(time * 60), fps: 60 },
    defaultParams
  );
}
Edit in Interactive Playground Zero Dependencies • Standalone Canvas 2D
ƒ

Mathematical Formulation

high
Analytical Equation
pweb(a,t)=R(θa+wa(t))[Ra(t)0.7Ra(t)+y0],Iphoto(t)=I0[1+βsin(ωt+a)]\mathbf{p}_{\text{web}}(a, t) = \mathbf{R}(\theta_a + w_a(t)) \begin{bmatrix} R_a(t) \\ 0.7 R_a(t) + y_0 \end{bmatrix}, \quad I_{\text{photo}}(t) = I_0 \left[ 1 + \beta \sin(\omega t + a) \right]
Click to expand
Compact Formula
web_arch = quadCurve(armTip_a, midPt, armTip_next), photophore = circle(tip, 3.5*(1 + 0.3*sin(4t + a)))

Mathematical Tags

#vampire-squid #cephalopod #deep-sea #abyss #creatures #bioluminescence #cloak
Author: Math Art Core Target: 60 FPS

Export & Embed: Vampire Squid from Hell

4K PNG Snapshot

High-resolution single frame render

WebM Video (5s Loop)

60 FPS browser-captured stream

Standalone JS Script

Complete executable Canvas 2D algorithm

HTML Iframe Embed

<iframe src="https://art.fazleyrabbi.xyz/embed/vampire-squid" width="500" height="500" frameborder="0" loading="lazy"></iframe>
ESC
↑↓ Navigate Select
110 Mathematical Artworks
Made by Fazley Rabbi

Support the Project

Keep mathematical creative coding alive & open source

Or via Direct Payoneer ($0 Fee)
Payoneer Customer ID: $0 Fee Direct
24076084

💡 Payoneer app: Go to Pay → Pay to recipient → Enter ID 24076084.

Thank you for supporting generative mathematical animations! ✨