8
votes
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. ...
4
votes
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-...
4
votes
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 ...
3
votes
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 ...
3
votes
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 ...
3
votes
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 ...
3
votes
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
...
3
votes
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 ...
3
votes
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 ...
3
votes
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 ...
2
votes
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,...
2
votes
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 ...
2
votes
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 ...
2
votes
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 :-)
2
votes
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 ...
2
votes
What graphic languages are simpler than SVG for database diagrams?
Graphviz is a popular tool for making network diagrams. It takes a text format ("DOT language") describing the nodes and edges as input, and can render the resulting diagram to SVG or other image ...
2
votes
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 ...
2
votes
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 ...
2
votes
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 ...
2
votes
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
votes
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 ...
2
votes
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 ...
2
votes
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 ...
2
votes
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 ...
2
votes
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
votes
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
vote
Accepted
How to ensure that a randomly-generated velocity vector moves the camera forward within a valid arc?
Something like this should work:
...
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.
...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
2d × 653d × 12
transformations × 10
algorithm × 10
2d-graphics × 10
mathematics × 5
computational-geometry × 5
glsl × 4
c++ × 4
image-processing × 4
vector-graphics × 4
rendering × 3
geometry × 3
color × 3
projections × 3
matrix × 3
bezier-curve × 3
raytracing × 2
compute-shader × 2
polygon × 2
camera × 2
line-drawing × 2
pixel-graphics × 2
curve × 2
affine-transformations × 2