Questions tagged [2d]

61 questions
22
votes
1 answer

World coordinates, Normalised device coordinates and device coordinates

Can I get to know the difference between the three? A good example would add up too.
Anish Sharma
  • 323
  • 1
  • 2
  • 4
15
votes
6 answers

How to produce simple 2D illustrations to accompany geometry answers?

In my answer about Affine Transformations I made some little illustrations to help the explanation. How do you make an upload-able PNG quickly which expresses a geometrical or mathematical idea? This question was contrived to support my postscript…
luser droog
  • 1,328
  • 2
  • 12
  • 27
12
votes
2 answers

Hardware-accelerated drawing of curved shapes

How to quickly draw a curved shape? by "quickly" I presume one should use hardware facilities as much as possible by "curved" I mean boundaries defined by either quadratic or cubic Bezier curves by "shape" I mean either a "fat" stroke (i.e. more…
Ecir Hana
  • 1,459
  • 11
  • 20
11
votes
1 answer

Choosing width of data for signed distance field texture

A signed distance field texture is a technique where you store the distance from a pixel to the surface of a shape within the color information for that pixel, allowing almost vector graphics quality rendering using textures…
Alan Wolfe
  • 7,711
  • 3
  • 29
  • 72
10
votes
2 answers

Fundamentally, how are 2D bitmaps rendered?

Suppose we have a 64-bit word-addressable computer and we want to program it to output a 5x7 character stored as a binary image bitmap (such as the one below) to a memory-mapped display. Since we have 5 x 7 = 35 pixels per character, we could…
user1735
  • 101
  • 3
9
votes
1 answer

Understanding Jump Flooding Algorithm (JFA) for Voronoi Diagrams

I'm having trouble understanding the JFA. As far as I understood the algorithm, it walks log(n) times through every pixel (no matter if it is a seed or not) and looks at that pixel's neighbors in $(x+i, y+j)$ where $i,j \in \{-step\ length, 0, step\…
Muad
  • 165
  • 1
  • 7
8
votes
1 answer

How to invert an affine matrix with small values?

I'm using an affine transformation matrix to transform 2D coordinates from screen (magnitude 10e3) to small parts of fractal sets (magnitude as little as 10e-15). I also need to map the other way round, so I simply invert the matrix. It works when…
7
votes
1 answer

Calculating intersection of polyline and line

I have a convoluted polyline composed of vertices and straight segments and a separate point that is independent of the polyline. I am trying draw a straight new line from the point at a given angle and determine if the new line intersects the…
7
votes
1 answer

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 rectangle. This set up works great except when I…
5
votes
1 answer

What part of the graphics chain rotates computer displays when in portrait mode?

When the display hardware is physically rotated 90 degrees, your graphics can still be rendered with the correct side up. Where is this rotation accomplished? I can imagine a few possibilities: A) The code for every low-level graphics primitive…
5
votes
0 answers

Is there any open-source implementation of n*log(n) visibility graph construction algorithm?

Is there any open-source implementation of n*log(n) visibility graph construction algorithm? I'm trying to understand S. K. GHOSH and D. M. MOUNT sweep line algorithm, but it's known for having very hard implementation. It would be great if I saw at…
Ibraim Ganiev
  • 393
  • 1
  • 5
5
votes
1 answer

Different types of Gaussian blur?

The Gimp has two different options in how you can perform Gaussian blur: "IIR" and "RLE". What's the difference between them?
Mark
  • 1,572
  • 15
  • 21
5
votes
1 answer

How to get polygon coordinates in screen space

I need to be able to click on this polygon in 2d. This polygons set of vertices aren't in the same space as the screen. (Ie: the edge of the screen may be a value of 20 in one space but 1920 in the other) the scale is different. How can I convert…
Andrew Wilson
  • 828
  • 7
  • 14
4
votes
2 answers

Unfold a 3D mesh to a 2D plane

I'm trying to unfold a 3D mesh onto a 2D plane. My general idea to do this, would be to cycle through all the faces of the meshes and perform a hierarchical transformation. So I would start at the first face and transform it's vertices to the plane,…
Anima
  • 167
  • 7
4
votes
1 answer

How to prevent moire artifacts in this light casting algorithm?

I am writing a 2D light casting algorithm with OpenGL compute shaders. The algorithm is simple: For each light source shoot out light rays from it, the ray begins at the light coordinates, it ends at a pixel in a circle around the light source (the…
sydd
  • 253
  • 1
  • 4
1
2 3 4 5