Wednesday, June 23, 2010

running code from 3dleds.com

here is a slightly better video clip..I have to work out how to take a better clip, this is still pretty terrible quality. It doesn't really do the cube justice at all. 


After i wrote the post yesterday a slight improvement occurred to me to the way I interpret the 3dleds code. The available code is in 8 bit resolution, but my cube runs at 12 bits. That means the code's maximum value is 254 but my cube's maximum is 4096. To overcome this, i just multiplied the code by 15. This was a very quick and dirty approach. It seems obvious now that a much better approach would be to instead use the code's value as a percentage and multiply my full value by it, this gives a much more faithful reproduction of the code's intended outcome.

I did this simply by declaring v as a float instead of an int and changing the line v = rawData[p]*15;
to this:

v = rawData[p];
v= (v/0xff)*0xfff;

3 comments:

  1. Hi, I've read a lot of your LED cube. I want to do one too. But how do you read and use the raw data from 3dleds.com? Thanks

    ReplyDelete
  2. Hey there. In the post previous to this one I showed the code I used and tried to explain it a bit. http://v3spin.blogspot.com.au/2010/06/explosion-test-clip.html

    I think it's one of those things that when it "clicks" it's actually quite simple, but trying to explain it is not so easy.

    ReplyDelete
    Replies
    1. Thanks, not quite clear, but I'll try when my cube is mounted.

      Delete

visitor counter