Questions tagged [line-drawing]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
0answers
28 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
1answer
113 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 ...
0
votes
1answer
51 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
1answer
229 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
0answers
57 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
1answer
91 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
0answers
698 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
1answer
132 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
1answer
726 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
1answer
205 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
1answer
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 ...
3
votes
0answers
294 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
1answer
146 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
1answer
452 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
1answer
367 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
0answers
128 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
2answers
191 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
1answer
394 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
1answer
225 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
1answer
904 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
1answer
265 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
1answer
57 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
2answers
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: ...
13
votes
2answers
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: ...
6
votes
2answers
790 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 ...
2
votes
0answers
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: ...
8
votes
1answer
972 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 ...
6
votes
2answers
629 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 ...
4
votes
1answer
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 ...
8
votes
1answer
674 views

Why different result when change input order in GL_LINES?

Code: ...
2
votes
0answers
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 ...
6
votes
1answer
654 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 ...
12
votes
2answers
6k 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 ...