Marvellous! I went back to J803 to compare, but the shader doesn't seem to work there. However, the opengl/basic/colors demo in J602 is very similar, requiring, apparently, very little code.
What a lot of code for the J804 version, but I suppose it's doing a lot more than we mere mortals with viewmat - which in its turn appears to do a whole lot more than what I'd realised hitherto... I don't see why the definition of vertexData needs be quite so long-winded. I'd define (perhaps) 'G H F E' =: - 'A B C D' =: _1 1 _1, 1 1 _1, 1 _1 _1,: _1 _1 _1 (not sure about the back-side - this labelling "sees" a face EFGH behind the face ABCD) and then define the 6 faces in terms of these labels. Raul points out that the colours in the all-8-colours cube are essentially the same as their vertices, so you could just define colorData =: 1 fc _1 1 i. _1 fc vertexData However, this assumes a fixed choice of colour for each vertex. As it is, I don't see how one can easily modify the corner colours to a user's arbitrary selection; this would be more manageable if colorData were defined in terms of the 8 (arbitrary) colours for A B .. G H. fc appears to support reals, so such colours may be defined in [0.0, 1.0] if the user wishes. Thanks, Mike On 28/06/2015 02:52, bill lam wrote:
I made an attemp to implement color scheme proposed by Raul and Mike in the opengl shader demo of j804 beta. Please update qt addon to check if the result agrees with viewmat, and fix shader if necessary. F10 is used to start/stop timer.
--- 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