# Tag Info

Accepted

### Understanding Jump Flooding Algorithm (JFA) for Voronoi Diagrams

I think that there is a bit of confusion in terminology. My understanding is that only the initially colored points, before step 1, are called seeds. Maybe this helps clarify the algorithm as well. ...
• 306
Accepted

### Generate this kind of 2d burst or pulse algorithm?

Rather than using an image, I would suggest doing this kind of effect using a shader. I'm not familiar with Cocos2d-x, but some quick googling suggests that it can work with shaders. You'd use a pixel ...
• 25.1k

### Image rotation algorithm

It speed does not matter, I suggest to use a truncated sinc or a Lanczos isotropic kernel: to compute a target pixel, you back-rotate the filter and convolve it with the image. Since it is isotropic, ...
• 1,266
Accepted

### If you can use subdivision surfaces for 2D curves

Subdivision can be used for curves in 2D just as easily as for surfaces in 3D. Usually the subdivision algorithms applied to 2D are called subdivision curves. Subdivision curves do not suffer from the ...
• 1,283
Accepted

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

It comes down to history. The original interfaces for drawing stuff on the screen were for text, not images. Since the people who designed those early computers spoke languages that are read left-to-...
• 6,840
Accepted

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

The 2D pipeline involves ... [coordinate transformation terms] Can someone give me the detail differentiation among these? This is something I very recently learned while trying to understand how ...

### Linear independence of three points

Normalize $v_a$ and $v_b$ and your algorithm should no longer depend on the length of the edges, unless you consider numerical stability. As for the "best way", I'm not sure there's a much better ...
• 1,585

### Skia example code not writing an image

This never writes anything to the output file because you haven't included any code to write to the output file. The only time you touch the file after opening it is in the line ...
• 6,840

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

What they're using in this game is called an orthographic projection. It is a special type of a projection, which does not bend objects, it does not mean that they are not using 3D. Now, of course ...
• 223
Accepted

### human visual: relation of Distance and DPI

According to a review by Legge & Bigelow the arc or degrees of visual angle ($\alpha$) is, $$\alpha = 57.3 \times S/D,$$ where S is height of object and D is distance to object. [1] $S/D$ is ...
• 8,437
Accepted

### Area-light approximation in 2D

Found a solution—it may not be strictly accurate for 2D, but it produces the look that I’m after. “Linear Light Shading with Linearly Transformed Cosines”, in section 1.3, describes a closed-form ...
• 2,222
Accepted

### $P^2$ vs projection plane

In computer graphics the projection plane is most commonly defined as a plane perpendicular to the camera at a specific distance from the camera (the distance is often labeled $g$). It is the plane ...
• 3,239

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

You can solve the colors by solving a system of linear equations if you make few assumptions: The alpha of the color wheel is constant (i.e. same for all colors in the wheel) The beige background ...
• 3,636
Accepted

### OpenSCAD: Using outline of 2D shape

(5 years, 3 months later) You might like https://github.com/openscad/openscad/pull/4348 which adds a fill() builtin to do just this ... it just got merged :-)
• 136

### Calculate set of rectangles covering pixel diffs?

I would say it’s a weighted set covering problem. In specific, the cost for a set of points is the number of extra pixels in the bounding rectangle of this set. If the number of diff points is small,...
• 46

### How to prevent moire artifacts in this light casting algorithm?

In principle you avoid using scatter (casting) behavior with GPU. They have offered random output coordinate write out since only shader model 5 as a need for extreme situations. But you should as ...
• 623

### How can I implement GIMP's "Colorize" function?

It appears to me that in the image, the saturation of the original image is 0 since it is grayscale. (Unless I've misunderstood the question.) When the saturation is 0, the hue is undefined, but it ...
• 3,421
Accepted

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

On typical GPUs today it's option B: monitor rotation is done by the video output hardware ("display engine") during scan-out. In addition to rotating/flipping, the display engine can also scale the ...
• 25.1k

### Shader code for putting an atmosphere over a planet

I believe that Space Engine as a base algorithm still uses Precomputed Atmospheric Scattering by E. Bruneton. It is released on github. So it is good starting point if you want to implement ...
• 2,169
Accepted

### Unfold a 3D mesh to a 2D plane

When performing the unfolding the way you want, after you have unfolded one triangle in the plane, the next one should be one of the three triangles, adjacent to the unfolded one, i.e. the next ...
• 221
Accepted

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

The mistake was in the multiplication order during the composition of the matrices. Since the OP was working with column vectors the correct order for transformations should have been $TRSA∗v$. The ...
• 2,468

### Problems with Subdivision Surfaces

Both T-splines and subdivision surfaces are capable of handling an arbitrary topology input mesh, whereas NURBS can only handle meshes with regular topology. Complex NURBS objects are therefore made ...
• 1,283

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

There is some information about the XML file format used for .flame files. There are a number of forks of this program written in different languages, the original site is by definition the place to ...
• 256

### Rotate a Bitmap with Shearing

as paulHK said: One fundamental issue here is you're rotating in destination space rather than source space (e.g. apply the shear on source coordinates and output a rectangle). This way you can ...

### Rotating a Bitmap

You have to loop over destination pixels instead of source ones (gaps are the result of looping over source). For each destination pixel you can calculate position in source data, your code for pixel ...
• 71
Accepted

### How do I extrude a 2D Bezier curve representation into a 3D solid using Python?

You can't create a solid by extruding a single curve or set of curves. Even if they are closed. Think about a circle on on the XY plane. If you extrude the circle along the Z axis you have an uncapped ...
Accepted

### Raycasting wall slice height issue

You've made a classic mistake, not primarily in your raycasting, but in how you compute the rays. You wrote: ...
• 1,206
1 vote

### projecting 3d onto 2d plane is not showing up correctly

Your translate_coords_to_center(0,0) function should be done after you have done the projection from 3d to 2d. e.g. ...
• 2,322
1 vote

### Calculate the position and rotation needed to have a camera look at a certain region

I have a 2D region defined by 4 points in 3D space. I want to position my camera so that it looks at the region, with a settable variable determining which side it looks at,... The first thing you ...
• 1,251

Only top scored, non community-wiki answers of a minimum length are eligible