Questions tagged [2d]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
50 views

tilling the Hyperbolic plane

i am trying to tile a hyperbolic plane using the poincaré or Beltrami–Klein disk model. I am doing it recursively and i don't know how to detect overlapping tiles. I think they are causing bugs ...
Sedenion's user avatar
0 votes
1 answer
83 views

Can dxf Files Represent a Parametric Design?

dxf files emerge from various applications, for example Autocad, LibreCAD and so on. Sometimes a design should be flexible, e.g. one should be able to change one dimension of it and keep everything ...
melolontha's user avatar
2 votes
2 answers
97 views

drawing ellipse with rotation cause inaccurate result

i'am a junior in computer graphics , currently i learn how to draw ellipses with rotation . when i preform rotation with 90deg or 180deg nothing unusual happened , but when i try to rotate with any ...
0x00001F's user avatar
0 votes
0 answers
30 views

Why is my cube triangle glitching?

This is driving me absolutely insane, I am battered and defeated I'm following a tutorial on projection matrices and everything seems good......... except this ONE polygon. I have checked all 3 ...
Tallboy's user avatar
  • 101
3 votes
1 answer
111 views

Algorithms for rendering overlapping (floating) windows in 2D

I'm trying to figure out a solution to a problem that looked simple at first: how to render overlapping windows in a 2D windowing system. Originally I was thinking about implementing a text-based UI ...
LittlePilgrim's user avatar
0 votes
1 answer
183 views

Split a string of line segments into several other line segments

I have written a code to extend "n" points, constituting "n-1" lines ,to constitute more lines so you can map "m" data to "m" lines with m > n-1. This is the ...
Aminos's user avatar
  • 103
1 vote
0 answers
118 views

Turning colorized comic-art into uncolorized monochrome (line-art-inks-only B&W), not just very-light-grayscale

I'm trying to figure out how to go about removing the "colorization" of comic/cartoon/manga/etc drawn-art inputs where the black-ink strokes ("the line-art") are to be retained ...
Phil S.'s user avatar
  • 11
0 votes
0 answers
134 views

Good way of implementing an efficient tilemap renderer

I am new to graphics programming and I'm trying to create an efficient 2D tilemap renderer (using rust and wgpu (webgpu)). My current implementation My current implementation consists of: A Rust-Vec (...
Q4LEX's user avatar
  • 1
1 vote
1 answer
140 views

What does an algorithm which handles mesh-based image morphing look like?

In recent years, the technology of Live2D has become particularly popular and I have been attempting to find any papers or articles which explain what the mathematics for the mesh-based image morphing ...
MadCreativity's user avatar
1 vote
1 answer
313 views

3D homogenous coordinates versus 4D homogenous coordinates

