9
votes
Accepted
Logarithmic spiral with equal vertex spacing, what equations?
Since a logarithmic spiral is defined by
$r=e^{a\cdot\theta}$,
the inverse of the equation is this:
$\theta=\frac{\ln{r}}{a}$.
If we want to be able to control our step value, we can multiply it ...
4
votes
Accepted
Name and influence of style used for futuristic line patterns?
That looks a lot like it’s based on the straight skeleton of some outline shapes drawn on the image. You can see similar structures in the middle one of these diagrams from a research page by Stefan ...
4
votes
Floating Point Operations in Line Drawing Algorithms
is it important with modern GPU architectures to avoid floating point operations in favor of integer operations?
Almost certainly not. CPUs have a long history where for many years they only handled ...
4
votes
Accepted
Bezier Curve Tool Controlled by Mouse
Instead of using cubic Bezier spline, you should use cubic Hermite spline. For cubic Hermite curve you specify the segment end points and tangents, which is what you then control in the tool. Hermite ...
4
votes
Accepted
How to never draw "Jaggies" in the first place considering resolution and scale
Well you can render at higher resolution and sample down thhis is called FSAA and should just work without much change to render code. FSAA has the benefit of not having a conflation problem whereas ...
2
votes
Accepted
First steps towards CAD standard curve fitting
Since you have a limited set of tools you are not actually doing a classical fitting. What you have is a discrete problem. And since you are looking for a somewhat easily drawn fit, no more than twice ...
2
votes
Accepted
How different can the number of pixels in a straight line be to its real length?
The worst case is when the line is at a 45-degree angle; then its length (in pixel-sized units) is a factor of $\sqrt{2}$ times the number of pixels, or about 40% longer.
You can see this if you ...
2
votes
Bresenham's Algorithm not drawing horizontal lines
e = (float)(delta_x / delta_y) - 1.0;
e += (float)delta_x / delta_y;
Either of these lines will cause a divide-by-zero error when ...
2
votes
Uniform line thickness in plot
You should separate your line drawing logic from your calculation logic.
In general you should try to have a generic line drawing function that would accept any number of points and draw a line from ...
2
votes
Accepted
Non jagged line algorithm for javascript canvas
The problem you are seeing, i.e. "jaggies" or "staircasing", is an example of the more general problem known as "aliasing" and, in the graphics field, the term you want to search for is "Antialiasing"....
2
votes
Wireframe mesh effect on a photograph subject
This is not something that would be called a "wireframe mesh" in computer graphics. Models are sometimes displayed as a wireframe to help visualize the topology which look like a lot of ...
1
vote
Accepted
Why an object becomes larger when drawn in perspective
If you keep constant the scale at which you view the x-y plane (image plane), while changing the distance of the viewpoint to that plane, then you are not solely changing the viewpoint position; you ...
1
vote
What is this vertical line contour effect in glitch art called?
The technique is called halftone. Achieving continuity must be done through subsampling / super-sampling, but the essence of the algorithm goes like this.
Imagine walking across a horizontal line of ...
1
vote
What is the most efficient line algorithm using a shader program
Here is a (mostly) minimal version of an SDF for a line segment using a signed distance field as suggested in the comments. I take no credit for this code, it is your function pieced together with IQ'...
1
vote
Accepted
Bresenham's algorithm next pixel?
Well, for the first octant you can either step EAST or NORTH-EAST. Depending on the distance to the actual line you choose the appropriate. In many integer implementations, this is done with regard to ...
1
vote
First steps towards CAD standard curve fitting
As far as I know, there are no standard shapes for (physical) French curves. The folks who manufacture them are free to choose any shapes they like. Of course, they choose shapes that look "nice", ...
1
vote
Accepted
Anti-aliasing - Controlling colour density of pixel that comes within the "rectangle" surrounding my line
You have a background color and the color of your line, an antialiased line has additional lines drawn on either side of the first that are simply part way between the color and brightness of your ...
1
vote
Accepted
How to rasterize a line when the background color is not always white?
You're actually already doing color interpolation in the code you posted, in these expressions:
qRgb( 255-I, 255, 255-I )
qRgb( I, 255, I )
The first one ...
1
vote
Fast antialiased line drawing
Absolutely there is, the Bresenham's Algorithm, modified.
Instead of drawing from (x0,y0) to (x1,y1), one can use Bresenham's algorithm to draw lines from ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
line-drawing × 39antialiasing × 5
vector-graphics × 5
c++ × 4
algorithm × 4
mathematics × 4
computational-geometry × 4
pixel-graphics × 4
opengl × 3
bezier-curve × 3
rendering × 2
shader × 2
image-processing × 2
geometry × 2
color × 2
2d × 2
2d-graphics × 2
raster-image × 2
raytracing × 1
glsl × 1
transformations × 1
lighting × 1
gpu × 1
webgl × 1
perspective × 1