« GalaxyGoo on Zazzle | Main

Shapes unexpectedly cancelling each other out in AS3

This weekend, I was playing around with some AS1 code that Edwin posted a few years back. I even managed to convert it to AS3. Which was a great exercise!

His original version draws short lines, to fill a color pattern. In my simple modification, I've used graphics.drawEllipse() instead. But I keep getting a white line down the middle of the pattern, that shouldn't be there.

vLine2.gif vLine1.gif

When zooming in on the swf, I noticed that when dots overlap on the mid-line, they cancel each other and leave a white space. Very odd!

Wondering if the size of the shape would have any effect, I changed the width and height of the ellipses on half of the pattern.

vLine2b.gif vLine2a.gif

While this didn't give me the hoped-for result, it did give me an idea for simulating fish scales!

I'm sure I've seen something like this posted somewhere, but I just can't remember where or if there was a fix.


Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)