Questions tagged [2d]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
14
votes
6answers
543 views

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? ...
12
votes
1answer
9k views

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.
11
votes
2answers
743 views

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 "...
9
votes
2answers
837 views

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 ...
9
votes
0answers
217 views

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 ...
7
votes
1answer
333 views

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 ...
6
votes
1answer
349 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 ...
6
votes
1answer
1k views

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+...
6
votes
1answer
661 views

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 ...
5
votes
1answer
210 views

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 ...
5
votes
1answer
149 views

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 ...
5
votes
1answer
80 views

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) ...
5
votes
0answers
113 views

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 ...
4
votes
2answers
621 views

Why map Hammersley 2D set's (u,v) to sphere's (θ, φ) coordinates (and not to (φ, θ) )?

As explained in Holger Dammetz page Hammersley Points on the Hemisphere, the 2D coordinates (u,v) are usually mapped to the spherical coordinates (θ, φ). As a result, the coordinate "uniformly ...
4
votes
1answer
344 views

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?
4
votes
1answer
1k views

Image rotation algorithm

I would like to rotate a raster image by an arbitrary angle. I don't really care for speed: the rotation should be of highest quality possible. Could someone please suggest a suitable algorithm? I'm ...
4
votes
1answer
76 views

human visual: relation of Distance and DPI

I was told that human's visual sharpness is 60 pixels per degree. As such, pixel per inch is approximately given by: PPI = 1/ (Distance * tg((1/60*pi/180) ) Is ...
4
votes
1answer
180 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 ...
4
votes
2answers
629 views

Finding the nearest neighbor of polygons

I have a set of non-convex polygons and I want to merge them. I am able to find the connection between two polygons. If there are more than two polygons, one connection can intersect another polygon ...
4
votes
1answer
141 views

Remove clearly not visible vertices from a polygon

For a visibility algorithm I want to remove verts of polygon that are guaranteed not visible from a vert S. The idea is to remove pockets that points are on the backside of a plane formed by the ...
3
votes
1answer
272 views

Generate this kind of 2d burst or pulse algorithm?

I'm currently trying to develop a game using Cocos2d-x using C++. I really need to generate this burst or (donut-shaped) pulse. I'm having a difficult time how to generate such shape. At first, I was ...
3
votes
1answer
52 views

How do I interpret the format of the .flame files used by apophysis?

I pulled a .zip file from https://www.deviantart.com/clairejones/art/Apophysis-Starter-Flames-V-67029474 and the file I was interested was the .flame file which ...
3
votes
1answer
54 views

Calculate set of rectangles covering pixel diffs?

I'd like to develop a system for web animation similar to animated gifs, like this one. I capture a series of screenshots at fixed time intervals, and then I'd like to animate them. I can trivially ...
3
votes
1answer
118 views

How can I implement GIMP's “Colorize” function?

I have an RGB pixel that I'd like to colorize in my program (I'm using GLSL) very similar to how the GIMP "Colors > Colorize" function works. In my program, I can easily convert between RGB and HSV. ...
3
votes
2answers
136 views

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 ...
2
votes
1answer
56 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
64 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
0answers
69 views

OpenSCAD: Using outline of 2D shape

module initial(letter, size) { linear_extrude(height=size*4, center=true) { text(letter, size=size, halign="center", valign="center", font=font); } } I'm ...
1
vote
1answer
53 views

If you can use subdivision surfaces for 2D curves

I've seen how subdivision surfaces are good for 3D curves/modeling, but haven't seen anything on if it's good, or even usable, in 2D. My question is just that, if (a) you can even use subdivision ...
1
vote
1answer
659 views

Skia example code not writing an image

I am just trying to make a simple Skia program. A very simple program, but as I run this code, the output image file never writes anything. I am running this code on VS 2015 and included the skia.lib ...
1
vote
1answer
63 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
81 views

Why is pixel 0,0 at the top left of some formats and bottom left of others?

It seems that every image format (jpeg, png, tiff, bmp, jp2000...) doesn't place their origin at the same corner. Do you know where I could find some info about this differences? I can only say that ...
1
vote
1answer
112 views

What technique would I use to create fake 3d walls as seen in Realm of the Mad God

I wanted to make a little demo for a console with Realm of the Mad God esc graphics to brush up my C and SDL skills. One problem I'm running in to is creating the 3D walls. The console I'm ...
1
vote
1answer
38 views

Given a composited image, is it possible to find the color and opacity of an overlaid shape?

I have an image that I'm trying to recreate programatically using Pyx in Python. It seems that there's an overlaid circle covering the color wheel. I'm trying to see if there's a way to, given the ...
1
vote
1answer
113 views

What graphic languages are simpler than SVG for database diagrams? [closed]

This is PNG was exported from Inkscape. I created it manually and used the connector tool to link tables. I find the plain SVG for this diagram more complicated than I was expecting so would like to ...
1
vote
0answers
44 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 ...
0
votes
1answer
63 views

Problems with Subdivision Surfaces

It sounds like Subdivision Surfaces are better than NURBS but not as good as T-splines. I would like to know some of the disadvantages of Subdivision Surfaces, what they can't do or what they do ...
0
votes
1answer
43 views

Linear independence of three points

What is the best way to prove if three points are linear dependent? This is my current way to do it: $$\mathbf{v_a} = \mathbf{b}-\mathbf{a} \\ \mathbf{v_b} = \mathbf{c}-\mathbf{a} \\ \mathbf{v_c} = \...
0
votes
1answer
146 views

Distorted OpenGL graphics in certain models of Intel GPUs under Windows; possible causes?

I'm not sure this is the best place to post this, but it definitely seemed more appropriate than programming. I'm one of the developers of Performous, essentially a karaoke (and instruments) game. We ...
0
votes
1answer
32 views

How to make the lines of a (binary) image dotted or dashed?

Let's say I had a binary image (i.e. only contains black and white pixels). For example, this one: How would I make all the lines in this image dotted or dashed? In other words, the eyes would be ...