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

Поделиться
HTML-код
  • Опубликовано: 18 ноя 2024

Комментарии • 1,8 тыс.

  • @standupmaths
    @standupmaths  3 года назад +1451

    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 года назад +54

      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 года назад +383

      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 года назад +12

      @@standupmaths heroic effect, I loved it

  • @smartereveryday
    @smartereveryday 3 года назад +2132

    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 RUclipsrs in a contest of tree displays...
      Maybe have them released like an Advent Calendar?...

    • @josephcagle
      @josephcagle 3 года назад +7

      Collab, please

  • @philippr5352
    @philippr5352 3 года назад +1289

    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???

  • @AveragePinwormEnjoyer
    @AveragePinwormEnjoyer 3 года назад +511

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

    • @felipevasconcelos6736
      @felipevasconcelos6736 3 года назад +39

      People who’ve never written code?

    • @Rx7man
      @Rx7man 3 года назад +18

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

    • @RichardPolhill
      @RichardPolhill 3 года назад +30

      All code is terrible.
      Signed: a professional.

    • @TAP7a
      @TAP7a 3 года назад +20

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

    • @WeedMIC
      @WeedMIC 3 года назад +4

      If it works, it is NOT terrible

  • @milkdrinker7
    @milkdrinker7 3 года назад +481

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

  • @BlobVanDam
    @BlobVanDam 3 года назад +877

    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,
      ruclips.net/video/DYVMeyGEWes/видео.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

  • @mm1979dk
    @mm1979dk 3 года назад +222

    "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.

  • @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 RUclips 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.

  • @Elitematt74
    @Elitematt74 3 года назад +343

    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 года назад +49

      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 года назад +14

      @@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 года назад +187

      That is the basis of my career.

    • @youtubewatch3870
      @youtubewatch3870 3 года назад +8

      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.

  • @Beregorn88
    @Beregorn88 3 года назад +563

    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 года назад +16

      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 года назад +6

      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 года назад +2

      *clap*clap*clap*

    • @dwinsemius
      @dwinsemius 2 года назад +3

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

  • @HallowedWeasel
    @HallowedWeasel 3 года назад +356

    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.

  • @JannikPitt
    @JannikPitt 3 года назад +203

    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

    • @phailures
      @phailures 6 дней назад

      I would love to see this… if he ever makes a video like this pls let me know!

  • @KaiCyreus
    @KaiCyreus 3 года назад +104

    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

  • @davidbumpus3457
    @davidbumpus3457 3 года назад +15

    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!

  • @Project_Kritical
    @Project_Kritical 3 года назад +88

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

    • @rainbowevil
      @rainbowevil 3 года назад +18

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

  • @mirpcatalan1578
    @mirpcatalan1578 3 года назад +205

    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.

  • @tubanbodyslammer9125
    @tubanbodyslammer9125 3 года назад +177

    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

  • @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.

  • @otakuribo
    @otakuribo 3 года назад +378

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

    • @standupmaths
      @standupmaths  3 года назад +443

      I plan to test exactly how theoretical that is.

    • @otakuribo
      @otakuribo 3 года назад +105

      @@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 года назад +43

      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 года назад +83

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

  • @johnchessant3012
    @johnchessant3012 3 года назад +116

    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 года назад +64

    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.

  • @johnchessant3012
    @johnchessant3012 3 года назад +257

    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!

  • @ceruchi2084
    @ceruchi2084 3 года назад +93

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

  • @TheHookUp
    @TheHookUp 3 года назад +459

    One of my favorite RUclipsrs 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 ;)

  • @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.

  • @vicr123
    @vicr123 3 года назад +206

    "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!

  • @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!

  • @Werdna12345
    @Werdna12345 3 года назад +358

    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.

  • @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!

  • @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

  • @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. 🌲

  • @PhotonBeast
    @PhotonBeast 3 года назад +53

    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.

  • @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!

  • @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

  • @richardmilward7478
    @richardmilward7478 3 года назад +19

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

  • @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.

  • @nitramreniar
    @nitramreniar 3 года назад +1

    That solution using binary to find the number of the incorrectly placed lights seems like such a classically Matt way of doing it - I love it!

  • @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.

  • @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.

  • @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

  • @SELoggOff
    @SELoggOff 3 года назад +80

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

    • @feifizheng9986
      @feifizheng9986 3 года назад +3

      This is gold

    • @SELoggOff
      @SELoggOff 3 года назад +2

      @Danny Dolan because youtube is like high school and it knows that I'm not popular. lol

  • @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.

  • @JNCressey
    @JNCressey 3 года назад +5

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

  • @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.

  • @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.

  • @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.

  • @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!

  • @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.

  • @TECHN01200
    @TECHN01200 3 года назад +1

    My favourite video thus far as it shows math and computer science having a tangible effect in the real world.

  • @-P-Z-
    @-P-Z- 3 года назад +11

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

  • @valehettlinger7708
    @valehettlinger7708 2 года назад +1

    I saw a commercial implementation of this last week at the Indianapolis Zoo. There was a large tree, about 20-25' tall with thousands of RGB LEDs on it. In addition to colorful patterns, the lights were dense enough to display images such as falling snowflakes and gifts, and it even had an animated deer that would gallop around the perimeter. I immediately thought of this video of yours. I have a goal of some day wiring up my tree similarly. I have the parts, just need the time to do it.

  • @kalpanarms9597
    @kalpanarms9597 3 года назад +10

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

  • @tendstofortytwo
    @tendstofortytwo 3 года назад +4

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

  • @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.

  • @ambientscience2951
    @ambientscience2951 3 года назад +1

    In 2016 I made programmed LEDs on my tree to respond to music and I have been using the same setup for 4 years now it never gets boring.

  • @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.

  • @CaptainSpock1701
    @CaptainSpock1701 3 года назад +1

    Dude, I never thought for one moment you were stupid. In fact I thought of you as more intelligent than most.
    But running the binary sequence to get the light's coordinate... That is next level genius! *Respect!*

  • @jimmyhsp
    @jimmyhsp 3 года назад +7

    howard carter does amazing jobs remixing the theme every time haha

  • @YoeyYutch
    @YoeyYutch 3 года назад

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

  • @vonkpronker
    @vonkpronker 3 года назад +10

    Yes, there is enough demand for a christmas album

  • @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

  • @BrianBell4073
    @BrianBell4073 3 года назад +22

    You totally missed a tree d pun opportunity

  • @sergeant5848
    @sergeant5848 3 года назад

    This brilliant. The programming, the "Christmas tree light" sophistication, the thought process. Love it.
    My lights are 50 years old, yellowy-white and blink on and off every couple of seconds.

  • @liveabovethecrowd
    @liveabovethecrowd 3 года назад +4

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

  • @skyclaw
    @skyclaw 3 года назад +3

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

  • @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

  • @ddognine
    @ddognine 2 года назад

    As an engineering undergrad many years ago, I bought the Dover book on Vector and Tensor Analysis with Applications. Looks like Matt has come up with a new application!

  • @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.

  • @return6005
    @return6005 3 года назад +1

    That “photogrammetry” method is brilliant!

  • @ja9892
    @ja9892 3 года назад +10

    That's some good geometree!

  • @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

  • @richdobbs6595
    @richdobbs6595 3 года назад +10

    As a software developer in test, my reaction was that you could locate bad light locations and fix them by calculating the distance between adjacent bulbs. If it is higher than a reasonable threshold based on how much wire is between the bulbs, you could relax the location to put less stress on that part of the network.

    • @sebastianjost
      @sebastianjost 3 года назад

      if you know the location of the next and previous LED, you could also use some approximation to calculate where the LED in between would be. Something like this should make the scanning a lot more robust.
      It's basically an interpolation problem, so there are probably many solvers availiable in common libraries.

    • @richdobbs6595
      @richdobbs6595 3 года назад +1

      @@sebastianjost FYI, when I said "relax the location to put less stress on that part of the network", I was proposing using a generalization of what you are describing.

    • @sebastianjost
      @sebastianjost 3 года назад

      @@richdobbs6595 nice to know ^^
      I wasn't sure what that part was supposed to mean.
      Thanks 😊

    • @richdobbs6595
      @richdobbs6595 3 года назад +1

      @@sebastianjost Look up "relaxation in numerical calculation" in your favorite search engine.

  • @emdove
    @emdove 3 года назад +1

    This is the best thing to ever come out of RUclips recommendations.

  • @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.

  • @Flixterino
    @Flixterino 3 года назад +1

    Seems like a very elaborate way to be able to write off your Christmas tree as a business expense!

  • @stevemonkey6666
    @stevemonkey6666 3 года назад +8

    Past Matt created the Parker Square of Christmas lights

  • @myg63
    @myg63 3 года назад +1

    Great! The math approach is my favourite. Next class: mix your formula into a FFT of live music and use 2000+ LEDs

  • @TylerJaneBronson
    @TylerJaneBronson 3 года назад +5

    Matt, you are a treasure. Merry Christmas!

  • @О.Ш-ь1щ
    @О.Ш-ь1щ 2 года назад

    That's a really good example of how hardware problems causes software headache. If I were you I would concentrate more on a hardware: mainly I would place the LEDs zigzag from the bottom to the top only on the facing surface of the tree and count the number of LEDs in each "layer". And all the problems you had would disappear. But for sure I'm in love with the solution you made because it's the first idea came up to my head when you asked how would you find out coordinates of each led. I'm a little bit jealous of those people who could realize their ideas in codes, because as an engineer I have a lot of ideas about automatisation of many annoying and time consuming processes, but I'm not able to do it... I had some experience with Arduino and rpi, but it was for me so annoying... The main reason that most of the examples that are on the internet doesn't work even if you copy paste them, because all the libraries update really frequently and the commands are replaced with another ones and parameters in the brackets also change. My dream of programming for now is to have some visual interface when you drawing a program scheme with blocks but not with some.stupid.words.(with brackets, dots, and, etc) because this language is not absolutely clear as for human who explains his logics in logical block scheme as for a machine who understands only high and low. As for me it's not absolutely clear why no one have already done it... Programming for now looks for me like as if you wanted to print a document from ms word and you have to send not a document to the printer but a hand.writing.code.with(coordinates X, Y, dot color, amount of paint to be extruded, speed of the extrusion, and etc) for each dot on the A4 paper sheet. And also in my dream program should be 2 windows: first with logical blocks connected with arrows, and second with interactive hardware blocks (like sensors, buttons, screens, motors and etc) connected with virtual wires to the specified by person pins on rpi or Arduino or any other controller, and after you've done the wiring and the code you'll be able to check the simulation by pressing buttons, making some virtual influence on sensors and etc. As for logical blocks I imagine that it shouldn't be the same as in line by line codes separate words (like print.ln(), digital.write()), but some more complex pieces of code. All this blocks should be separated in three groups: input, processing, output. In input there'll be some things like read sensor parameters, check buttons state and etc. As for processing there'll be some basic math operations, logical operations (if, else, or, and etc), on/off regulator, PID regulator and something else. As for output some commands like move motor or servo on specified angle, show information on the screen, beep, save a CSV file and etc. Also if the programming is going to be about some visual interface and menus you'll be able to draw it as simple as it realized by MIT app Inventor...

  • @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

  • @CottonBudda
    @CottonBudda 11 месяцев назад

    The weird thing is that if you look at the lower level code which controls the lights, you can see that it doesn't REALLY address and individual LED. It puts your demand on the first LED and then clocks it along the wire imperceptibly quickly. To the coder, it looks like individual LEDs can be tweaked, but in reality, each time we change and LED, we're actually "refreshing" the whole string. I love this project. Some day I'll get around to it. I want to display scrolly messages on my Christmas tree.

  • @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"

  • @kennethlu9833
    @kennethlu9833 3 года назад +2

    12:07 "So I've just built this very simplified version of a Christmas tree..."
    and up pops a really complex looking 3-D model of Christmas tree...

    • @sebastianjost
      @sebastianjost 3 года назад

      I was expecting to see just a cone or a cylinder...

  • @Systox25
    @Systox25 3 года назад +28

    I just told my dad 4 hours ago people have Christmas Lights like this

  • @RichDanby
    @RichDanby 3 года назад +1

    To find the index of an led you could turn the first 250 on and the rest off, then hit a key to say it was on or off. Now the program knew which half it was in, it could turn half of the new selection on and half of and allow it to narrow down on the location without you doing the binary yourself.
    But forget binary, use base 8 (off, red, green, blue, cyan, magenta, yellow, white) and you can find any ID with 3 answers.

  • @xM0nsterFr3ak
    @xM0nsterFr3ak 3 года назад +6

    21:26 "...it's not great, kinda works..." that seems oddly familiar on this channel. XD
    Merry Christmas to all of you.

  • @sseymour1978
    @sseymour1978 3 года назад

    Being math person really helps with such things. I never thought about this until I heard map 3d coordinates. Then instantly knew how to do it.

  • @mitchellclark4377
    @mitchellclark4377 3 года назад +8

    More like tree-D coordinates, amirite? -insert Hades GIF here-

    • @shreddedtwopack6625
      @shreddedtwopack6625 3 года назад

      Lol. How did you get that strike through? It looks pretty cool.

    • @mitchellclark4377
      @mitchellclark4377 3 года назад +1

      @@shreddedtwopack6625 Completely by accident. I put a hyphen either side of the sentence.

  • @oreo_godzilla7087
    @oreo_godzilla7087 4 месяца назад +2

    9,9 M views on second channel, 639k on main, youtube algo is really amazing

  • @mathpin
    @mathpin 3 года назад +3

    just wait until someone programs a Parker square for the Christmas three...

  • @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

  • @michaelharrison1093
    @michaelharrison1093 3 года назад +9

    Matt P - "Help I've just got my Christmas tree into gimbal lock"
    - why did you not see this coming and choose to use quarternions?

    • @DerTroglodyt
      @DerTroglodyt 3 года назад

      Was about to say exactly the same ;-)

    • @MarkTillotson
      @MarkTillotson 3 года назад +1

      Gimbal lock is a problem with Euler angles, not DCM's or quarternions which have no hierarchy of axes.

  • @AngadSingh-bv7vn
    @AngadSingh-bv7vn 3 года назад

    That's an audiovisual masterpiece that last one
    It kind of reminds me of the sherlock theme.

  • @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.

  • @brettbreet
    @brettbreet 3 года назад

    An idea for a Pong like game to be played on it: the paddle is at the base of the tree and is an arc of say 30 degrees. It moves left and right around the circumference of the base of the tree (clockwise and counter-clockwise). The ball falls down the surface of the cone and when bounced, rises to the apex. From there, it will reflect down another surface path. The tree would need to be in a central location so that the player can run around the full 360 degrees. Difficulty can be controlled by the speed of the ball, and the angle of reflection coming off the apex!

  • @chrisklupenger4999
    @chrisklupenger4999 3 года назад +4

    This is simultaneously the coolest and nerdiest video

  • @MrMacgyver69
    @MrMacgyver69 3 года назад

    It’s nice to see someone who shares my affinity for Christmas based exterior illumination. Great job!!! The debug made a great application for implementing a binary search :) Can find each bulb address in 9 or fewer steps.