Lemmy: Bestiverse
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
RSS BotMB to Hacker NewsEnglish · 8 months ago

How we built the Black Friday Cyber Monday 2023 globe

shopify.engineering

external-link
message-square
0
fedilink
2
external-link

How we built the Black Friday Cyber Monday 2023 globe

shopify.engineering

RSS BotMB to Hacker NewsEnglish · 8 months ago
message-square
0
fedilink
How We Built the BFCM 2023 Globe (2024) - Shopify
shopify.engineering
external-link
Every year for Black Friday Cyber Monday (BFCM), we put together a real-time visualization of purchases made through Shopify-powered merchants worldwide. This year we're cooking up something big, and in anticipation we wanted to show you how we built the globe last year. Video of BFCM 2023 Globe Besides going for better visuals, a big focus was performance. We've put together an interactive deep dive into how we built and optimized the 3D visuals using technologies such as Three.js and React-three-fiber. Before we jump in, here's the globe with simulated data that you can play with. Arcs The arcs flying around are the most important component. Each one represents an order being placed in real time, and they travel from the merchant to the buyer's location. These can be defined as a Bézier curve with 4 control points. Each point is a 3-dimensional vector. P0: located at start position P1: located 25% of the way between start and end P2: located 75% of the way between start and end P3: located at end position Arc height can be adjusted by moving control points P1 and P2 away from the surface. To render the arc, we create a mesh that is a strip of triangles moving along the curve. This gives us the ability to control thickness and have better flexibility for stylizing it with shaders. You'll notice however that as you move the mesh around, it disappears from certain angles. We needed a way to make it always face the viewer. The solution was surprisingly simple. The red lines along the curve represent the tangent at those points. Taking the cross product of the tangent with the direction of the camera gives a new vector. This is used in the vertex shader to offset the position so the mesh always faces the viewer. To texture the arcs, the UVs of the mesh are defined with v going from 0 at the start to 1 at the end. So a vertex in the middle of the

Comments

alert-triangle
You must log in or register to comment.

Hacker News

hackernews

Subscribe from Remote Instance

You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !hackernews@lemmy.bestiver.se
lock
Community locked: only moderators can create posts. You can still comment on posts.

Posts from the RSS Feed of HackerNews.

The feed sometimes contains ads and posts that have been removed by the mod team at HN.

Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 438 users / day
  • 1.44K users / week
  • 3.39K users / month
  • 9.03K users / 6 months
  • 2 local subscribers
  • 1.85K subscribers
  • 24.7K Posts
  • 8.84K Comments
  • Modlog
  • mods:
  • patrick
  • RSS Bot
  • BE: 0.19.5
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org