Wrong section: but it's the only section that I can see:
Does anyone see any issue with this code?http://cfrancis.heliohost.org/Tests/
(This isn't my homework, by the way, it's something unrelated)
It's supposed to be generating a series of triangles similar to this article:http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of-mona-lisa/
I know the American flag is complex, I've tried it with a solid color image and it works well (Nearly perfectly), but trying it with an image of the American Flag, Darth Vader, or even a photo of Adam Sandler makes the program fail to work.
Thanks, SGDK2 Community.
EDIT: I've seemed to have found the heart of the problem!But I don't understand why it's a problem.
My main question: Why is it that whenever I try to set the value of this.DNAA, it just ends up setting the value of all of the DNA arrays for every Polygon Object in my Population Array, rather than just setting it for the Polygon Object I'm trying to reference with, "this". I can get all other members of my Polygon Instance with "this.v1" or "this.red" but for "this.DNAA", it throws errors.
(DNAA is just an Array<Number> of size 3.. Once I can set the DNA for specific instances
of Polygon, rather than using a shared DNA pool for all Polygons, I can end up with distinct colors, rather than a jumbled mess of all of the colors on the screen.)
Another area that I can't understand is why my Array.splice method doesn't work as expected. It's removing certain Polygon instances that honestly, shouldn't be removed from my list. The underlying code is right, but the splicer is splicing the wrong objects from my collection.