惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Blog — PlanetScale
Blog — PlanetScale
小众软件
小众软件
F
Fortinet All Blogs
博客园 - 叶小钗
博客园_首页
D
DataBreaches.Net
Apple Machine Learning Research
Apple Machine Learning Research
U
Unit 42
爱范儿
爱范儿
aimingoo的专栏
aimingoo的专栏
博客园 - Franky
Martin Fowler
Martin Fowler
酷 壳 – CoolShell
酷 壳 – CoolShell
The Cloudflare Blog
A
About on SuperTechFans
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
IT之家
IT之家
M
MIT News - Artificial intelligence
有赞技术团队
有赞技术团队
博客园 - 【当耐特】
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Building a live 3D globe of real time web traffic with Th...
Zenovay · 2026-05-20 · via DEV Community

Zenovay

3D globe of live web traffic

For the new Zenovay landing page I built a 3D globe that shows actual live visits from customer sites in close to real time. Dots glow and fade where visits happen.

For the new Zenovay landing page I built a 3D globe that shows actual live visits from customer sites in close to real time. Dots glow and fade where visits happen.

This post is a complete walkthrough of how it's built, in case you want to do something similar.

What you see vs what it actually is

What the visitor sees: a smooth spinning Earth with bright dots appearing in different countries every few seconds.

What it actually is:

  • A THREE.SphereGeometry with an Earth texture
  • A THREE.Points instance updated in place as events arrive
  • A custom GLSL fragment shader for the glow effect
  • Server Sent Events streaming batched data from Cloudflare Workers
  • Lazy initialization to keep LCP fast

The data flow

Visitor on customer site
  -> Tracking script POSTs event to Cloudflare Worker (sub 100ms)
  -> Worker pushes to Queue
  -> Consumer aggregates per region every 2s
  -> SSE stream pushes to landing page
  -> Three.js animates new dot

Enter fullscreen mode Exit fullscreen mode

The points system (the tricky part)

Points need to appear, glow, and fade. Re creating geometry every event is too expensive. Instead, allocate a fixed buffer and reuse slots.

buildPointsSystem() {
  this.maxPoints = 1000
  this.points = new Float32Array(this.maxPoints * 3)
  this.lifetimes = new Float32Array(this.maxPoints)
  this.cursor = 0

  this.pointsGeometry = new THREE.BufferGeometry()
  this.pointsGeometry.setAttribute('position', 
    new THREE.BufferAttribute(this.points, 3))
  this.pointsGeometry.setAttribute('lifetime', 
    new THREE.BufferAttribute(this.lifetimes, 1))
}

addPoint(lat, lng) {
  const [x, y, z] = latLngToVec3(lat, lng, 5.05)
  const i = this.cursor * 3
  this.points[i] = x
  this.points[i + 1] = y
  this.points[i + 2] = z
  this.lifetimes[this.cursor] = 1.0
  this.cursor = (this.cursor + 1) % this.maxPoints
  this.pointsGeometry.attributes.position.needsUpdate = true
}

Enter fullscreen mode Exit fullscreen mode

The glow shader

// Vertex shader
attribute float lifetime;
varying float vLifetime;

void main() {
  vLifetime = lifetime;
  vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);
  gl_PointSize = 8.0 * lifetime;
  gl_Position = projectionMatrix * mvPosition;
}

// Fragment shader
varying float vLifetime;

void main() {
  vec2 center = gl_PointCoord - vec2(0.5);
  float dist = length(center);
  if (dist > 0.5) discard;

  float intensity = 1.0 - smoothstep(0.0, 0.5, dist);
  vec3 color = mix(vec3(0.3, 1.0, 0.7), vec3(0.5, 1.0, 0.9), vLifetime);
  gl_FragColor = vec4(color, intensity * vLifetime);
}

Enter fullscreen mode Exit fullscreen mode

Coordinates: lat/lng to 3D

function latLngToVec3(lat, lng, radius) {
  const phi = (90 - lat) * (Math.PI / 180)
  const theta = (lng + 180) * (Math.PI / 180)
  return [
    -radius * Math.sin(phi) * Math.cos(theta),
    radius * Math.cos(phi),
    radius * Math.sin(phi) * Math.sin(theta)
  ]
}

Enter fullscreen mode Exit fullscreen mode

Performance notes

  • THREE.Points with BufferGeometry keeps GPU memory stable
  • Fixed size buffer avoids GC pressure
  • Pixel ratio capped at 2 (no point rendering 3x on retina)
  • Lazy initialization: globe loads after main content paint
  • 60fps on iPhone 12, ~45fps on a 5 year old budget Android

See the final result on the landing page: zenovay.com

If you want the full source as a template, drop a comment and I'll open source it.

Valerio