Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [graphics]

Use this tag for questions involving visual presentations, whether they are generated using bitmap or vector techniques.

Filter by
Sorted by
Tagged with
-4 votes
0 answers
43 views

Two body collision written in SFML [closed]

This program shows two objects that can be controlled with arrow keys, It's 569 lines. I have an 8 core CPU and this simple program takes around 30% of my CPU. I don't understand if SFML is causing ...
Resfe's user avatar
  • 1
0 votes
0 answers
36 views
+50

Simple drawing website using React

So I have recently started learning web dev (including React since a few days ago), and I have tried to implement a simple drawing website that lets you change the brush size, color, and save the ...
Tom Gebel's user avatar
  • 340
5 votes
1 answer
543 views

The Wu line drawing algorithm for anti-aliased lines optimization

I need to optimize the following function with low-level optimizations (No SIMD, Multithreading). I already applied a lot of optimizations and got it ~65% faster, but it is possible to get it 200% ...
Adyfe's user avatar
  • 59
7 votes
1 answer
195 views

A simple ray marcher for the command line

This is my attempt at creating a ray marcher for the command line for fun. I have some prior experience with C programming, although I'm far from being an expert, and little to no experience with ...
Knogger's user avatar
  • 173
2 votes
0 answers
89 views

Compute shader based Particle System

I'm experimenting with compute shaders and wrote the particle system. The emit shader now takes particle data from the constant buffer because I don't have randomizing functions implemented yet. That'...
Edziju's user avatar
  • 319
8 votes
1 answer
319 views

Basic Ray Tracer

This is my first self-guided programming project, and all the math used in the program is self-taught. I wanted to get a better understanding of how computer graphics worked, but I just feel more ...
Jonas Banks's user avatar
8 votes
4 answers
2k views

Plotting the Mandelbrot set efficiently

This is my Mandelbrot set program - it includes Smooth Coloring, perodicity checks, and my approach to biomorphs. I know of Edge Detection, but I couldn't find a simple explanation that I can ...
iogamesplayer's user avatar
0 votes
2 answers
138 views

Improving performance of mandelbrot set calculation

I am making a hobby OS, and I thought about adding a command for interactively rendering the Mandelbrot set. The "interactive" part is not really important, but I wanted to check if the ...
trxgnyp1's user avatar
  • 111
2 votes
0 answers
104 views

Create a Penrose tiling

I programmed this type of Penrose Tilings in javascript and the algorithm is 'simple': The cyan pentagon always have to draw the yellow losenge and the grey pentagon almost always have to draw two red ...
visionary's user avatar
3 votes
1 answer
90 views

Randomly rotate an image through right angles

I'm new to Python, and coming from Typescript, I tried to include types, but it's not obvious sometimes. Currently this is the way I type objects: Write own simple types Import type from a library ...
Minsky's user avatar
  • 249
1 vote
1 answer
214 views

Vulkan application to draw a triangle

I've been following the ever popular 'vulkan-tutorial.com' guide on Vulkan and the result is this program which draws a multicolored triangle. I'm interested in finding out how to make my code more ...
Red's user avatar
  • 171
5 votes
0 answers
488 views

Implementing a Basic Camera UI using WebGPU and JavaScript

Context I am currently in the process of throwing myself into learning graphics programming, and my chosen platform is using JavaScript and WebGPU. After successfully making a basic glTF JSON renderer ...
user2628206's user avatar
1 vote
2 answers
173 views

OpenGL: Rendering the same sprite several times

I've been trying to make refactor really simple 2d sprite engine in OpenGL. As a start, I'm trying to use instanced rendering to render several copies of the same sprite in a square formation across ...
Ruglord's user avatar
  • 13
1 vote
0 answers
158 views

Algorithm to draw a patterned line by traversing the path through points