We know that any 2D point $(x, y) $which represents as 3D homogeneous coordinates is of the form $(x, y, 1)$ which is the points of projective plane $P^2.$ If I use the same concepts for 3D points $(...
S. M.'s user avatar
  • 191
2 votes
1 answer
205 views

$P^2$ vs projection plane

I want to explain what I understood of definition of the two things. Projection plane: The general processing steps for modeling and converting a world coordinate description of a scene to device ...
user avatar
1 vote
0 answers
337 views

How to plot an ADC value from the Raspberry PI Pico using pythons matplotlib

Being new to Python and this community, I am trying to plot the pulse return from a transducer. The pulse return is 400 uSecs in duration and occurs every 100 milliseconds. So far I can plot the ...
R Bowles's user avatar
1 vote
1 answer
100 views

Area-light approximation in 2D

I’m trying to render a 2D image something like this: …where an arbitrary shape has its border illuminated by a line in a relatively physically accurate way, i.e. with less illumination reaching the ...
Noah Witherspoon's user avatar
0 votes
1 answer
47 views

How to ensure that a randomly-generated velocity vector moves the camera forward within a valid arc?

I spawn a camera in a scene using random coordinates for x and y and setting z=0 and orient ...
Amir's user avatar
  • 241
1 vote
1 answer
489 views

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

Where P is the control point, w is weight. I plan to extrude this 2d representation into 3d. I have a discrete 2D representation (array which has [n_points, 2, 1] for each sample) of an airfoil that ...
sarva's user avatar
  • 13
0 votes
1 answer
249 views

Rotate a Bitmap with Shearing

I am rotating a bitmap using the three shear algorithm documented in these articles [1][2]. From about 0-90°, the quality is acceptable, but beyond that it gets progressively more distorted until it's ...
Dr. Pontchartrain's user avatar
1 vote
1 answer
1k views

Rotating a Bitmap

I would like to rotate an bitmap image using math. I have two issues with my current implementation: the pixel-by-pixel rotation of the copied bitmap is extremely slow and it is leaving gaps between ...
Dr. Pontchartrain's user avatar
0 votes
0 answers
62 views

Is there an existing method to draw a heart of stars that looks more like a heart?

I wrote a C program which prints a heartbeat (heart star) animation. The key is to print a heart of stars, which looks like this consists of line of stars and blanks. ...
AlbertJ's user avatar
1 vote
1 answer
55 views

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

I am trying to learn about 3d graphics from first principles, so i have decided to implement a simple thing, create a circle in 3d space & rotate it along some axis. I understand the basics theory....
anekix's user avatar
  • 123
1 vote
0 answers
304 views

Combine box shadow with a signed distance field

I'm using 2d signed distance fields in my current project for drawing shapes (example: https://www.shadertoy.com/view/4llXD7) and I want to add drop shadows to them. At first I thought I could exploit ...
weichsem's user avatar
  • 111
0 votes
0 answers
58 views

What's a good research topic in Computer Graphics?

I am currently trying to find topics for my master's thesis. I would really like to do something in the field of computer graphics, but I've been having trouble finding what are some current problems ...
Richard's user avatar
0 votes
1 answer
81 views

How are digital painting canvas rendered?

Digital painting and raster graphics software like Krita and Photoshop have a canvas where you can paint with brushes. From a programming perspective, how is this canvas rendered? Can it be included ...
Burst's user avatar
  • 3
2 votes
1 answer
106 views

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, where looks at means that ...
GenRincewind's user avatar
2 votes
1 answer
1k views

Shader code for putting an atmosphere over a planet

I'm working on a game set in space with procedurally generated planets, and I'm trying to write a shader that puts an atmosphere over a planet given the color of the atmosphere and the strength of the ...
Earlh21's user avatar
  • 21
1 vote
1 answer
7k 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 ...
Himanshuman's user avatar
0 votes
1 answer
102 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 ...
Joshua Mitchell's user avatar
4 votes
2 answers
2k 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 ...
Anima's user avatar
  • 167
2 votes
0 answers
107 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 ...
James Ashton's user avatar
2 votes
1 answer
155 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 ...
J.Doe's user avatar
  • 1,445
2 votes
1 answer
245 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 ...
Lance's user avatar
  • 123
0 votes
1 answer
520 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 ...
Lance's user avatar
  • 123
2 votes
1 answer
1k 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 ...
Sandburg's user avatar
  • 123
3 votes
1 answer
128 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 ...
Mutant Bob's user avatar
1 vote
1 answer
79 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} = \...
rr84's user avatar
  • 105
0 votes
1 answer
243 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 ...
Gregorio Litenstein's user avatar
5 votes
1 answer
88 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) ...
Joakim Rosqvist's user avatar
0 votes
1 answer
367 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 ...
Daan's user avatar
  • 1
3 votes
1 answer
387 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 ...
user2742934's user avatar
2 votes
1 answer
74 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 ...
Colin's user avatar
  • 121
4 votes
1 answer
428 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 ...
sydd's user avatar
  • 253
2 votes
1 answer
278 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. ...
carlr's user avatar
  • 21
3 votes
1 answer
147 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 ...
Tina J's user avatar
  • 229
2 votes
1 answer
399 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 ...
DonGar's user avatar
  • 123
1 vote
0 answers
52 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 ...
Test's user avatar
  • 31
5 votes
0 answers
134 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 ...
Ibraim Ganiev's user avatar
0 votes
1 answer
2k 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 ...
user6371's user avatar
9 votes
1 answer
4k 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+...
Muad's user avatar
  • 165
3 votes
1 answer
168 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 ...
rr84's user avatar
  • 105
1 vote
1 answer
135 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 ...
Dave Kirkby's user avatar
3 votes
2 answers
1k 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 ...
rr84's user avatar
  • 105