How can I eliminate the flicker on this animated image?

edited October 2016 in How To...

The output of my code below is as desired... except for flickering on the spikes that emerge.

See this video:

(PS Devs, video embed is broken on the forum Preview.)

It is as if the spike is being overwritten by some bogus triangle, the edge of which is at the pointer in this capture:

How can eliminate this, whilst preserving the shape?

void setup() {
  size(480, 480, P3D);
  colorMode(HSB, 6.0, 1.0, 1.0, 1.0);
  noFill();frameRate(30);
}

void draw()
{  background(0);
  translate(width/2, height/2);
  scale( 0.03, 0.03);
  stroke(color(millis()/15646.0%6.0, 0.4, 1.0), 0.5);
  strokeWeight(width*2.130);
  rotateX(millis()/13023.3);rotateZ(millis()/17657.0);
  sphereDetail(3);sphere(width*1.197);
}
Tagged:

Answers

  • that just looks like z-fighting. where two polygons have the exact same z position and the card's decision on which one is displayed differs per frame.

    that said, i am just about to run the code. so i might change my mind.

    there was an error in sphere code a while ago where one of the poles was hard-coded as a 1, rather than using the radius. so spheres with a supplied radius had a spike in the middle. the way around this was to use unit sphere and scale it. but i'd've said that was fixed years ago.

  • yeah, z-fighting, i'm pretty sure.

    sphere with detail 4 looks like an odd shape. and using a wide stroke on that is a really odd effect, especially as you rotate it slowly.

    sphere spike seems to be fixed but that other problem, the double stroked lines, is obviously a bug.

  • sphere with detail 4 looks like an odd shape.

    It is as I would expect from foreshortening near-plane frustrum clipping.

    and using a wide stroke on that is a really odd effect, especially as you rotate it slowly.

    Yes, the widening of the stroke towards the camera is not as I would expect. Fun though! :)

    the double stroked lines, is obviously a bug.

    To which lines are you referring? The polar ring discussed here https://forum.processing.org/two/discussion/comment/77501#Comment_77501 ? Or the non-polar-ring lines that are flickering?

Sign In or Register to comment.