Here's a quick way of looking at the numbers you generated from cube 5

   (2 2$5)<;._3 <"1 (5 *4 3)$ paint

This organizes them in groups of 3 (for each pixel) and then in 5x5
groups (for each square).

You can see by scrolling over horizontally that your bottom square has
values outside the 0..255 range in your pixels, so that means you need
to scale your calculation by something related to the right argument
to cube.

I think Mike Day's code might do that, and it also looks like he has
gone into deeper analysis on your code.

But perhaps being able to inspect your numbers can also help you
understand your code?

Thanks,

-- 
Raul

On Mon, Jul 27, 2015 at 1:30 AM, Linda Alvord <lindaalv...@verizon.net> wrote:
> You were tight - I got in trouble trying to generalize to mor squares. An it
> almost works. The size seems  ok, but I can't get the colors to work.
>
> load 'viewmat'
>
> 'E B G C R M Y W'=:#:i.8
> V=:<E;E;E
> FRONT=:<M;R;W
> LEFT=:<M;W;B
> TOP=:<W;Y;C
> BACK=:<C;G;B
> RIGHT=:<G;Y;E
> BASE=:<B;E;M
>
> face=: 3 :0
> 'O X Y'=.y
> brush=.D=: <.255*O+"1]0.5*((i.N)*/Y-"1 O)+"1/(i.N)*/X-"1 O
> )
>
> cube=: 3 :0
> N=:y
> plan=:4 3$V,FRONT,V,LEFT,TOP,V,V,BACK,RIGHT,V,BASE,V
> paint=:,/,/>,"_1 each/"1 C=:face each plan
> paint viewmat i.N*4 3
> )
>
> cube 5
>
> Linda
> -----Original Message-----
> From: programming-boun...@forums.jsoftware.com
> [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Mike Day
> Sent: Sunday, July 26, 2015 4:47 PM
> To: programm...@jsoftware.com
> Subject: Re: [Jprogramming] Trouble making patter for a color cube
>
> This variant (some way below here) worked ok for me on Friday when you
> (Linda) first posted it.
>
> Have you tried   clear'' and (re)load?  (Always works!)
>
> I was a bit puzzled by your hard-wiring of 3 (as in i.3) - is it just a
> coincidence that colours are also defined in triples?
>
> Mike
>
> On 26/07/2015 21:28, Linda Alvord wrote:
>> Raul, could you please  check this code again. It doesn't seem to work
>> at all anymore.  Thanks.
>>
>> Linda
>>
>> -----Original Message-----
>> From: programming-boun...@forums.jsoftware.com
>> [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Raul
>> Miller
>> Sent: Friday, July 24, 2015 12:51 PM
>> To: Programming forum <programm...@jsoftware.com>
>> Subject: Re: [Jprogramming] Trouble making patter for a color cube
>>
>> That looks plausible.
>>
>> The colors in the middles of the squares are interesting.
>>
>> The top middle square's center color might be something of an "indian
> red".
>>
>> The middle of the square below that might be an "aquamarine".
>>
>> The color in the middle on the left side might be a "medium purple".
>>
>> The color in the middle on the right side might be an "olive drab"
>>
>> The color in the middle to its right might be a "turquoise".
>>
>> The color in the middle of the bottom square is probably a "purple"?
>>
>> Or at least, those are the best I can come up with, for names.
>>
>> Thanks,
>>
>
>
> ---
> 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
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to