'dot' 2-D matrix needed

For general discussion related FlowStone
Post Reply
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

'dot' 2-D matrix needed

Post by tester »

I need something like a 'dot matrix', i.e. a graphical view that is splitted into a matrix of 'pixel' rectangles.

Inputs:

1) how many lines (x)
2) how many columns (y)

So this produces a 2-D matrix of x*y rectangles. Each rectangle should have it's own color or transparency or something like that.

3) Third input would contain an array of x*y values. Each value would represent a color. As for colors it does not matter, it can be a colorset or a manipulation of one color.

This is for static display.

Anyone played with such thing or has it and could share?
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: 'dot' 2-D matrix needed

Post by KG_is_back »

somethign like this?
Attachments
2d_matrix.fsm
(719 Bytes) Downloaded 1027 times
User avatar
nix
Posts: 817
Joined: Tue Jul 13, 2010 10:51 am

Re: 'dot' 2-D matrix needed

Post by nix »

ty KG-
that's neat
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: 'dot' 2-D matrix needed

Post by tester »

Thank you, this should do the job.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: 'dot' 2-D matrix needed

Post by tester »

Hmm... I don't know to modify it, I'm getting errors.

I'd like to do 2 things here.

1) define main color (instead of shades of blackness) - I thought it would be simple

Color.new((@dat[x+y*@w]*255).to_i)
to something like:
Color.new((@dat[x+y*@w]*255,val1,val2,val3).to_i)
at least following the manual

2) actually, I'd like to have 2 distinct color gradings, one color for positive array values, and second color for negative array values, since some arrays have both.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: 'dot' 2-D matrix needed

Post by tester »

I'm stuck with this one. I have no idea how to manipulate at least the main color a,r,g,b parameters. Help. :-)

(bi-color versus could be done simply with using 2 of such boxes, where transparencies on one box would be compensates by colors on the other)
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Post Reply