-- Modern
function setup()
testMesh = mesh()
testMesh:addRect(0,0,300,300)
c1,c2= color(0, 255, 0), color(255)
testMesh.colors = {c1,c1,c2,c2}
end
function draw()
background(0)
matrix.translate(WIDTH/2,HEIGHT/2)
testMesh:draw()
end
Bug: it seems like some of the color channels for mesh are mixed up or inverted? This rect should be green on the top but it’s magenta instead.
Here’s a triangle version showing the problem. The colors should be red, green, and blue.
viewer.mode=FULLSCREEN
function setup()
w,h=WIDTH,HEIGHT
m=mesh()
m.vertices={vec2(100,h/2-50),vec2(w-100,h/2-50),vec2(w/2,h/2+300)}
m.colors={color(255,0,0),color(0,255,0),color(0,0,255)}
end
function draw()
background(0)
m:draw()
end
Thanks for the test examples. I probably messed up the byte interpretation of the colours array somehow (like the vertices actually expect 4 bytes per colour, but instead get 16 or so, which messes them up)
@John@sim - sent in a report about bubbles demo. Think it may be down to trying to print out touch variables. Tried to print out touch type using print(type(touch)) and it crashed after that.
Attached two error images with printing out touch variables and touch type.