3D Model  >  Toy  >  Game peripheral products
0+
Zelda: Breath of the Wild – Guardian Sword 塞尔达传说:旷野之息-守护者之剑
Guardian Sword with Improved Handle Area
Price£0 List:£0.69
Stand by Free Shipping(可下载)
SOLD0 [Comment0Article]
Zelda_Breath_of_the_Wild__Guardian_Sword_with_NeoPixel_LEDs_Modified_Handle_Area.zip Click to download Downloads: 1  

- +
Add to Cart   
In Stock:99
Seller:Model City 模型城
Satisfaction Good rating0%
Rating:0
Service Attitude:0
Logistics:0
Recommended

by bendoerr, published

https://youtu.be/Z90jh0swJUg - First Power On
https://youtu.be/SVNdtas1FCQ - Bask in the glow!!!

It really bothered me how the handle and blade were split, additionally part of the masking on the handle was missing. Thankfully the Adafruit team shared the Fusion360 design so I went about resolving it. I can manage in Inventor/Fusion360 but am completely lost every time I open Blender. Lastly, as a software dev I thought the Adafruit pixel code was boring, so I spiced mine up.

If I were to print the sword again, there is a whole lot I'd like to fix. The standoffs are horrible and I ended up using a good amount of super glue. I'd also continue my fixes to hiding the seams, I'd like to hide the middle blade seam under the masking and tweak the upper blade masking so I could also hide that seam under it. When the blade is powered on these things are not noticeable but, I've got it mounted on my wall now.

Source Code

Trinket NeoPixel Code

#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif

#define PIN 4

Adafruit_NeoPixel strip = Adafruit_NeoPixel(90, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  clock_prescale_set(clock_div_1);

  strip.begin();
  strip.show();

  powerOnHandle(1);
  powerOnHandle(0);
  powerOnHandle(1);
  powerOnHandle(1);
}

void loop() {
  glowFast();
  powerOnHandle(1);
  powerOnHandle(1);
}

// 0-19, 86-89 = Handle
// 20-48 = Sword Up
// 49-85 = Sword Down

void powerOnHandle(bool up) {
  uint8_t y=3;
  uint8_t z=2;
  uint8_t N=6;

  for (int8_t n = (up ? -N : 19); (up ? n < 20 : n >= -N); (up ? n++ : n--)) {
    for (uint8_t x=0; x < 10; x++) {
      uint8_t hn = n + (N-x);
      if (hn < 20) {
        setColor(hn, ipow(x, y), ipow(x, z), 0);
      }
      uint8_t tn = (9-n) + (N-x) + 86;
      if (tn >= 86 && tn < 90) {
        setColor(tn, ipow((N-x), y), ipow((N-x), z), 0);
      }
    }
    strip.show();
    delay(30);
  }
}

void glowFast() {
  uint8_t powered = 0;
  uint16_t run=1000;
  for (uint16_t i = 0; i <= run; i++) {
    for (uint16_t j = 0; j <= 255; j++) {
      uint8_t n = (j + i) % 48;
      if (n <= powered) {
        uint8_t s = round(((fastSin(j / 2) + 1) / 2) * 255);
        uint8_t t = round(((fastSin(j / 10) + 1) / 2) * 200);
        setColor(n, 255, s, t);
        setColor(90-n, 255, s, t);
      }
    }
    if (i == run - 48) {
      powered--;
    }
    if (i >= run - 48) {
      setColor((48 - ( i - (run - 48) )), 0, 0, 0);
      setColor(90-(48 - ( i - (run -48) )), 0, 0, 0);
      powered--;
    }
    else if (powered <= 48) {
      powered++;
    }
    strip.show();
    delay(0);
  }
}

int ipow(int base, int exp) {
  int result = 1;
  while (exp) {
    if (exp & 1)
      result *= base;
    exp >>= 1;
    base *= base;
  }

  return max(min(result, 255), 0);
}

void setColor(int8_t n, int8_t p, int8_t s, int8_t t) {
  if ((n >= 0 && n <= 19) || (n >= 86 && n <= 89)) {
    strip.setPixelColor((uint16_t) n, p, t, s);
  }
  else if (n >= 20 && n <= 85) {
    strip.setPixelColor((uint16_t) n, t, s, p);
  }
}

#define API 3.1415926
#define ATU 6.2831853
#define M1  1.2732395
#define M2  0.4052847

double fastSin(double x) {
  if (x < -API)
    x += ATU;
  else if (x >  API)
    x -= ATU;

  //compute sine
  if (x < 0)
    return M1 * x + M2 * x * x;
  else
    return M1 * x - M2 * x * x;
}