I should explain that all I was currently doing was trying to understand Raul's version and modify it to allow theentry of the numbers of squares in one dimension of a face. That's what I couldn't seem to do. Along the way I was modifying it to add some features that I'd like to include. Hence the inside out look. I also want to include "blending" of the colors as I did in my early version. Once I really understand Raul's version I hope to put all the ideas together and make it as simple as possible. I'll respond when I consider both Raul's and your ideas...
Linda -----Original Message----- From: programming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Mike Day Sent: Monday, July 27, 2015 5:07 AM To: programm...@jsoftware.com Subject: Re: [Jprogramming] Trouble making patter for a color cube Further to my thoughts on the fourth corner. Your model relies on the (optional) property that diagonally opposite corners are complementary. (That's why you don't need to specify the fourth corner on any face.) In that case you can only define 4 corner colours independently. (If you recall, my "model" applied 8 independent, not necessarily different colours to the 8 corners labelled A - H .) For example, setting 4 corners in your first two faces: FRONT=:< 'F0 F1 F2' =: M;R;W LEFT =:< F0;F2; L2 =: B NB.shares an edge with FRONT F3 =: F1 + F2 - F0 NB. Linda's rule for 4th corner L3 =: F2 + L2 - F0 NB. "" TOP =:<F2;F3;L3 BACK=:<L3;(1-F0);L2 NB. 2nd corner complement of F0 RIGHT=:<(1-F0);F3;1-F2 BASE=:<L2;(1-F2);F0 By the way, the face names seem to have become non-intuitive. Left & Right are ok, but the central pillar of your net is Front/Top/Back/Base, which seems "inside out" to me - I gather it's a very good film! Mike On 27/07/2015 09:18, Mike Day wrote: > Linda, I wasn't tight, though I might be this evening as it's my > birthday... > > Well, I tried to generalise as soon as I saw your code, > and that's when I got into difficulty. But I've just > realised that the factor 0.5 needed to be taken into account too. See > changes sketched out below. > > With your code, I find the fourth corner is X + Y - O. > This won't work properly for all choices of colours for three corners > of each faces. It's ok with your choices: > |: 13 : '+/_1 1 1 *>>y' every FRONT;LEFT;TOP;BACK;RIGHT;BASE > 1 0 0 0 1 1 > 1 1 1 0 0 0 > 0 1 0 0 0 0 > > If for example a face had three corners as White;Green;Blue, you'd get > 13 : '+/_1 1 1 *>>y' W;G;B > _1 0 0 > > It still "works", but not properly - try C =: W just before V = ... > > I now think your earlier not-working problem might be that you > redefine the global C; it starts off as cyan but becomes the result > of face each. Your faces are already defined so it shouldn't really > be a problem, but who knows... > > Try the following variants, with the rest of your code unchanged; > 30 cube '' is pleasing! > > cube=: 3 :0 > 3 cube y > : > c =. x > 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.4 3*c > ) > > face=: 3 :0 > 3 face y > : > ic =. (i.%<:) x NB. ==> 0 1/(n-1) 2/(n-1)... 1 > 'O X Y'=.y > NB. removed redundant "1 ... > brush=.<.255*O+"1(ic*/Y-O)+"1/ic*/X-O > ) > > Any help? > > Mike > > On 27/07/2015 06:30, Linda Alvord 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 > --- 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