Tag Info

New answers tagged

0

Another approach you can take for this is domain warping. Rather than generating a 1D fractal along the edges, you generate a 2D fractal over the interior. For each pixel, you sample the fractal at that point to generate an offset vector, then you shade that pixel as if you were shading the nearby pixel at [pixel position + offset]. For pixels near the ...


1

This is a problem that has several solutions and optimizations to it, especially in 3d. 2d, there are fewer but still more than one "right answers". If you understand the first answer, but not this one, it has a good chance of being "Fast enough" on modern hardware there won't be a problem. Another solution is Quadtrees: ...


1

You're getting aliasing in the second case since you're not rasterizing the circle correctly. Instead of iterating over r, theta, you need to iterate over pixels in the rectangle and determine from that their r, theta: for(var i = 0; i < buffer.Length; i+= step) { for(var j = 0; j < buffer[(int)i]; j++) { var r = sqrt(i * i + j * j); var ...


1

First thing you should do to save some time is eliminate the ones that can not match. To do this, calculate the smallest rect that contains the circle. Intersect that with whatever rect you think might intersect with it (loop over all of them, most likely). Two rectangles intersect if they overlap both horizontally or vertically. There are three ways an ...



Top 50 recent answers are included