weird glitch, sketch is capturing chunks of my screen..
in
Integration and Hardware
•
11 months ago
Hi
I've never seen this before, this sketch is capturing chunks of screen when it renders (see image below), anyone know what's causing it? We should be seeing only the coloured triangles that appear top-left of sketch, oddly we also see the triangles before colouring but displaced (it seems) to bottom-right...
I'm on OSX 10.6.8, Processing 2.0b.5
- float angle=0;
- int numPoints = 100;
- float[] triX, triY, triZ;
- float rx, ry, rz;
- color[] col;
- void setup() {
- size(800,800,P3D);
- frameRate(12);
- background(255);
- smooth();
- //noLoop();
- colorMode(HSB,1000);
- triX = new float[numPoints];
- triY = new float[numPoints];
- triZ = new float[numPoints];
- col = new color[numPoints];
- for (int i = 0; i < numPoints-2; i++){
- float circ = 400 + ((1+sin(angle))*(600/2)); //sin(angle) = -1 to +1, so add one to get range 1 to 2, then multiply by colour range 255 divided by 2
- float circ1 = 400 + ((1+sin(angle/3))*(600/2)); //add HSB offset of 400 to avoid low register
- float circ2 = 400 + ((1+sin(angle/7))*(600/2));
- float circ3 = 400 + ((1+sin(angle/2))*(600/2));
- col[i] = color(circ, circ1, circ2, circ3);
- angle += 1.;
- rx += random(-20, 20);
- triX[i] = rx;
- ry += random(-20, 20);
- triY[i] = ry;
- rz = 10*(circ3/1000);
- triZ[i] = rz;
- }
- }
- void draw(){
- beginShape(TRIANGLE_STRIP);
- for (int k = 0; k < numPoints-2; k++){
- fill(col[k]);
- vertex(k*2 + triX[k], k*2 + triY[k], triZ[k]);
- endShape();
- }
- }
1