So I was in need of a way to draw a patterned line that passes through several points on a 2D space, something that no Python library seems able to do out of the box (at least, the ones I've been ...
pepoluan's user avatar
  • 277
2 votes
1 answer
254 views

Shader Program OpenGL

I am new to OpenGL learning it on amazing website learnopengl.com I wanted to a convenient way to use shader programs thats why I created this struct, please review it. ShaderProgram.h ...
Hrant Nurijanyan's user avatar
4 votes
1 answer
74 views

Piece-wise radial uniformly random distribution of points around a reference point

I have been learning Asymptote, which is a vector graphics programming language. In addition to its nice integration with LaTeX and friends, it is capable of generating 3D rendered artworks. For a ...
user avatar
1 vote
1 answer
494 views

Create normals from triangulated surface

Objective I have a 3D face mesh triangulated. I have computed the midpoint of each triangle in the mesh, and I have the normal vector (n1, n2,n3) for each triangle. The objective is to create a 2D ...
Joker's user avatar
  • 111
4 votes
1 answer
885 views

Android + Kotlin advanced color picker (HSV and RGB)

For almost the past year, I have been working on a pixel art editor for Android. My pixel art editor was relying on an external library for its color picker. For 0.2.0, I wanted to change this by ...
thebluepandabear's user avatar
3 votes
1 answer
83 views

Radial gradient image generator

A function to create a radial gradient from one rgb colour to another and using rayon to improve performance. Are there better way to convert between some of the types / any obvious performance ...
Jacob's user avatar
  • 133
4 votes
1 answer
2k views

Efficiency of wgpu-based 2D Batch Renderer

I've been working on a WebGPU-backed Rust renderer that batches together 2D colored sprites. I hadn't gotten onto the "sprite" portion of it yet, but I'm already finding some performance ...
n77's user avatar
  • 41
1 vote
0 answers
137 views

An OpenGL backend for displaying a framebuffer of an emulator

Motivation I'm making an emulator. It has its own software framebuffer of size 320x240. Each frame is prepared internally from the emulator, and I just need a way to display it on a window, scaled to ...
xiver77's user avatar
  • 421
2 votes
0 answers
63 views

Recursive path drawing in Latex

I have some diagrams I'm drawing using tikz and I'd like to make a macro to draw them for me. I will describe it fully but here are some examples so you can follow along: The diagram has a number of ...
Sriotchilism O'Zaic's user avatar
5 votes
0 answers
127 views

A Python script that creates n-flakes

I have written a simple Python script that generates n-flakes using matplotlib. Wikipedia article on N-flake. I wrote two functions, one function generates pentaflake, the other generates hexaflake, I ...
Ξένη Γήινος's user avatar
3 votes
2 answers
1k views

Rendering primitive 2D shapes

I am currently creating my own 3D renderer (think something like OpenGL). As a first step, I created a mini program below to render primitive 2D shapes essential to 3D graphics: points, lines, and ...
Jimmy Yang's user avatar
1 vote
2 answers
70 views

Generate vertices and normals for a flat shaded cylinder

I would like to generate list of vertices and normals (with the correct indices) for rendering a cylinder barrel (I ommited the end caps for brevity). The normals should not be interpolated (flat ...
frankenapps's user avatar
4 votes
1 answer
108 views

Shorten a SVG file created with Inkscape

I often use Inkscape for generating SVG images. However, these images contain data which doesn't seem to affect the visual output, so I want to remove it. To do that, I wrote the following code: ...
Dornteufel's user avatar
5 votes
1 answer
2k views

Python module to print in printer

I made a code that simplifies the job of sending anything to print with the Windows API. The module has a Document object which stores a reference to the actual device context within it. You can ...
Dante S.'s user avatar
  • 153
2 votes
1 answer
133 views

Hough Circular Transform

I'm writing a very basic crater-detection code using Hough Circular Transforms. By far, the longest part of my code is actually doing the transform, which involves numerous nested loops/conditions. ...
Stuart Robbins's user avatar
4 votes
1 answer
2k views

4x4 double precision matrix multiply using AVX intrinsics (inc. benchmarks)

Benchmark An optimised 4x4 double precision matrix multiply using intel AVX intrinsics. Two different variations. Gist For quick benchmark (with a compatible system) copy paste the command below. Runs ...
Julius's user avatar
  • 171
2 votes
0 answers
74 views

Structuring a project that generates triangles inside triangles

Basically I made this completely useless program that generates triangles inside triangles. Its not perfect yet but my question is about the structure. I am generally happy with it but I want to know ...
Apple_Banana's user avatar
1 vote
0 answers
474 views

81 variations of the rounded rectangle

If we apply outward curving, inward curving, and no curving at all, individually to each of the 4 corners of the rectangle, we get next 81 variations: The code implements next BASIC command: ...
Sep Roland's user avatar
  • 4,438
6 votes
2 answers
424 views

Animal Storage TreeView - Tkinter

Bit of a pointless program (at the moment). It's intended more as practice for myself rather than anything else. General idea is that you add details of a particular cat or dog, and it'll update a ...
user avatar
6 votes
1 answer
679 views

ray-tracing in one weekend implementation

In the past I had followed the Ray Tracing in a Weekend books using C++ because that was what the book used. However, recently I started thinking about how hard it would be to implement using C and ...
nullptr's user avatar
  • 669
2 votes
1 answer
1k views

Converting an equirectangular image to a cubemap

I've written a program that does three things: Take an equirectangular image and ... ... cut horizontally-overlapping image areas. ... fill the image from the bottom with black so it has a ratio of 2:...
akuzminykh's user avatar
9 votes
2 answers
2k views

Can I draw a square with pixels more efficiently?

I'm drawing a square on a window using an implementation of Xlib. I put a colored pixel with my_pixel_put at a specific (...
lcols19's user avatar
  • 183
6 votes
3 answers
747 views

ad hoc logging in c++ projects

I am currently going through this Vulkan tutorial. An extra excercise was writing a function which checks if the hardware you are running on supports the extensions other libraries require (GLFW in ...
Edward's user avatar
  • 191
2 votes
0 answers
90 views

Super Compact Bresenham's Line Algorithm v2

I recently posted here about an implementation of the Besenham's line algorithm that I wrote. I've been hard at work improving it and redoing it from the ground up. However I still can't seem to beat ...
FatalSleep's user avatar
4 votes
1 answer
254 views

Super Compact Bresenham's Line Algorithm Variant

I wrote this variant of Bresenham's for fun. I am looking to see what I can optimize as it is still slower than Bresenham's. The idea here was that if I could isolate out the ...
FatalSleep's user avatar
6 votes
1 answer
122 views

Basic raytracer written in Rust

I come from a fairly strong background of C and thought that this project would be a good way to get a handle on Rust. Right now, I have everything in one file because I wasn't sure the best way to ...
Calvin Godfrey's user avatar
5 votes
2 answers
2k views

Menu for X11 using Xlib in C

I am learning the xlib library and I made a xmenu utility in order to practice it. It receives as input a menu specification where each line is a menu entry. Each line can be indented with tabs to ...
phillbush's user avatar
  • 864
-3 votes
1 answer
136 views

how to make 'for loop' short in C? [closed]

I made some code about solar system stimulation in C. It is working, but it looks too long. So, Are there some ways to shorten my code? Also this website told me your code is too full to upload this....
KORAE's user avatar
  • 17
3 votes
0 answers
31 views

Simple graphics library from Sparkle

The piston2d-graphics crate provides a trait, Graphics, which allows easy access to some graphics primitives. This would be a ...
wizzwizz4's user avatar
  • 323
2 votes
2 answers
158 views

Code for getting the coordinates of points on the chart

I am a beginner android developer. I am working on one of my applications. For this application, I wrote an algorithm that is needed to obtain data that is used to build a diagram. I have a list of ...
Destroyer's user avatar
  • 477
1 vote
0 answers
82 views

color and canvas implementations in Rust for Ray Tracer Challenge

I'm learning Rust by working through Jamis Buck's The Ray Tracer Challenge. The book instructs the reader on what to build in what order, and provides all required test cases. Included here are my ...
Nate Glenn's user avatar
6 votes
2 answers
857 views

Simulating a Solar System Using Command-Line Graphics

After a relative hiatus of around two years, I've decided to start delving back into the programming world; to start, I've appropriated one of my older projects, CLIGL, and have made a solar system ...
Ethan Bierlein's user avatar
5 votes
1 answer
786 views

Draw a spark line with SwiftUI

I am using a set of data points (currently randomly generated), and drawing a line graph inside a box: ...
coco's user avatar
  • 161
4 votes
1 answer
524 views

Single-player obstacle-avoidance space game

I was wondering what I could do to improve the gameplay of this game, as well as the graphics. I would like to use LWJGL, but the rendering library isn't important. I just need to find out ...
Rigidity's user avatar
  • 143
2 votes
1 answer
208 views

Speed up shapely buffer

I was asked to move the code here. I have different shapely.LineStrings like so: which I then buffer to create a polygon like ...
Izak Joubert's user avatar
4 votes
2 answers
91 views

Loading and drawing an image

I have some functions and structs for loading and drawing an image with OpenGL. The two main places I would like feedback are: I've tried to separate the OpenGL-specific code into the implementation ...
User319's user avatar
  • 1,132
1 vote
1 answer
2k views

Moving objects in loop in graphics.py

Currently I am trying to teach myself more about functions with parameters and return values that connects with one to another. In this code I created a square object with graphics.py that moves to ...
ifsoMarcus's user avatar

1
2 3 4 5