I wired my tree with 500 LED lights and calculated their 3D coordinates.

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ธ.ค. 2020
  • If you support me on Patreon at any point in December 2020 I will film your name on my xmas tree while I give you a thumbs-up of appreciation. / standupmaths
    Huge thanks to Eugénie von Tunzelmann for helping me out with this video. You can see more of Eugénie in my "General Relativity: Top 05 Mishaps [inc INTERSTELLAR]" video. • General Relativity: To...
    Thanks to Ben Sparks for helping out with the GeoGebra file. You can try an online version here: www.geogebra.org/m/p2pdz6v2
    And of course thanks to Howard Carter for yet one more remix of the Stand-up Maths theme song. The main theme is on bandcamp: standupmaths.bandcamp.com/ If there is enough demand we'll make a Christmas album.
    Here is my code on github (along with the 3D coordinates of all 500 LEDs on my tree). If you have a program you would like to see run on my tree, email me matt@standupmaths.com
    github.com/standupmaths/xmast...
    My prototype LEDs were type WS2801 and wired to as Raspberry Pi Zero.
    The WS2801 LEDs I used on Amazon. Other retailers are available.
    www.amazon.co.uk/dp/B01MDJ3VB...
    I set-up the Pi to run 'headless' (no monitor or keyboard) largely using this guide:
    www.tomshardware.com/uk/revie...
    I followed this guide to wire and program the WS2801 LEDs. If you use an off-the-shelf power supply you do not need to worry about the mains wiring (which you should not do unless you are qualified).
    tutorials-raspberrypi.com/how...
    Then I switched the WS2811 LEDs because I could buy 500 of them (they are also cheaper). I also switched to a Raspberry Pi 3 because my Pi Zero didn't have wifi.
    The WS2811 LEDs I used on Amazon. Other retailers are available.
    www.amazon.co.uk/dp/B0775CC55...
    www.amazon.com/ALITOVE-Indivi...
    I wired up the WS2811 LEDs and coded them using this guide.
    learn.adafruit.com/neopixels-...
    CORRECTIONS:
    - None yet. Let me know if you spot anything!
    Thanks again, as always, for Jane Street being my principal sponsor.
    www.janestreet.com/
    Thanks to my Patreon supporters who funded those LEDs. If this video does well, I'll buy even more next year.
    / standupmaths
    Filming and editing by Alex Genn-Bash and Matt Parker
    Music by Howard Carter
    Design by Simon Wright and Adam Robinson
    MATT PARKER: Stand-up Mathematician
    Website: standupmaths.com/
    Maths book: wwwh.umble-pi.com
    Nerdy maths toys: mathsgear.co.uk/
  • บันเทิง

