2D effects on a christmas tree

This post is not a tutorial, not a guide. It is just a report on an approach that worked for me. I don’t include any code since I just took available scripts and then modified to adjust to my specific configuration.
But I hope this post can inspire or give confidence that it can be done…

  1. put LEDs in tree, more is better (always)
  2. 3D map the lights:
    • find an area away from reflective walls, windows or cover those
    • repeat 3 times, with tree rotated 120 degrees between each iteration:
      • determine LED position one by one:
        • take ‘dark’ image
        • light single LED
        • take LED image
        • substract images and find brightest spot
    • calculate LED 3D positions:
  3. At this point, you can create a ‘ledmap’ ordering the pixel by height only. This works nice for most regular effects already!
  4. 2D ledmap:
  5. watch hiphotic on your tree…
2 Likes

Oh my that seems prety fine and usable! :heart:
Not only for a tree but for mapping overall!
There is already few projects like the one with ESP32CAM but this one seems just rigrt amout of extra work to get it done externally and then it just works!

Getting the 3D coordinates (or in fact 2D, which would be sufficient) is a bit of work and takes a lot of time the way I did it by lighting every LED one by one. It can probably be improved on in several different ways (working with a video stream instead of individual images, flashing binary pattern on all LEDs at the same time, using different colors, …)
The gridding of the positions is the conceptually more difficult part and is dealt with very nicely with the pointgrid implementation. I used default parameters except for the checkerboard (square) rather then the hexagonal lattice.
There is some manual optimisation to be done in selecting the fill parameter. It needs to be pretty high or the matrix size becomes excessive (I am assuming WLED will run into issues with large virtual matrices, even if they are very sparse. That assumption may be incorrect?)

xlights has a custom model generator where you use a camera to video the lights and it will create a model with correct node layout. It may be a faster way to do what you are doing. Not 100% sure I never used it. https://www.youtube.com/watch?v=PrvqctYHC7I

1 Like