Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [2d]

The tag has no usage guidance.

2
votes
1answer
49 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 ...
1
vote
1answer
44 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 ...
0
votes
1answer
54 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 ...
1
vote
1answer
77 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 ...
3
votes
1answer
40 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 ...
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
143 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 ...
5
votes
1answer
79 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) ...
1
vote
1answer
101 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 ...
4
votes
1answer
145 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 ...
3
votes
1answer
47 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 ...
6
votes
1answer
172 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 ...
3
votes
1answer
101 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. ...
4
votes
1answer
69 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 ...
2
votes
0answers
48 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
0answers
39 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 ...
6
votes
0answers
106 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 ...
1
vote
1answer
512 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 ...
7
votes
1answer
999 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+...
5
votes
1answer
138 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 ...
1
vote
1answer
107 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 ...
4
votes
2answers
503 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 ...
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 ...
5
votes
1answer
981 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
240 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 ...
7
votes
1answer
577 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 ...
10
votes
0answers
193 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
229 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 ...
5
votes
2answers
550 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 ...
5
votes
1answer
136 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 ...
11
votes
1answer
7k 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.
6
votes
1answer
309 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 ...
9
votes
2answers
715 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 ...
14
votes
6answers
521 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? ...
4
votes
1answer
308 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?
11
votes
2answers
649 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 "...