# Questions tagged [line-drawing]

The tag has no usage guidance.

36 questions
Filter by
Sorted by
Tagged with
1 vote
22 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 ...
• 280
1 vote
29 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,447
169 views

### Projection of line which lies in an auxiliary inclined plane

A line PQ is 75 mm long and lies in an auxiliary inclined plane (A.I.P.) which makes an angle of 45° with the H.P. The front view of the line measures 55 mm and the end P is in the V.P. and 20 mm ...
1 vote
68 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 ...
• 11
274 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 ...
• 115
1 vote
57 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 ...
• 115
511 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 ...
• 101
1 vote
71 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. ...
• 11
1 vote
111 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 ...
• 111
791 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.
151 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 ...
• 33
839 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 ...
• 121
1 vote
229 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 ...
• 171
1k 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 ...
363 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
157 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, ...
• 113
1 vote
525 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(...
391 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 ...
130 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 ...
206 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 ...
416 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. ...
• 163
241 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 ...
943 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 ...
• 2,413
282 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,365
1 vote
59 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 ...
• 13
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: ...
9k 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: ...
• 603
833 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 ...
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: ...
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 ...
• 83
641 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 ...
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 ...
• 163
692 views

Code: ...
• 101
64 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 ...
• 21