Questions tagged [2d-graphics]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3
votes
0answers
37 views

2D metaballs with marching squares and linear interpolation

I struggle do understand how linear interpolation works in the marching square rendering algorithm context. I created simple example in GDScript (Godot) of random floating metaballs to demonstrate ...
0
votes
1answer
57 views

Apply Projective Transformation 2D Rectangle

I want to write code from scratch about Projective Transformation in order to apply this transformation to 2d rectangular. I searched about this transformation, but I could not figure out completely. ...
1
vote
0answers
23 views

How are 2D graphics rendered in HTML canvas

I was making some circles in the HTML Canvas element and the circles were so smooth. In a sense that you cant see any vertices. I normally work in unity and I you make a shape in 3d you most of the ...
0
votes
0answers
16 views

Explanation request for a GDI code block

I have a small old code snippet where I am not sure what is actually someone wanted to do. As I am not doing and trial and error guessing dvelopment. I have to be certain about the purpose could do ...
0
votes
0answers
190 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.
0
votes
0answers
45 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, ...
0
votes
0answers
47 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.
3
votes
1answer
47 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 ...
0
votes
0answers
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 ...
1
vote
1answer
1k 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 ...
1
vote
1answer
134 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?
2
votes
0answers
71 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 ...
2
votes
1answer
78 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 ...
2
votes
0answers
34 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 ...
1
vote
1answer
544 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 ...
4
votes
1answer
183 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 ...
1
vote
0answers
491 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 ...
1
vote
1answer
785 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 ...
1
vote
0answers
212 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 ...
1
vote
0answers
54 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
1
vote
1answer
161 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, ...
5
votes
3answers
947 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 ...
4
votes
1answer
285 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 ...
1
vote
1answer
204 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 ...
1
vote
0answers
47 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 ...
4
votes
1answer
530 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 ...
3
votes
0answers
569 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 ...
3
votes
1answer
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), ...
4
votes
1answer
591 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 ...
6
votes
2answers
998 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 ...
1
vote
0answers
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 ...
1
vote
1answer
88 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 ...
2
votes
0answers
58 views

Perspective Translation Of Quadrilateral

I have mapped four rectangular point(R1->R4) to four quadrilateral points(Q1->Q4) to generate a perspective view. Now I have to translate quadrilateral in x and y direction while maintaing perspective ...
3
votes
2answers
722 views

Line segments overlapping

I have implemented line segments intersetion test and at the very same test I want to include the fact that if two line segments overlap each other partially or fully , it will be flagged as no ...