3d video mapping

Continuing the discussion from Blinkfade in Cube Frame:

Porting the .ino code is pretty simple:

it’s a 5 second of doing nothing, then it lights up each pixel, in order, for X milliseconds.

// 3d video processing v0.1 alpha by ScruffyNerf

export var seconds, pixel

// This part is not in millis, but seconds to avoid 16bit overflows
var initial = 5; 
// initial pause in seconds 
// How many Seconds each pixel is shown for?
// you will need to multiply by 1000 to convert to milliseconds
var speed = .2;

export var loopTime = initial + (pixelCount * speed);

// In millis, this would be 1000 times larger
// and go past the 32767 limit for even 200 pixels...

export function beforeRender(delta) {
  seconds += delta/1000
  if (seconds > loopTime){
seconds = 0
  }
  pixel = floor(( seconds - initial ) / speed )
}

export function render(index) {
  if ( (seconds > initial) && (pixel == index) ) {
    rgb(1,1,1)
  }
  else {
    rgb(0,0,0)
  }
}

I’ve stuffed a bunch of fairy lights into a big mason jar. No way could I easily build a map for this, it’s just a bunch of wires. More results and some video later.

2 Likes

Here’s the context / tool from the other thread, for anyone starting here.

3 Likes