ความคิดเห็น • 1.8K

  • @standupmaths
    @standupmaths  3 ปีที่แล้ว +1434

    Apparently there is an off-the-shelf version of this ("Twinkly" - check out Techmoan's review) but I console myself that it seems to only map the 2D surface of the tree. So at least my effort got me a third dimension! Albeit a low-res one.
    If there is enough interest and support: I'll go bigger next year. So share this video and (if you can, no pressure) support me on Patreon. patreon.com/standupmaths

    • @led_man
      @led_man 3 ปีที่แล้ว +53

      Actually Twinkly can map in 2D or 3D

    • @GilesWendes
      @GilesWendes 3 ปีที่แล้ว +3

      Was gonna say, nice one!

    • @chartle1
      @chartle1 3 ปีที่แล้ว +4

      I came here to just to post this.
      But yes you walk around the tree and it finds them all.

    • @standupmaths
      @standupmaths  3 ปีที่แล้ว +380

      I meant that there are not LEDs inside the Twinkly tree (only on the surface). My LEDs are mapped right to the trunk. LOOK LET ME HAVE THIS.

    • @GilesWendes
      @GilesWendes 3 ปีที่แล้ว +11

      @@standupmaths heroic effect, I loved it

  • @smartereveryday
    @smartereveryday 3 ปีที่แล้ว +2092

    THIS IS INCREDIBLE

    • @fantasticphil3863
      @fantasticphil3863 3 ปีที่แล้ว +20

      Who's this guy?

    • @MasonBeast2000
      @MasonBeast2000 3 ปีที่แล้ว +25

      What I find amazing is that Destin, you and I are watching the same video at just about the same time from miles apart. Idk I find it amazing haha

    • @Pedozzi
      @Pedozzi 3 ปีที่แล้ว +6

      hi destin

    • @ishoottheyscore8970
      @ishoottheyscore8970 3 ปีที่แล้ว +24

      Next year - SmarterEveryDay vs Mark Rober vs some of the other more eccentric TH-camrs in a contest of tree displays...
      Maybe have them released like an Advent Calendar?...

    • @josephcagle
      @josephcagle 3 ปีที่แล้ว +7

      Collab, please

  • @philippr5352
    @philippr5352 3 ปีที่แล้ว +1224

    Man, they surely taught binary trees in my CS program all wrong.

    • @Patrick_Bard
      @Patrick_Bard 3 ปีที่แล้ว +15

      You've made my day man

    • @lucas29476
      @lucas29476 3 ปีที่แล้ว +2

      You have 444 likes so I can't like it

    • @alshbsh2
      @alshbsh2 3 ปีที่แล้ว +1

      nope they actually didn't :)
      this video overcomplicated the problem with all "2d image scanning". You could have easily done it manually :D

    • @giggabiite4417
      @giggabiite4417 ปีที่แล้ว +3

      @@alshbsh2 coughs and sputters. easily???

  • @Beregorn88
    @Beregorn88 3 ปีที่แล้ว +539

    When your only tool is a hammer, every problem looks like a nail, when you are a mathematician, every problem looks like an isomorphism...

    • @erzar.1730
      @erzar.1730 3 ปีที่แล้ว +15

      i thought this was gonna be some motivational stuff.

    • @DustinRodriguez1_0
      @DustinRodriguez1_0 3 ปีที่แล้ว +10

      When you're a Haskell/functional programmer, every problem looks like a monad...

    • @KingBobXVI
      @KingBobXVI 3 ปีที่แล้ว +5

      That's what I thought when he showed how he changed the angle of the plane - shove the _tree_ through a matrix instead of the plane?
      And here until he said that I was thinking how he could have made his code into a program that ran user snippets as if they were shader programs for the tree-pixels (trexles?)...

    • @colinframe9634
      @colinframe9634 3 ปีที่แล้ว +1

      *clap*clap*clap*

    • @dwinsemius
      @dwinsemius 2 ปีที่แล้ว +2

      @@colinframe9634 ITYM **map*map*map**

  • @milkdrinker7
    @milkdrinker7 3 ปีที่แล้ว +461

    "first order approximation of a Christmas tree" had me in stitches

  • @BenK1122
    @BenK1122 3 ปีที่แล้ว +490

    "I wrote some terrible code."
    Who hasn't?

    • @felipevasconcelos6736
      @felipevasconcelos6736 3 ปีที่แล้ว +38

      People who’ve never written code?

    • @Rx7man
      @Rx7man 3 ปีที่แล้ว +17

      I doubt i've ever written good code.. but it still works!!

    • @RichardPolhill
      @RichardPolhill 3 ปีที่แล้ว +29

      All code is terrible.
      Signed: a professional.

    • @TAP7a
      @TAP7a 3 ปีที่แล้ว +19

      The only clean code that anyone will ever write is:
      #include
      int main() {
      std::cout

    • @WeedMIC
      @WeedMIC 3 ปีที่แล้ว +3

      If it works, it is NOT terrible

  • @Elitematt74
    @Elitematt74 3 ปีที่แล้ว +320

    Moral of the story: Get a bunch of smart friends from different disciplines and get them to help you on your wacky projects

    • @officer_baitlyn
      @officer_baitlyn 3 ปีที่แล้ว +47

      smart friends are unsurprisingly effective for solving problems
      i just feel like im cheating when im not smashing my head against the wall until i figure stuff out, but yeah pretty much

    • @Elitematt74
      @Elitematt74 3 ปีที่แล้ว +13

      @@officer_baitlyn lol i agree so much, the satisfaction when figuring out something on ur own is unmatched but trying to do projects like this without those ppl helping seems futile

    • @standupmaths
      @standupmaths  3 ปีที่แล้ว +179

      That is the basis of my career.

    • @youtubewatch3870
      @youtubewatch3870 3 ปีที่แล้ว +7

      More people - more effects based on complexity of the system. Like ants or bees do a great work together, but don't know what exactly to do by their own

    • @vigilantcosmicpenguin8721
      @vigilantcosmicpenguin8721 3 ปีที่แล้ว +6

      My aspiration is to be that smart friend.

  • @mm1979dk
    @mm1979dk 3 ปีที่แล้ว +213

    "ordered the LEDs 3 years ago", "got the controller years ago", "never got the time to get down to it" - story of my life. Glad you got it sorted out.

    • @nandodolleman7819
      @nandodolleman7819 3 ปีที่แล้ว +1

      +1

    • @andrewcrisp8567
      @andrewcrisp8567 3 ปีที่แล้ว +5

      And so often these days it is because of TH-cam videos that distract 😜

  • @BlobVanDam
    @BlobVanDam 3 ปีที่แล้ว +870

    Techmoan just reviewed a product just like this, but it was much more restrictive and app based, and relied on a cloud service for the spacial mapping. This is much more open to possibilities, not to mention more impressive that you did it yourself from scratch!

    • @JohnDlugosz
      @JohnDlugosz 3 ปีที่แล้ว +52

      I came to make the same comment.
      But even the Techmoan product is just a turnkey version of more general stuff. There is a whole community of people using standard addressable lights and controllers, with free software for mapping them and doing displays.

    • @RhysWilliamsEsq
      @RhysWilliamsEsq 3 ปีที่แล้ว +3

      Came to make the same comment.

    • @gordoncousins5544
      @gordoncousins5544 3 ปีที่แล้ว +16

      Was about to comment about that video as well even went as far as to have the video link ready, oh well seems a shame to waste a perfectly good link so here you are,
      th-cam.com/video/DYVMeyGEWes/w-d-xo.html

    • @simonjtaylor212
      @simonjtaylor212 3 ปีที่แล้ว +11

      The Twinkly tree is crazy expensive, compared to what you can get WS2811 LEDs for on AliExpress ... Of course, not as user friendly though!

    • @4everfate
      @4everfate 3 ปีที่แล้ว +4

      Look up ws2811 pixels. and xlights/wled

  • @otakuribo
    @otakuribo 3 ปีที่แล้ว +372

    500 programmable, individually addressable RGB LEDs... so, you could theoretically turn your tree into a low-res display!

    • @standupmaths
      @standupmaths  3 ปีที่แล้ว +435

      I plan to test exactly how theoretical that is.

    • @otakuribo
      @otakuribo 3 ปีที่แล้ว +104

      @@standupmaths How cool would it look to walk around the tree while it's displaying an image: at first it would look like a semi-random scattering of colored lights, until you get to just the right angle out front 🎄

    • @shreddedtwopack6625
      @shreddedtwopack6625 3 ปีที่แล้ว +9

      I'd like to see that!

    • @jacob8565
      @jacob8565 3 ปีที่แล้ว +42

      Pong on a Christmas tree

    • @fantasticphil3863
      @fantasticphil3863 3 ปีที่แล้ว +19

      @@standupmaths I was thinking this, watching the video. You could grab a pi-camera, and have it display live what it sees!

  • @brunnomenxa
    @brunnomenxa 3 ปีที่แล้ว +80

    All youtubers: "there is some noise that may end up in the video."
    Video in reality: **absolute silence**

  • @JannikPitt
    @JannikPitt 3 ปีที่แล้ว +198

    17:18 fun thought: Rotate the tree in real life and have the lights adjust such that they appear stationary lol

    • @toasteduranium
      @toasteduranium ปีที่แล้ว +2

      I’m disappointed he hasn’t done that yet

  • @Project_Kritical
    @Project_Kritical 3 ปีที่แล้ว +85

    2:50 “The pi can put out 3 and a bit volts”
    3.14... pi...
    WELL PLAYED!

    • @rainbowevil
      @rainbowevil 3 ปีที่แล้ว +17

      I think it’s probably 3.3v, but it’s fun to imagine! 😂

  • @HallowedWeasel
    @HallowedWeasel 3 ปีที่แล้ว +354

    7:29 You missed the opportunity to say you needed to find their "tree d coordinates"!

    • @fantasticphil3863
      @fantasticphil3863 3 ปีที่แล้ว +6

      Oooooooooo hahahahahaha

    • @FlyingSavannahs
      @FlyingSavannahs 3 ปีที่แล้ว +11

      Here we go......!
      Don't be a sap and stop needling Matt!

    • @loganstrong5426
      @loganstrong5426 3 ปีที่แล้ว +19

      Right? A video about geomeTREE like this needs some good puns. I also think he maybe should've used ROOTS in the equations, but those might be more ORNAMENTal than really necessary.

    • @FlyingSavannahs
      @FlyingSavannahs 3 ปีที่แล้ว +4

      I thought the way Matt conifermed which were the missing bulbs was brilliant.

    • @JaccovanSchaik
      @JaccovanSchaik 3 ปีที่แล้ว +11

      I was waiting for a "binary tree" quip.

  • @mirpcatalan1578
    @mirpcatalan1578 3 ปีที่แล้ว +203

    I want Conway's game of life in 3D on a christmas tree.

    • @erylkenner8045
      @erylkenner8045 3 ปีที่แล้ว +5

      YESSS!

    • @AndersKvistDK
      @AndersKvistDK 3 ปีที่แล้ว +2

      He needs to do this!

    • @YesIKnowSillyName
      @YesIKnowSillyName 3 ปีที่แล้ว +2

      Yes, he could program any 3D cellular automata on the raspberry pi, would be awesome!

    • @LeStove
      @LeStove 3 ปีที่แล้ว +1

      Please have a go at this! There was a 3D game of life problem on day 17 of the coding challenge "Advent of Code 2020".

    • @jenius00
      @jenius00 3 ปีที่แล้ว +4

      I think the lattice would be difficult to map to the lights and difficult to interpret visually, but I could see how you could see "waves" of activity in the light emerge, flow and disappear before eventually settling to a vaguely oscillating but ultimately static display.

  • @davidbumpus3457
    @davidbumpus3457 3 ปีที่แล้ว +12

    I love the fact that you mentioned that the LED's are numbered 0 through 499 and your top three tips were 0, 1, 2. It is nice to see someone how actually knows how to count!

  • @britboy3456
    @britboy3456 3 ปีที่แล้ว +71

    Ok but seriously that snow/raindrop effect is gorgeous and completely unique to your 3D lights

    • @MoreEffinCowbell
      @MoreEffinCowbell 3 ปีที่แล้ว

      gorgeous, yes. Completely unique, not exactly. It might be unique to a small homemade Christmas tree installation of 3D mapped LEDs but definitely not unique to 3D LED mapping in general.
      Search TH-cam for CUBATRON .
      I've seen the exact effect you mentioned in person back in 2012 on the cylindrical shaped CUBATRON at the Burning Man art festival in Black Rock City, Nevada, USA.

  • @KaiCyreus
    @KaiCyreus 3 ปีที่แล้ว +103

    I like how Eugénie put in the work to model a Christmas tree to block out the lights on the back, I would've just stuffed a solid cone inside the lights' area

    • @ApothecaryTerry
      @ApothecaryTerry 3 ปีที่แล้ว +14

      That was my 1st thought, but because the lights are at varying distances from the trunk it means the cone would either be too small and not obscure enough, or it would obscure those on the front too (or most likely both). You could go really simple and just shove a triangle in on Z = 0 that literally just blocks out everything nearer the back, would mostly work...but at this point I'm looking for the laziest solution to something that I'm too lazy to try and do in the first place ☺

    • @Krekkertje
      @Krekkertje 3 ปีที่แล้ว +7

      @@ApothecaryTerry how about a semi transparent cone

    • @anch95
      @anch95 3 ปีที่แล้ว +1

      Wha.. I just saw you in the comments of a speculatively unrelated channel(Zame), 2 minutes ago.

    • @KaiCyreus
      @KaiCyreus 3 ปีที่แล้ว

      @@anch95 Well hi! Fancy seeing me here.. or something like that

  • @DeSinc
    @DeSinc 3 ปีที่แล้ว +368

    I can imagine everyone having something like this in 5-10 years, maybe even trees that come with lights pre-set that you only have to put the baubles on, which is the most fun and traditional part of the whole process anyway. your result looks way better than I thought it would, too. your coordinates were obviously pretty accurate. I would have liked to see you rotate a 3d model around using the lights, but I suspect the resolution would be too low to make out complex shapes anyway.

    • @danielplusben
      @danielplusben 3 ปีที่แล้ว +10

      It's called Twinkly. It basically does this in 2D.

    • @R3d_8
      @R3d_8 3 ปีที่แล้ว +6

      @@danielplusben there is also 3d mapping

    • @MrJakson112
      @MrJakson112 3 ปีที่แล้ว +2

      So you want to grow them with lights on?

    • @TheFeldhamster
      @TheFeldhamster 3 ปีที่แล้ว +5

      Hm, you could have something like this commercial by next Christmas from the technology side. The scanning could be done by phone. The lights could be connected to a Raspberry pi zero W that could either talk directly to your phone or hook up to your home WLAN. All that's missing is basically that app on the phone and probably ironing out some quirks. Should be possible to hack something like that together in a couple of months.

    • @ragnkja
      @ragnkja 3 ปีที่แล้ว +2

      Artificial Christmas trees already come with lights already attached, so there’s not much left before we’re there.

  • @ceruchi2084
    @ceruchi2084 3 ปีที่แล้ว +89

    My favorite part was when he commanded the lights to identify themselves in binary.
    Matt: LITTLE ONE, STATE THY NAME.
    Little one (sheepishly): 0001000101

  • @Werdna12345
    @Werdna12345 3 ปีที่แล้ว +356

    Christmas nerd-ery I didn’t even know I wanted

    • @oldmech619
      @oldmech619 3 ปีที่แล้ว

      Plz upgrade my iPad. I need this.

    • @eugenecbell
      @eugenecbell 3 ปีที่แล้ว

      @@oldmech619, did Santa bring you an old one?

    • @oldmech619
      @oldmech619 3 ปีที่แล้ว

      @@eugenecbell No, no iPad LEDIC controller program launches. Oh so so sad

    • @eugenecbell
      @eugenecbell 3 ปีที่แล้ว

      @@oldmech619, lol

    • @vigilantcosmicpenguin8721
      @vigilantcosmicpenguin8721 3 ปีที่แล้ว

      It's somehow the perfect way to show the Christmas spirit.

  • @vicr123
    @vicr123 3 ปีที่แล้ว +205

    "If there's enough demand, we'll make a Christmas album"
    Demand!

  • @smu4242
    @smu4242 3 ปีที่แล้ว +39

    Most People: "Merry Christmas!"
    Matt Parker: "I wired my tree with 500 LED lights and calculated their 3D coordinates."
    :D Love it!

  • @benbencom
    @benbencom 3 ปีที่แล้ว +32

    "Bundle adjustment" is the name of the algorithm you want for localizing Christmas lights from photos. The ceres-solver library is a good place to start.

  • @johnchessant3012
    @johnchessant3012 3 ปีที่แล้ว +255

    The trick of getting each wrong LED to blink out its number in binary was really clever!

    • @peevester9987
      @peevester9987 3 ปีที่แล้ว +43

      I was thinking you could also do a binary search - light up half the lights, and press a 1 if your light is on, and 0 if it's off, and then subdivide until one light is left. 9 Button presses would identify any light on the tree. It might be easier than trying to pick out the binary sequence your single light is blinking out among the chaos of the whole tree.

    • @JBLewis
      @JBLewis 3 ปีที่แล้ว +14

      When Matt explained that I thought he meant he turned on every light with 0000001 in its ID, and then every light with 00000010, then 00000100, etc. But maybe I misunderstood.

    • @gorgeous2135
      @gorgeous2135 3 ปีที่แล้ว +5

      @@JBLewis I understood it that way too

    • @randymelton1601
      @randymelton1601 3 ปีที่แล้ว +13

      @@peevester9987 This is essentially what he did. The first bit selected even/odd, then next bit selected the even/odd half of the first selection. Yes maybe the binary search could eliminate half the leds each "trial" assuming you answer the "is it on or off now" after each trial. (2 steps/bit) but in the end I suspect his mapping was the most efficient. I considered all of this then bought the twinkly strings. The family likes it. good job Matt.

    • @cholten99
      @cholten99 3 ปีที่แล้ว +1

      @@peevester9987 Heh - that was exactly my immediate thought!

  • @johnchessant3012
    @johnchessant3012 3 ปีที่แล้ว +115

    I don't think I could trust myself to not accidentally knock over the tree after spending hours mapping the coordinates

    • @ApothecaryTerry
      @ApothecaryTerry 3 ปีที่แล้ว +8

      This would not combine well with pets or children...

    • @edwardlane1255
      @edwardlane1255 3 ปีที่แล้ว +2

      just put them back in the right spot ;)

    • @ApothecaryTerry
      @ApothecaryTerry 3 ปีที่แล้ว +2

      @@edwardlane1255 I can actually imagine some people trying to do that! The tree equivalent of buying a replacement hamster for kids ☺ They'll never notice...

  • @cynthiaverjovskymarcotte1379
    @cynthiaverjovskymarcotte1379 3 ปีที่แล้ว +62

    Hi Matt, not sure if you will see this, but I wanted to tell you that I just received the "Get Well Soon" video you made thanks to my friend Zack's request and I want to thank you from the bottom of my heart. Thank you so much. It means the world to me. I am recovering and back to virtual teaching middle school math.

  • @smerk85
    @smerk85 3 ปีที่แล้ว +11

    I don’t think I saw this in the other comments, but I had half an idea on speeding up the mapping using a bit of physical geometry.
    Presumably the lights on the strands have a uniform and finite length to the wires connecting them. Also, as you mentioned, the light address numbers are sequential along the strand. So if you don’t get a good reading from one address but know the coordinates for the one next to it, you at least have a maximum distance that the missing light can be away from the know coordinate. You can use the radius/sphere to create a “rough” cluster of coordinates that you can use to test /identify the position of the unknown.
    Since a good chunk of the sphere extending from the known light to the unknown light should be visible from the previous position, since the known light was visible, you can further narrow down positions.
    Also, you are only mapping 1 light per photo for coordinates. I suspect you could at least light up 3 points at once, if you command one lamp to pure red, one to pure blue, and the third to pure green, and mapped the brightest color value of each color as its own point, assuming it isn’t too bright to mess up the tracking. Should reduce your scan time to a third of what it currently is. Of course your comment on the twinkly brand lights does merit some discussion in that they seem to fairly rapidly map the tree using a video of the lights flashing colors similar to what I describe, so this seems to be a good avenue to explore.
    Also, photogrammetry may be an area to investigate as well. Maybe if you can take a few dozen very rapid sequential photos with the lights strobing synced to the camera, and then simply move the camera a few inches rather than spinning the tree, the small angular change would be enough to work out half the tree at once, and then you simply have to scan each side twice. The matrix math used to render a rotating 3D model plays into this, but in the opposite way to how you were doing it in your video to generate your effects.

    • @qwertyTRiG
      @qwertyTRiG 2 ปีที่แล้ว

      He's used at least one of these ideas in this year's tree. 🌲

  • @tubanbodyslammer9125
    @tubanbodyslammer9125 3 ปีที่แล้ว +174

    You're a pretty good engineer for a mathematician

    • @DrKjoergoe
      @DrKjoergoe 3 ปีที่แล้ว +9

      I‘m imagining Gimli saying this to Legolas after the battle of Helms Deep

  • @itwasinthispositionerinoag7414
    @itwasinthispositionerinoag7414 3 ปีที่แล้ว +198

    Gonna try this on some Christmas trees
    Started on tree 1
    Won't stop until TREE(3)

    • @yndihalda
      @yndihalda 3 ปีที่แล้ว +9

      Ayyyy captures captures!

    • @toniokettner4821
      @toniokettner4821 3 ปีที่แล้ว +2

      i stopped at TREE(0)

    • @oliverdowning1543
      @oliverdowning1543 3 ปีที่แล้ว +4

      @@toniokettner4821 like a normal person. Start at the first one and stop at the first one. Why you would start at tree(1) I have no idea and most people don't do 3 either.

    • @SpencerTwiddy
      @SpencerTwiddy 3 ปีที่แล้ว +2

      @@oliverdowning1543 he didn’t start on TREE(1), he started on tree 1 like a sensible person (assuming he’s using 1-indexed ordinals)

    • @oliverdowning1543
      @oliverdowning1543 3 ปีที่แล้ว +1

      @@SpencerTwiddy it was a joke. A very merry one but it was meant as a joke. Sorry if that wasn't clear

  • @dracuul78
    @dracuul78 3 ปีที่แล้ว +3

    Wow, this is brilliant, mind-blowing, I especially love the image-based position detection. A technical hurdle to take first, but then you can unleash your creativity in the patterns.

  • @JayMaverick
    @JayMaverick 3 ปีที่แล้ว +15

    Such a simple, elegant way to map the coordinates. Love it.

    • @protocol2746
      @protocol2746 ปีที่แล้ว

      Once you start thinking about it and how the maths works it stops looking so simple. I’m running thought experiments in my head as to how spinning the tree 90 degrees then using the same frames of reference will allow 3D pinpointing. He must know the exact distance between the camera and the tree’s axis, and then I’m stuck on how rotating the reference frame of the tree can improve 3D estimation. I’m so close to the answer, but rather annoyed with myself - I work with 6D pose estimation software daily - this should be easy to think about! Impressive!

  • @TheHookUp
    @TheHookUp 3 ปีที่แล้ว +459

    One of my favorite TH-camrs branching into my realm! WS2811s rock!

    • @simonjtaylor212
      @simonjtaylor212 3 ปีที่แล้ว +6

      Exactly this! My worlds just collided!

    • @4everfate
      @4everfate 3 ปีที่แล้ว +5

      A wild Rob has appeared!

    • @standupmaths
      @standupmaths  3 ปีที่แล้ว +61

      Thanks! I really should do more smart-home stuff.

    • @youtubewatch3870
      @youtubewatch3870 3 ปีที่แล้ว +10

      @@standupmaths you can stream real-time video on your leds laying in chaotic order.
      Create a pixel map from leds, take contours from image, send pixels for making a frame
      Drawing with drones in the night sky (already exists)

    • @groowy
      @groowy 3 ปีที่แล้ว +3

      I'm more into WS2812Bs ;)

  • @PhotonBeast
    @PhotonBeast 3 ปีที่แล้ว +52

    Next year, Matt's tree gets a higher resolution and the video ends by showing his face in the tree.

    • @01eocoe10
      @01eocoe10 3 ปีที่แล้ว +7

      It should read in the excel spreadsheet he does in his standup

    • @cholten99
      @cholten99 3 ปีที่แล้ว +2

      Given the colour gradients I was wondering if low-res pics was where this was going to end. Alternatively, I wonder about reading in shape files for 3D printing (very simple obviously) and rotating those.

  • @qzbnyv
    @qzbnyv 3 ปีที่แล้ว

    I love the extreme effort that goes into a video like this. Thanks Matt and Happy Christmas!

  • @nirbhay_raghav
    @nirbhay_raghav 3 ปีที่แล้ว +1

    I can't say how much intriguing and inspirational this video is. It is clear how much you enjoy solving problems.

  • @Superskull85
    @Superskull85 3 ปีที่แล้ว +201

    "If you send me code I will run it on the tree" - - Is oddly not that weird in 2020.

    • @fantasticphil3863
      @fantasticphil3863 3 ปีที่แล้ว +10

      The future is finally here

    • @tempest_dawn
      @tempest_dawn 3 ปีที่แล้ว +9

      I for one, am very excited to see more IOTree devices in the future.

    • @trueriver1950
      @trueriver1950 3 ปีที่แล้ว +1

      If you hack this code the result will be out of the tree

    • @kalolord
      @kalolord 3 ปีที่แล้ว

      Cyberpunk 2020

  • @SomeSpicyCheese
    @SomeSpicyCheese 3 ปีที่แล้ว +80

    I'm sure someone is already working on it, but if someone could make a Beat Saber map of the christmas dubstep standupmaths theme, that'd be the bee's knees

  • @vonmiekka
    @vonmiekka 3 ปีที่แล้ว +7

    The unnecessarity of this is beyond comprehension. I love it!

  • @yngndrw.
    @yngndrw. 3 ปีที่แล้ว +9

    The binary debugging method that you used can also be used to speed up your initial scanning. You need 9 bits for 500 LEDs, so if you take 10 pictures - One with them all on and then one for each bit, you then have the over-all positions of every LED and each bit in sequence. You can further speed this up by using different colours to scan multiple bits at once. This is a similar mechanism to how the Oculus Rift calculates it position with IR cameras and IR LEDs.
    I'm going to have to try this myself now, thanks for giving me yet another project!

  • @laurieinjapan
    @laurieinjapan 3 ปีที่แล้ว +54

    "Choose which bits you want to do yourself" is great advice! Lovely to see a wonderful fun project! Happy Christmas!

    • @RoelThijs
      @RoelThijs 3 ปีที่แล้ว +3

      I choose the bit where I tell somebody else to do it.

    • @InezAllen
      @InezAllen 3 ปีที่แล้ว +1

      seriously! I've had an idea for a project I've been bashing my head against for years, and finally earlier this month i decided to handwave a step that i just don't find enjoyable and it's made it so much easier to get the rest done. made more progress in two weeks than the past three years

  • @Whitsoxrule1
    @Whitsoxrule1 3 ปีที่แล้ว +12

    The differences between the Queen's English and our American English never fail to surprise me. Here in the states I learned it as y=mx+b not y=mx+c
    Side note, we need a cool moniker for American English. "The President's English" just doesn't have the same style as The Queen's

    • @MangOnang611
      @MangOnang611 3 ปีที่แล้ว

      I thought POTUS is also called Commander-in-Chief? So maybe Commander's English? I'm not a US citizen tho so correct me if I'm wrong

    • @GustavoLovato
      @GustavoLovato 3 ปีที่แล้ว

      Especially given the quality of the English spoken by two of the last three American Presidents.

    • @schenkov
      @schenkov 3 ปีที่แล้ว

      I am german it's y=mx+b here asswell, so it's definitely not an American thing. I although don't think it's a British thing but rather a Matt Parker thing, could be wrong about that.

    • @ApothecaryTerry
      @ApothecaryTerry 3 ปีที่แล้ว

      Here in the UK we call Queen's English "English" and American English "wrong" ☺
      ...sorry it's just too easy!
      Edit: P.S. Merry Christmas, since it's past midnight here.

  • @iowyyn
    @iowyyn 3 ปีที่แล้ว

    Ok, that was an amazing feat and amazing video.
    So worth the time and it'll be so much easier to get it up and running for any other projects in the future too, amazing work!

  • @ConnorHay
    @ConnorHay 3 ปีที่แล้ว

    This is absolutely amazing. Video just kept getting better and better all the way to the end.

  • @nobodyknows3180
    @nobodyknows3180 3 ปีที่แล้ว +22

    Dude! That's awesome! 500 LEDs AND their 3-D coordinates???? At my age I just light 3 candles and I'm damned lucky if I can even find the matches.

    • @1224chrisng
      @1224chrisng 3 ปีที่แล้ว

      next to the tree? do you have insurance?

    • @nobodyknows3180
      @nobodyknows3180 3 ปีที่แล้ว +1

      @@1224chrisng lol! no, in my later years I no longer really decorate for Christmas, so no tree to worry about.

  • @Aesculathehyena
    @Aesculathehyena 3 ปีที่แล้ว +113

    I love how Matt just casually 0-indexes his lists. No big deal, just how he does it.

    • @ragnkja
      @ragnkja 3 ปีที่แล้ว +33

      And “it’s just how he does it” is a very good reason, because the worst thing you could do is switch between 1-indexing and 0-indexing at random between projects.

    • @Hammondfreak
      @Hammondfreak 3 ปีที่แล้ว +13

      If zero is good enough for railway platform numbering it should be good enough for Matt. However, it means nothing to me!

    • @jackbenson5314
      @jackbenson5314 3 ปีที่แล้ว +4

      I mean, it's what your supposed to do.

  • @TheTrueRandomness
    @TheTrueRandomness 3 ปีที่แล้ว +2

    Ok, this Standup Maths theme album needs to become a real thing now! These have been getting unreal, and this is no exception! Merry remiXmas!

  • @rmfeld
    @rmfeld 3 ปีที่แล้ว +1

    Simply the best xmas video so far! Merry xmas to you, Matt!

  • @NealMiskinMusic
    @NealMiskinMusic 3 ปีที่แล้ว +20

    The first stage was pretty similar to a flash test of a theatrical lighting rig. Fire up each address sequentially, note which fixture turns on, then tell the console what channel you want to use that address for. This makes it much more portable, someone can design pretty much a whole show offline and just bring the console file and a patch list. They can make their design with arbitrary channel assignments, and when they get to the theatre they can simply patch their channels to the addresses of the fixtures as they are hung.
    So if you make an effect using channel 1 for the top most light, then increment channels in a clockwise spiral with channel 500 at the very bottom you can code effects pretty easily, and then any time you want to run that effect on any system, if you re-hang the lights or next year plug them in in a different order or whatever. You just use the flash test to figure out where each light is then you just configure your channels to the appropriate addresses and any effect should work just fine even with the lights plugged in in an arbitrary manner.
    Also you might want to look into the EOS software for theatrical lighting, it might simplify some of your operations, as these LEDs are... probably using DMX, or something that DMX signals could probably be converted into by a r-Pi with relative ease.

    • @RealLordOrange
      @RealLordOrange 3 ปีที่แล้ว +1

      I was going to suggest the Chamsys software, has a built in media server and pixel mapping and a couple of universes of dmx for free.

    • @brandoncorn2420
      @brandoncorn2420 3 ปีที่แล้ว

      There is free open source software that can accomplish this in 2D space. I actually do something similar, and while I don’t map the tree to a custom model I use a raspberry pi and Falcon Pi Player software to run the outputs to my LEDs. I then sequence my lights to an approximate spiral tree model in xLights. It makes sequencing and timing to music easy and it supports lot of controllers and outputs.
      xLights does use a program that can map a model in a 2D plane so the extra dimension here is impressive, but you can get cool effect if you do it right with xLights.

  • @-P-Z-
    @-P-Z- 3 ปีที่แล้ว +11

    I'll risk a hypothesis it is absolutely the best video I watched in 2020. simply spectacular.

  • @SELoggOff
    @SELoggOff 3 ปีที่แล้ว +79

    So, you scanned it in "TREE-D"?
    ..... I'll show myself out..... :/

    • @feifizheng9986
      @feifizheng9986 3 ปีที่แล้ว +3

      This is gold

    • @the.seagull.35
      @the.seagull.35 3 ปีที่แล้ว +3

      Why did I have to scroll down so far to see this comment

    • @SELoggOff
      @SELoggOff 3 ปีที่แล้ว +2

      @@the.seagull.35 because youtube is like high school and it knows that I'm not popular. lol

  • @jcespinoza
    @jcespinoza 3 ปีที่แล้ว

    I'm amazed! Thanks for the inspiration you just gave me, Matt!

  • @Mothuzad
    @Mothuzad 3 ปีที่แล้ว +98

    10:50 Importing inside a function call?! Academic folks can be rather peculiar.

    • @jt....
      @jt.... 3 ปีที่แล้ว +16

      It's sometimes used for optional dependencies, in this case it doesn't make much sense though

    • @andrewjvaughan
      @andrewjvaughan 3 ปีที่แล้ว +17

      Based on the Houdini code - they called that function exactly once. Basically a backwards way of defining a constructor... not great practice, but won’t hurt efficiency. Don’t take notes, kids.

    • @Puukiuuki
      @Puukiuuki 3 ปีที่แล้ว +5

      In some cases in Python it does make sense. For example some optional function that needs some heavy import, that would not make sense to load always. But in this case i cannot see any reason for that.

    • @oliverdowning1543
      @oliverdowning1543 3 ปีที่แล้ว

      A lot of the things inside the function can be moved outside just fine. It is nice to have it all bunched together though. In reality the function call is unnecessary in and of itself given it is the main body of the code. It's really just there as a stylistic thing so putting the imports in there too is fine. Though I will admit I haven't seen it done before.

    • @stribika0
      @stribika0 3 ปีที่แล้ว +1

      @@iykury It works. You can even catch the import error and import something else instead. You'll know it when you need it, this is not something you generally want to do.

  • @MushookieMan
    @MushookieMan 3 ปีที่แล้ว +7

    Finding the address of the light with binary was so clever. I love when something in real life has a nice solution that feels like the solution to a math puzzle.

  • @isidoreaerys8745
    @isidoreaerys8745 3 ปีที่แล้ว

    When I watched your Christmas tree video on the other channel this was the immediate question I had immediately. Thankyou for addressing it.
    And this is EXACTLY how I imagined one would have to go about it
    I am amazed and inspired to familiarize myself with computer science.

  • @azhakabad4229
    @azhakabad4229 3 ปีที่แล้ว +1

    Sir, I loved the most exciting part of flashback! Well done.

  • @wealthyroseblossom
    @wealthyroseblossom 3 ปีที่แล้ว +11

    This was so awesome that I was only slightly disappointed that it didn't result in a conic sections lesson on Matt's Christmas tree.

    • @AlRoderick
      @AlRoderick 3 ปีที่แล้ว +10

      Coniferic sections.

  • @kalpanarms9597
    @kalpanarms9597 3 ปีที่แล้ว +10

    That intro tho! Wow...just wow.
    The standard of the videos are clearly getting better and better! Love it.

  • @ThePandaKingFTW
    @ThePandaKingFTW 3 ปีที่แล้ว

    What an amazing project! And a really cool gift to patreon supporters! Really unique and personal

  • @santiagoruiz7490
    @santiagoruiz7490 3 ปีที่แล้ว

    This is the reason I subscribed to this channel all those years ago. Love his commitment to maths in day to day stuff

  • @ja9892
    @ja9892 3 ปีที่แล้ว +10

    That's some good geometree!

  • @TylerJaneBronson
    @TylerJaneBronson 3 ปีที่แล้ว +5

    Matt, you are a treasure. Merry Christmas!

  • @nickhale2900
    @nickhale2900 3 ปีที่แล้ว +1

    Damn they looked great, I've been hesitating about plunging into the world of addressable LED's but 2021 might be my year. Loved what you did with them despite you loosing me with the maths jargon!

  • @covle9180
    @covle9180 3 ปีที่แล้ว

    This is so clever! I was wondering all video long how you'd do this, other than just manual grunt work... I love it!

  • @Graham_Rule
    @Graham_Rule 3 ปีที่แล้ว +10

    I've never bought a christmas tree before. You have now got me seriously tempted. Maybe for next year.

  • @jimmyhsp
    @jimmyhsp 3 ปีที่แล้ว +7

    howard carter does amazing jobs remixing the theme every time haha

  • @kennethrungsted7487
    @kennethrungsted7487 3 ปีที่แล้ว

    I dont understand all of it and how you do it, but so much fun to watch you explaining and seing how much passion and satisfaction you you have for it

  • @therealcaldini
    @therealcaldini 3 ปีที่แล้ว

    Merry Christmas Matt. This truly is the wonder of Christmas. Wishing you a prosperous 2021.

  • @skyclaw
    @skyclaw 3 ปีที่แล้ว +3

    I’ve always thought your theme tune is absolutely bangin.

  • @richardmilward7478
    @richardmilward7478 3 ปีที่แล้ว +19

    I'm waiting for the "tree on fire" effect to show up...

  • @joost_schiphorst
    @joost_schiphorst 3 ปีที่แล้ว

    This is soo cool! It is really amazing, don't understand everything at all but this is crazy! Great job, love it

  • @KingZarathus
    @KingZarathus 3 ปีที่แล้ว +1

    Loved this! I used the same rotational matrices to create a 3d graph program on my TI calculator for a Linear Algebra project in the late 90's

  • @liveabovethecrowd
    @liveabovethecrowd 3 ปีที่แล้ว +4

    Had this exact idea this year for decorating a house. I'm very excited to see it executed!!

    • @standupmaths
      @standupmaths  3 ปีที่แล้ว +5

      Definitely worth doing it! Give me a shout if you get stuck.

    • @BenK1122
      @BenK1122 3 ปีที่แล้ว

      That's a lot of lights

  • @JNCressey
    @JNCressey 3 ปีที่แล้ว +5

    17:16 I hear that quaternions are useful for rotations in 3D so you have no worries about the order.

  • @martijn8554
    @martijn8554 3 ปีที่แล้ว

    This is the best video ever, thank you very much!!!

  • @alexandrugheorghe5610
    @alexandrugheorghe5610 3 ปีที่แล้ว

    This is so freaking awesome! How didn't i think of that??? Good job! This reminds me of my experiments from my early adult years. Thanks for reconnecting me with that feeling of experiment and accomplishment. ✌🏻👍🏻😎

  • @vonkpronker
    @vonkpronker 3 ปีที่แล้ว +10

    Yes, there is enough demand for a christmas album

  • @BrianBell4073
    @BrianBell4073 3 ปีที่แล้ว +22

    You totally missed a tree d pun opportunity

    • @hannes1715
      @hannes1715 3 ปีที่แล้ว

      and the christmaths

  • @louis-philip
    @louis-philip 3 ปีที่แล้ว

    This is so amazing, great work!

  • @YoeyYutch
    @YoeyYutch 3 ปีที่แล้ว

    Man, your enthusiasm is so infectious, an enthusiasm super-spreader if you will.

  • @stevemonkey6666
    @stevemonkey6666 3 ปีที่แล้ว +114

    You scanned the Christmas tree in three dimensions? You really missed a chance to scan in a fourth dimension

    • @ashtonhoward5582
      @ashtonhoward5582 3 ปีที่แล้ว +24

      Technically he did. The fourth dimension in this case would be time. He just didn't actually have it log it.

    • @sergey1519
      @sergey1519 3 ปีที่แล้ว

      What would he do in the 4th dimension tho?

    • @Anankin12
      @Anankin12 3 ปีที่แล้ว +4

      @@sergey1519 Well, without the 4th dimension you don't actually have control of the lights. Bc, u no, u can't light up the lights in sequence.if there's no time.to define such sequence

    • @kmn1794
      @kmn1794 3 ปีที่แล้ว

      Every time I realise the number of dimensions I have to add another.

    • @TheAngelsHaveThePhoneBox
      @TheAngelsHaveThePhoneBox 3 ปีที่แล้ว +6

      @@ashtonhoward5582 Each of the R, G, B also sort of add their own dimension so the whole tree is 7D.

  • @LeonardChurch33
    @LeonardChurch33 3 ปีที่แล้ว +28

    This is the most Matt Parker Christmas tree I could imagine. Also there's a company called Twinkly that makes this product and you can set it up from your smartphone. It's not nearly as cool as wiring and coding it yourself though.

    • @evilotto9200
      @evilotto9200 3 ปีที่แล้ว +4

      a more parker christmas tree would have almost, but not quite, have worked as intended
      perhaps a tripped breaker or a small but festive fire hazard

    • @Anankin12
      @Anankin12 3 ปีที่แล้ว +2

      @@evilotto9200 and have it calculate π using the coordinates

  • @DMike92.
    @DMike92. 2 ปีที่แล้ว

    A big bravo for your nice work! Especially the idea for getting coordinates of th leds!

  • @JanKaluzaDev
    @JanKaluzaDev 3 ปีที่แล้ว +1

    This is super cool, and hits my exact level of nerdery. I'm a tech artist in the video game industry, and this math, these techniques, this problem solving, and friggin Houdini, are all super familiar :D Plus I just started learning about electronics stuff this winter, so even better. Thanks for making this, it's really awesome!

  • @amyshaw893
    @amyshaw893 3 ปีที่แล้ว +52

    Someone needs to support on patreon using a name that has all the letters of the alphabet, so they can re-edit the video to make the tree say rude things XD
    EDIT: Yes, I've seen Matt's twitter post. I thought it was funny too

    • @mattsmelser
      @mattsmelser 3 ปีที่แล้ว +8

      Sounds like you need to sign up with the last name of, "The quick brown foxed jumped over the lazy dog"
      With hyphens of course.

    • @hayashi-stl16
      @hayashi-stl16 3 ปีที่แล้ว +4

      @@mattsmelser But then you don't get an S

    • @shedactivist
      @shedactivist 3 ปีที่แล้ว +3

      @@hayashi-stl16 "The quick brown foxed jumped over the lazy dogs"

    • @Rx7man
      @Rx7man 3 ปีที่แล้ว +1

      and a cocknballs program!

    • @amyshaw893
      @amyshaw893 3 ปีที่แล้ว +10

      @@shedactivist "the quick brown fox jumps over the lazy dog"

  • @JoshWright396
    @JoshWright396 3 ปีที่แล้ว +78

    We're just going to gloss over the fact that your kitchen scale need multiple amps at 6v...?

    • @andrewjvaughan
      @andrewjvaughan 3 ปีที่แล้ว +15

      Just because the power supply can deliver multiple amps doesn’t mean the scale draws that much - my guess is they have a generic adapter as the “optional” piece Matt mentioned that they provide for all of their 6V compatible scales. (Edit: 6v not 12v) Especially as it can run off 2xAA batteries: www.scalesworld.co.uk/bench-scales/1770-sf-400d-electronic-compact-scale.html

    • @StefanNoack
      @StefanNoack 3 ปีที่แล้ว +1

      Maybe it has the ability to charge batteries?

    • @ijabbott63
      @ijabbott63 3 ปีที่แล้ว +3

      Those scales are rather precise for kitchen scales. How many recipes call for units of 0.01g or 0.1g? My far cheaper kitchen scales can only manage 1g precision, but they do run for years off a single CR-2032 battery.

    • @JoshWright396
      @JoshWright396 3 ปีที่แล้ว

      @@ijabbott63 0.1g resolution is useful for making coffee (and wouldn't require any extra power, my kitchen scale has that level of resolution and also uses a coin cell)

    • @andrewjvaughan
      @andrewjvaughan 3 ปีที่แล้ว +1

      @@ijabbott63 I use one and it’s AWESOME. Having the ability to do small measurements for precise baking, but not have to pull out a separate scale to measure 5kg of flour, is amazing.

  • @saas1337
    @saas1337 3 ปีที่แล้ว

    Thank you so much for this Matt! It was a really fun reward!

  • @andymcl92
    @andymcl92 3 ปีที่แล้ว

    I can say with absolute honesty, of all the videos you've created this year that I've watch, this one has definitely been the most recent!

  • @chrisklupenger4999
    @chrisklupenger4999 3 ปีที่แล้ว +4

    This is simultaneously the coolest and nerdiest video

  • @adeelsumar3721
    @adeelsumar3721 3 ปีที่แล้ว +3

    this version of your intro song is definitely my favorite

  • @colinframe9634
    @colinframe9634 3 ปีที่แล้ว

    beautifully done, loved this so much

  • @jonathaneberlein5650
    @jonathaneberlein5650 3 ปีที่แล้ว

    your awesome man. keep up this great content

  • @harry.tallbelt6707
    @harry.tallbelt6707 3 ปีที่แล้ว +44

    If you had three of those, you could animate The Tower of Hanoi. Just saying.

    • @sebastianjost
      @sebastianjost 3 ปีที่แล้ว +1

      great idea!
      but who has three cristmas trees?
      maybe you could do something similar with scratch posts for cats.

    • @geekjokes8458
      @geekjokes8458 3 ปีที่แล้ว

      BEST IDEA

  • @TobsterStrudel
    @TobsterStrudel 3 ปีที่แล้ว +16

    I was so confused when he said y = mx + c, I was thinking calculus where C is the constant after anti-differentiation.
    In America, we use y = mx + b, where b is the y-intercept, not c. Interesting

    • @jackdavenport5011
      @jackdavenport5011 3 ปีที่แล้ว +1

      I’m Australian too and I was always taught y = mx + b. Probably depends on the state you got to school in.

    • @geromep5383
      @geromep5383 3 ปีที่แล้ว +2

      I have always used y=kx+b

    • @theblinkingbrownie4654
      @theblinkingbrownie4654 3 ปีที่แล้ว

      Here people use y = mx + c but I learned it through youtube so always used b, I get so many weird looks everytime.

    • @stefanmisch5272
      @stefanmisch5272 3 ปีที่แล้ว

      Heh, I learned "y = mx + n" 😁

    • @TobsterStrudel
      @TobsterStrudel 3 ปีที่แล้ว

      @@stefanmisch5272 what country are you from?

  •  3 ปีที่แล้ว

    Incredibly inspiring video! Thanks!

  • @VinnyBagODoughnuts
    @VinnyBagODoughnuts 3 ปีที่แล้ว

    I admire your zeal! Merry Christmas and Happy Holidays!

  • @tendstofortytwo
    @tendstofortytwo 3 ปีที่แล้ว +4

    The plane bisecting the tree looks like how you generate conic sections!

  • @netsch20
    @netsch20 3 ปีที่แล้ว +6

    As an aerospace engineering student, I got quite excited when I realized you were going to be using some good ol' Euler angles

    • @matthewkaseman7457
      @matthewkaseman7457 3 ปีที่แล้ว +8

      I was much more in the "terrified about order and gimbal lock" camp, with some hope for quaternions.

  • @pmcgee003
    @pmcgee003 3 ปีที่แล้ว

    Beyond awesome. Have a great year.

  • @benjijustice739
    @benjijustice739 3 ปีที่แล้ว

    Your method for mapping was so clever. Great work!!