# Questions tagged [2d-graphics]

The tag has no usage guidance.

30 questions
Filter by
Sorted by
Tagged with
36 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.
42 views

### Infinite 2D Coordinate Space

I am working with a 1 dimensional array of an RGBA struct composed of unsigned 8-bit integers. I have implemented a very basic line algorithm, and can draw lines from one point to another accurately, ...
46 views

### What library or tool was used to plot these graphs?

I've been wanting to plot graphs that look like these (Taken from this blog post), but I can't figure out what tool, language, or library was used to pull this off.
43 views

### Douglas-Peuker and equal distances

I have a polyline and I want to simplify it with Douglas-Peucker. It's an easy algorithm, but what if there are points with the same distance. What point should I select? Is there a reasonable ...
19 views

### Nomenclature problem: what to call a graph format

(This may be the wrong group to ask in. Am open to suggestions.) I've been trying to graph a dataset of x1,y1-x2,y2 pairs. Each pair has an id and each id has information and style attached. So far ...
496 views

### What is the difference between world coordinate, viewing coordinate and device coordinate in computer graphics?

The 2D pipeline involves with the construction of world coordinate scene followed by converting world coordinate to viewing coordinate, then transforming viewing coordinate to normalized coordinate ...
97 views

### How can I transform an ellipse into a circle?

I have an ellipse which has -45 degree axis. How can I transform the ellipse into a circle? Can I use shear transformation along the x/y axis?
67 views

### Constraining a Polyline to Look Smooth

What are the mathematical constraints required for a polyline, i.e., a piecewise linear curve, to appear as a smooth curve to human vision? I've discovered one document that specifies only that the ...
60 views

### My 2D translation matrix causes the box to be off screen when it shouldnt be

Now I know this isn't the way this is normally done so please bear with me. I am doing this this way so I know I have a solid conceptual understanding of everything that goes beyond example code. I ...
30 views

### Transforming arcs and perspective change

I have a SVG with group of independent arcs that move around common origin. On user event those arcs can change both their radii and start/end angles. On other user event the user can change view from ...
407 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 ...
144 views

### How to apply wire texture for realistic rendering of embroidery?

I am building an algorithm which takes a bitmap image as input and render the image as an embroidery design. The different steps are : Vectorize the image, I keep only 5 colors (Done) Generate ...
425 views

### How Skia uses OpenGL backend?

Skia 2D's one notable backend in OpenGL, but how does it work under the hood to render? Say, we need to draw an anti-aliased circle. Does Skia: make a quad (using 2 triangles) and paint the circle ...
467 views

### How can I draw a filled circle on a grid with the less rectangle as possible?

I have a grid with a variable width/height spacing. Let's say 100 horizontal lines separated by 80 pixels and 100 hundred vertical lines separated by 50 pixels. Each cell of the grid in my logic have ...
99 views

### File missing in Corel draw [closed]

I have downloaded Corel draw but I don't know why some file are missing in it . So I am unable to install it. These files are :-. 1. Common_retail_x64.msi. 2. Common_x64.cab. 3. Ghostscript.msi. I ...
52 views

### Is there an education tool that teachs computer graphics ? [closed]

I am wondering if there is any outsourced or licensed tool that teachs the fundamentals of computer graphics theories/programming. Does such a tool even exists ? Thanks in advance
146 views

### Midpoint Algorithm Fast Direction

I've been exploring the Midpoint algorithm for drawing lines and curves, and I have a quick question: How should you determine the fast direction for a curve? I've seen that if the shape is simple, ...
693 views

### Rounding corners of polygon given vertices of its corners

Given a polygon (regular or irregular, convex or concave), I want to round its corner, with a given radius; let's say 'x'. I have the code to draw an arc given 2 points, but how can I find the start ...
239 views

### Determining Vanishing Points of edges of Triangle using given Point

Due to perspective foreshortening, the projections of parallel lines (1D geometric objects) meet in their vanishing point (a 0D geometric object). Higher dimensional geometric objects also has higher ...
164 views

### Fill an irregular region with 2D shapes

I am creating a 2D CAD drawing generator in C# using .netDXF library. Given a area I want to fill it with rectangles/circles (convex). For example, the regions marked with numbers in below image. This ...
46 views

### Rectangle bounds of isometric object to isometric bounds

This might sound confusing, but this is what I'm trying to achieve: project to: I already have an algorithm in my mind, where we simply detect the corners touching the Cartesian rectangle and ...
467 views

### Explanation of the Marching Squares saddle points resolution

I was reading the Wikipedia entry on Marching Squares, and was confused by the explanation of the saddle point disambiguation: Ambiguous Case: Basically, given the saddle points, the ambiguity is ...
438 views

### Can draw.io type flowcharts be programmed?

I made this flowchart with draw.io: It was the first chart I made so it took me a while to make it. I need to be able to dynamically generate variations of this diagram programmatically. I wold need ...
50 views

### Successive lineTo(x, y) in JavaScript

When I was doing some graphic designing with JavaScript, I saw this strange behaviour. When I ran the following code (with proper HTML and JavaScript of course), ...
483 views

### What if we don't mention Modelview and projection matrix?

So I've been learning opengl for some weeks now and managed to understand all the viewing pipelines. As far my understanding goes we need to bring the object to world space and then the world space to ...
826 views

### Converting cartesian pixels to polar pixels

(I've largely revamped this entire question, though the motivation remains the same.) revised question I want to convert a raster of cartesian pixels into polar pixels. Is there a sensible ...
47 views

### distribute the bounding area into grid space

I have a bounding area of a contour after the slicing operation. Now to generate the tool-path over the contour, I need to distribute the bounding area into grid space so that each each cell maintain ...
81 views

### Optimal 2D graphics resource [closed]

I am a some-what experienced programer, and I have been working on creating a 3D graphics engine utilizing the OpenGL system, primarily focused on use in games. However, I also want to do some work ...