Mike, A while ago I saw your color cube patter with 50x50 faces. I finally
got mine to accept N faces. I'm very happy that you encouraged me to
continue!

load 'viewmat'
ColorCube=: 3 : 0
N=:y
G=:<.(i.N)*255%<: N
A=:#:i.8
B=:(((<:N)#0),G),.G,(<:N)#255
BIGBOX=:<"2(|."2)1 0 2{"1(|:"2)(8 3 ,<:2*N)$,|:(,A){"1 B
'BLACK BLUE RED MAGENTA GREEN CYAN YELLOW WHITE'=:>BIGBOX
LYELLOW=:(i.N){"2 YELLOW
LCYAN=:(i.N){"2  CYAN
LMAGENTA=:(i.N){"2 MAGENTA
   GREEN=:((<:N)+i.N){"2 GREEN
RED=:((<:N)+i.N){"2 RED
BLUE=:((<:N)+i.N){"2 BLUE
BACK=:((*:N), 3)$,LMAGENTA<."1/LYELLOW
TOP=:((*:N), 3)$,LCYAN<."1/LYELLOW
LEFT=:((*:N), 3)$,LMAGENTA<."1/LCYAN
FRONT=:((*:N), 3)$,GREEN+"1/BLUE
RIGHT=:((*:N), 3)$,GREEN+"1/RED
BASE=:((*:N), 3)$,RED+"1/BLUE
F=:i.2#N
T=:(<:6*N^2),((<:N),N)$0
L=:|:T
R=:|:|.T
WOW1=:(R,.(|.F),.L),((|:|.(N^2)+F),.((2*N^2)+F),.|.T)
WOW2=:WOW1,(T,.((3*N^2)+F),.|:|.|:(4*N^2)+F)
WOW3=:WOW2,(R,.(|.(5*N^2)+F),.L),"2,N(#"0) 0, (6*N^2), 0 
ALL=:BACK,LEFT,TOP,FRONT,RIGHT,BASE(,"2)0 0 0
ALL viewmat WOW3;'Color Cube')
)

ColorCube 30

Linda

-----Original Message-----
From: programming-boun...@forums.jsoftware.com
[mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Mike Day
Sent: Tuesday, July 7, 2015 6:57 AM
To: programm...@jsoftware.com
Subject: Re: [Jprogramming] Trouble making patter for a color cube

Thanks, Linda.

Pace Chris,  I should have said that I didn't _understand_ what was under
the bonnet/hood.

FWIW,  I've somewhat generalised my "newcube.ijs" script - there's a verb
bcube which accepts a binary (or indeed a character array) specifying the
required shape for the net.  That's still on my google drive folder,  cubes,
whose link is still (probably wrapped here):
https://drive.google.com/folderview?id=0B0saFta7n5wobk9za0QtZVVEM2M&usp=shar
ing

Here's an example call:
    (10;3 4$1 0 0 0 1 1 1 1 0 0 0 1) bcube GREEN,BLUE,WHITE,:RED which
renders a flipped and transposed form of the fourth pattern in the Wiki/cube
page.

It attempts to return error messages for bad input, eg:
     (10;|.3 4$1 1 0 0 1 1 1 1 0 0 0 1)bcube GREEN,BLUE,WHITE,:RED

Sorry - this binary net is not supported! wrong number of faces. 7


     (10;|.4 4$1 1 0 0 1 1 1 1 0 0 0 1)bcube GREEN,BLUE,WHITE,:RED

Sorry - this binary net is not supported! shape = 4 4


... and so on.


Have fun!

Mike

On 05/07/2015 18:18, Linda Alvord wrote:
> Mike, Thanks for the  suggestion about the missing  tab. Thanks to 
> Bill, the palette ALL is in  the range 0-255. The pattern I now upside 
> down from light to dark values.
>
> Also GRB palette emerges naturally from #:i.8 which accounts for 
> individual palettes like GREEN with values in colors indicate in the left
column.
>
> I hope this makes more sense.
>
> load 'viewmat'
> A=:#:i.8
> N=:<.63.75*i.5
> B=:((4#0),N),.N,4#255
> BIGBOX=:<"2(|."2)1 0 2{"1(|:"2)8 3 9$,|:(,A){"1 B 'BLACK BLUE RED 
> MAGENTA GREEN CYAN YELLOW WHITE'=:>BIGBOX
> LYELLOW=:(i.5){"2 YELLOW
> LCYAN=:(i.5){"2  CYAN
> LMAGENTA=:(i.5){"2 MAGENTA
> GREEN=:(4+i.5){"2 GREEN
> RED=:(4+i.5){"2 RED
> BLUE=:(4+i.5){"2 BLUE
> BACK=:25 3$,LMAGENTA<."1/LYELLOW
> TOP=:25 3$,LCYAN<."1/LYELLOW
> LEFT=:25 3$,LMAGENTA<."1/LCYAN
> FRONT=:25 3$,GREEN+"1/BLUE
> RIGHT=:25 3$,GREEN+"1/RED
> BASE=:25 3$,RED+"1/BLUE
> F=:i.5 5
> T=:149,4 5$0
> L=:|:T
> R=:|:|.T
> WOW1=:(R,.(|.F),.L),((|:|.25+F),.(50+F),.|.T)
> WOW2=:WOW1,(T,.(75+F),.|:|.|:100+F)
> WOW3=:WOW2,(R,.(|.125+F),.L),"2,5(#"0) 0 150 0
> ALL=:BACK,LEFT,TOP,FRONT,RIGHT,BASE(,"2)0 0 0 ALL viewmat WOW3;'Color 
> Cube'
>
> Linda
>
> -----Original Message-----
> From: programming-boun...@forums.jsoftware.com
> [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Mike 
> Day
> Sent: Thursday, July 2, 2015 4:04 AM
> To: programm...@jsoftware.com
> Subject: Re: [Jprogramming] Trouble making patter for a color cube
>
> Linda,
> before I forget,  and if it matters to you,  please note that you only 
> have
> 5 sticky tabs.  You omit the one between TOP and RIGHT (I think).  
> Your net layout is the fifth (origin 1) in the wiki cube page.  (This 
> is still the case with your latest posting,  which arrived while I was 
> writing this.)
>
> Anyway, as for the discussion on the range of "ALL",
> doesn't this depend on the definition of viewmat.   In
> http://www.jsoftware.com/docs/help602/user/script_viewmat.htm#viewmat
> the optional left argument is named "hue", and we are told that hue 
> may be one of:
>      a 3-col table of RGB triples,
>      or a list of RGB values,
>      or 'rgb'
> but it assumes we know what it means in the first two cases.
>
> Some definitions of RGB triple(t)s found elsewhere have white as 
> 3#255,  so it's not clear what's going on here, since your latest 
> effort evidently succeeds with twice this value.
> I tried halving your "ALL" value,  and the result was pretty sad, 
> while doubling the values in "colours" (triple in [0,255] in my 
> version results in abrupt step changes across the faces.
>
> SO - what does viewmat mean by "hue"?
>
> No help at all!
>
> Mike
>
> On 02/07/2015 07:14, Linda Alvord wrote:
>> I tried <. In each of the three light mixes and the pattern looks good.
> (>.
>> Is too much light  and all square turn white)
>>
>> I can even explain it pretty well. For the full collors, turning on 
>> two lights at a time, adds light so +s works.  However, to get the 
>> lighter hues you have added extra light to both colors so adding can 
>> be too much and it seems that the lesser of the pair stays in the 
>> acceptable range. Thus all those numbers up to 510 are legitimate 
>> colors for a viewmat palette.  Does that seem reasonable as an 
>> explanation
> to you?
>> Linda
>>
>> -----Original Message-----
>> From: programming-boun...@forums.jsoftware.com
>> [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of bill 
>> lam
>> Sent: Wednesday, July 1, 2015 9:17 PM
>> To: Programming forum
>> Subject: Re: [Jprogramming] Trouble making patter for a color cube
>>
>> Perhaps you could also experiment other formulae for color addition 
>> instead of using +,  try >.  eg
>>    BASE=:25 3$,LYELLOW>."1/LCYAN
>>


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to