Questions tagged [line-drawing]
The line-drawing tag has no usage guidance.
38
questions
1
vote
0
answers
12
views
Alpha calculation for anti aliased line
Seems like there are two techniques
Interpolation: Interpolate the minimum distance from the canter of the pixel to the line.
...
0
votes
2
answers
74
views
Why an object becomes larger when drawn in perspective
I am following David Salomon's book "Transformations and Projections in Computer Graphics" where it is explained how to project a 3d object to the 2d canvas in perspective:
Define a point ...
0
votes
1
answer
67
views
Wireframe mesh effect on a photograph subject [closed]
What is the following wireframe, mesh topography style called and how can this effect be applied to a figure in a photograph as done in the image?
1
vote
0
answers
29
views
Distance to arbitrary set of line segments acceleration structure?
Background:
I'm trying to render lightning within a volumetrically rendered cloud. I'm currently using a series of line-segments to represent lightning.
At first I used a distance field rendered into ...
1
vote
0
answers
36
views
How to get a polyline from an image with consistent winding number
I am trying to find an algorithm for the following problem.
Assume we have a black and white image. The image contains a white region that encloses a space. This space may be concave but it has no ...
1
vote
0
answers
364
views
How to plot an ADC value from the Raspberry PI Pico using pythons matplotlib
Being new to Python and this community, I am trying to plot the pulse return from a transducer. The pulse return is 400 uSecs in duration and occurs every 100 milliseconds. So far I can plot the ...
0
votes
1
answer
617
views
What is this vertical line contour effect in glitch art called?
Some underlying portrait above is glazed over with a series of vertical lines that neatly follow the contours of the face. What is this effect called and how can it be replicated, step-by-step, in ...
1
vote
1
answer
64
views
Name and influence of style used for futuristic line patterns?
What is the name of the style of the line graphics used in the image below? The line patterns seem to envelope the shape of the woman maybe algorithmically somehow, becoming denser and yellow on the ...
0
votes
1
answer
2k
views
What is the most efficient line algorithm using a shader program
I'm new to shaders and I have been experimenting with them in shadertoy. I'm trying to get a deeper understanding of the graphics pipeline and I want to implement some features using shaders. I want ...
1
vote
0
answers
163
views
How can i understand the algorithm wu line?
I have Wu's line algorithm but I don't understand all the lines of code very well.
...
1
vote
1
answer
152
views
Uniform line thickness in plot
I have written a very minimal plotting code which take a function $f$ and a domain $[a,b]$ and plots its graph. (It's here, if relevant.)
Now, I query $f$ at the sides of each pixel, and then every ...
0
votes
0
answers
1k
views
Is it possible to draw horizontal and vertical line with Bresenham's line drawing algorithm?
In computer graphics Bresenham's line drawing algorithm used to draw line . But i want to know the properties why i can't draw vertical and horizontal line by this algorithm.
3
votes
1
answer
203
views
Non jagged line algorithm for javascript canvas
I'm trying to draw a line between two specified points, by updating values in an array which is heightxWidth with each element a set of four bytes (r,g,b,a). In my naive implementation I get the top ...
2
votes
1
answer
955
views
Floating Point Operations in Line Drawing Algorithms
When it comes to line drawing, DDA is the simplest and most intuitive algorithm, the core idea being:
compute the slope of the line
for every increment in x, increment y by the slope
However, DDA is ...
1
vote
1
answer
318
views
Bresenham's algorithm next pixel?
In line drawing, bresenham's algorithm was explicitly derived for lines with slopes between 0 and 1 in the first octant from point P1 to point P2, where the x value of P1 is less than that for P2.
In ...
0
votes
1
answer
2k
views
Drawing Directed Lines (with arrow endings)
I am working on a simple graph viewer with OpenGL. My problem with is directed edges. I tried to draw arrow endings with GL_TRIANGLES but somehow my calculations are off. I've used direction cosine ...
3
votes
0
answers
518
views
Can you disable strip cutting (AKA primitive restart) on Direct3D 11?
Line strips and triangle strips are drawing modes supported across 3D graphics APIs, such as OpenGL, Direct3D, and Vulkan. When using indices to control drawing, a more recent feature is "strip ...
1
vote
1
answer
222
views
How different can the number of pixels in a straight line be to its real length?
I'm working on a game with a programmable robot. It uses a laser range finder to get the distance to walls.
I'm using DDA to generate a line from the robot, going in the direction it is pointing, ...
1
vote
1
answer
742
views
Bresenham's Algorithm not drawing horizontal lines
I'm getting started with graphics and I'm having trouble implementing the Bresenham's algorithm. Now, I know that my implementation is incomplente, but I can't see why it doesn't make horizontal lines(...
6
votes
1
answer
442
views
Logarithmic spiral with equal vertex spacing, what equations?
I need to draw a logarithmic spiral (or close approximation) whose vertices are equally spaced, such that the lines between any two consecutive vertices are of equal length.
(Actually, that spiral is ...
0
votes
0
answers
133
views
Finding Segments in Continuous line
I'm trying to break a continuous line segment into multiple, straight segments.
I've tried using the Hough transform but have found it unreliable for getting the line segments I'm looking for and ...
3
votes
2
answers
221
views
First steps towards CAD standard curve fitting
I am interested in building a program to accomodate the following workflow:
A user begins with an arbitrary vector/CAD shape, which they wish to transfer onto paper without using a printer (there are ...
6
votes
1
answer
515
views
Anti-aliasing - Controlling colour density of pixel that comes within the "rectangle" surrounding my line
I am currently a beginner when it comes to anti-aliasing. I have read some notes online that how anti-aliasing works is that you first draw the line using an algorithm such as Bresenham's algorithm. ...
5
votes
1
answer
250
views
How to rasterize a line when the background color is not always white?
I've to rasterize a line taking into account not only the background color of the screen, which is white, but also the color of other objects in the scene. In my case, I've just another object, a ...
2
votes
1
answer
1k
views
Bezier Curve Tool Controlled by Mouse
So I have recently learned about Bezier Curves (quadratic & cubic) and have a thorough knowledge of how they work. In my graphics engine in DirectX I wanted to implement a Bezier Curve Tool ...
7
votes
1
answer
303
views
How to never draw "Jaggies" in the first place considering resolution and scale
Ok, I have a simulation I am trying to make. The entire simulation is drawn by circles (with gl_Point) and rectangles (gl_triangles with indices).
It would be great to add some anti aliasing ...
1
vote
1
answer
66
views
How would I create a virtual cabling system?
I am trying to devise a GUI system that functions as a virtual patchbay, as seen in something like Logic Studio's environment editor, or seen in virtual synthesizers that use virtual patchcables.
I'm ...
4
votes
2
answers
1k
views
Bug with the Bresenham's line drawing algorithm?
I know how to draw lines with DDA, but I want to learn a more efficient way and Google suggests Bresenham's line drawing algorithm is better than DDA.
Here is my implementation:
...
14
votes
2
answers
11k
views
What is an index buffer and how is it related to vertex buffers?
I have a vertex buffer like this:
0.0, 0.0,
1.0, 0.0,
0.0, 0.6,
1.0, 0.6,
0.5, 1.0
I have the following index buffer:
...
7
votes
2
answers
896
views
Rotate line around center
I have to use a propriertary graphics-engine for drawing a line. I can rotate the whole drawing by its origin point (P1). What I want, is to rotate it around its center point(M). So basically that it ...
3
votes
0
answers
2k
views
Problems in using cox regression with restricted cubic spline plot with R software
In R software, I want to plot a graph by using cox regression with the restricted cubic spline method. However, I can't quite get it to work.
This is the code I'm using:
...
9
votes
1
answer
1k
views
How should I fill a shape consisting of Bezier curves and straight lines?
I have been working on a graphics library for some time now and have gotten to the point where I have to draw Bezier and line based fonts. Up to this point I am stuck with this:
The green lines are ...
7
votes
2
answers
694
views
Best technique to draw overlapping colored line segments that follow the same route
I'm not too versed in computer graphics so my question may be vague.
I'm given a sequence of GPS coordinates which I draw on an iOS map, and they define bus routes. Some of the bus routes happen to ...
5
votes
1
answer
2k
views
Draw angles lines in raster graphics using bresenham line algorithm
I at the moment trying to draw some angled lines using bresenham line algorithm which can circulate a 2d array of size 21x21, as a line angled from 0 - 2pi.
So the idea is that the program has to ...
9
votes
1
answer
723
views
3
votes
0
answers
65
views
Draw lines angled from 0 to 2 pi in a raster grid [duplicate]
I am trying to draw an angled line in a raster grid.
The idea is to create a function that given a start point, a length and an angle, would give me the pixel positions that combined would give me a ...
7
votes
1
answer
938
views
How to calculate matching roundness of two offset rectangles?
I have two rectangles — one with a fill (blue) and one with a stroke (red). The red rectangle is being offset (depending on the stroke width) so that it appears snug and outside the edge of the blue ...
14
votes
2
answers
8k
views
Fast antialiased line drawing
Bresenham's line algorithm is a way of drawing straight lines using only fast integer operations (addition, subtraction, and multiplication by 2). However, it generates aliased lines. Is there a ...