|
![](/i/fill.gif) |
Slime wrote:
>> So far, my C++ implementation is very fast, for not being coded with ASM
>> and all. I was able to implement a few speedups, like not using
>> sqrt(x*x+y*y) for *every pixel*, but instead making a 1/4 circle 2D
>> array and picking from that.
>
> You're doing a radius comparison, right? You probably don't need to take
> a square root.
No, I'm setting specific radii (in pixels) and testing against a 2D
array using a brute-force method. In POV I was doing radius comparisons.
At any rate, I'm only having to do the sqrt(x*x+y*y) calculation 128*128
times when the program starts, to fill an array. It's like 1/4 of a
cylindrical pigment, and is the maximum circle radius. It's a drop in
the bucket, really.
Of course, with today's computers I can afford to be so wasteful. Not
that my program is running at record speeds or anything. Maybe if I knew
assembly language... :(
Post a reply to this message
|
![](/i/fill.gif) |