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
1answer
236 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 ...
2
votes
0answers
61 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 ...
1
vote
0answers
22 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: ...
0
votes
0answers
43 views

convert ID3DXMatrixStack to DirectXMath

Is it right it convert ID3DXMatrixStack to DirectXMath like that: ...
0
votes
0answers
38 views

How can I make my resource mapping faster?

I have a Direct3D 11 application and recently I've started to implement a new feature on it, the UI(User Interface). It seems to work well, but I'm having one problem with optimization when it comes ...
0
votes
0answers
72 views

Is there a way to optimize this graphics/bitmap drawing code in C#?

I am not doing anything fancy so not sure if there are any tricks to make it faster. It's a progress bar where I draw some numeric text on top. I only draw 1 pixel height image and then resize it. But ...
7
votes
2answers
291 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 ...
6
votes
1answer
175 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 ...
2
votes
1answer
336 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:...
9
votes
2answers
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 (...
6
votes
3answers
686 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 ...
2
votes
0answers
49 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 ...
4
votes
1answer
117 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 ...
6
votes
1answer
95 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 ...
4
votes
2answers
479 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 ...
-3
votes
1answer
67 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....
3
votes
0answers
20 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 ...
2
votes
2answers
145 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 ...
1
vote
0answers
61 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 ...
6
votes
2answers
648 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 ...
5
votes
1answer
608 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: ...
4
votes
1answer
165 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 ...
2
votes
1answer
48 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 ...
4
votes
2answers
62 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 ...
1
vote
1answer
599 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 ...
3
votes
2answers
553 views

Snake game using graphics.py

I am a self taught python beginner for about 3 months and recently I finished my own snake game project. As seen from the code, it is not very efficient nor tidy to look at so I want to know if there ...
5
votes
1answer
132 views

Rust code of a tree fractal

I just picked up Rust recently and this is my first program (longer than 10 lines at least) so I'm looking for constructs that are more native and natural to Rust. I come from a c++/ python background....
6
votes
0answers
125 views

Julia set in Julia (and other fractals)

I've made the following to draw a series of zooming in images of a fractal. ...
6
votes
0answers
42 views

Drawing a line in any direction with pixels

I am doing an image drawing and rendering library, and would like some feedback on this code, it simply draws a line in any direction. The equation for that is: m = (y2 - y1) / (x2 - x1) b = y1 - m ...
2
votes
0answers
110 views

Improving rendering performance of 3D Voxel Game

Improving rendering performance of 3D Voxel Game Technical features added: Perlin Noise Generator 3D Explorable World (You can't break or place blocks) Free camera, you can fly and go through blocks ...
7
votes
0answers
469 views

Unity3D shader for rendering 2D sprites with a pseudo-glitch effect

I'm making a puzzle game in Unity with sprite-based graphics. When the game is paused, I want to hide most game elements, because I don't want the player to be able to pause and leisurely think about ...
5
votes
2answers
109 views

Class hierarchy for objects in a 3D engine

I am writing my own 3D engine. I initially made the code quick and dirty but after a while the code became pretty messy and it have a lot of repeating code so I am currently cleaning up some of the ...
3
votes
1answer
118 views

Plot ROC, PR, and PRI curves in C# using pre-calculated coordinates

I have written a small program in C# to plot ROC, PR (equal to AP) and ...
2
votes
0answers
376 views

DirectX11 Error Handling

I'm new to C++, been a C programmer most of my life. I wanted to get into graphics and Direct3D is C++ so I figured it was about time. I've been learning about strings, vectors, references, smart ...
9
votes
2answers
172 views

Maze generator for teaching Python 3

I am teaching programming (in this case - 1 on 1 tutoring of a teenager interested in programming) and this code will be a final stage of a progression toward program generating a maze. Any comments ...
2
votes
1answer
210 views

2-dimensional random walk simulator, draws the steps on a canvas

Here's what I came up with for a 2-dimensional random walk exercise. It takes a number of steps as input and iterates through them, while drawing every step as a line on the canvas. The direction is ...
1
vote
2answers
289 views

Drawing graphics and text using macOS Core Graphics

I have a small python project, which draws graphics and text onto a graphics context using MacOS's Core Graphics APIs. The idea is to make it easy for the user to write a few short lines, in order to ...
4
votes
1answer
58 views

Analyzing spoke overlaps during rotation: Round 2

Round 1: Analyzing spoke overlaps during rotation I previously posted this question, but I've changed a lot of the code since then. There was a mention of the previous being a bit mixed up, and things ...
6
votes
1answer
59 views

Analyzing spoke overlaps during rotation

For a personal project that I've recently started I have to analyze the rotation of two shapes with sets of spokes, where the spokes are evenly-spaced, and split into a given number. That is, if I ...
1
vote
0answers
869 views

Voxel Engine with Vulkan

Here is my voxel engine. I want some review for performance on the renderer. What can be improved? What must change? Also I'm not sure it is efficient to use vkWaitQueueIdle for syncing. The end goal ...
13
votes
2answers
617 views

Sierpiński's carpet fractal animation for teaching Python 3

I am teaching programming (in this case - 1 on 1 tutoring of a teenager interested in programming) and this code will be a final stage of a progression toward program generating a nice image of ...
5
votes
2answers
242 views

Portrait Painting Genetic Algorithm

Inspired by this article. I've been trying to learn more C# and OOP. Here is my take on a genetic algorithm as described in the article. Here are some of the results flower jelly lighthouse beach ...
4
votes
1answer
169 views

Drawing consecutive rectangles with an algorithm

I have an assignment to draw rectangles that get larger and larger each time I draw them. Just like shown below. I've labeled them TL = Top Left, TR = Top Right, BL = Bottom Left, BR = Bottom Right. ...
3
votes
0answers
519 views

Implementing Cyrus Beck algorithm for convex polygons

I have found the coordinates of the centroid for finding the direction of the normal vectors of the edges of the convex polygons. This method seems to work in the cases I tested. Is this fool proof ? ...
5
votes
0answers
50 views

CMYK shadings implementation for PGF

PGF is a graphics framework for \$\TeX\$ and friends. It supports shadings (gradients), but only in RGB. There is often a need to output shadings in CMYK and I am having a go at implementing this. I'...
1
vote
0answers
53 views

Drawing sprites and adding new ones

I have some code that draws sprites and and allows new ones to be added. To do this, I use 2 lists: 1 for the sprites that need to be drawn, and one for the new sprites that need to be added to the ...
3
votes
1answer
76 views

Generic pixel class to seamlessly alpha-blend and convert between different pixel structure layouts

Does what it says in the title. I just finished this and wanted to share with someone. Looking for possible optimizations, bugs (most of it is tested to work) or any constructive criticism. ...
5
votes
1answer
155 views

Animating a screw made up of elements

I am working on code to generate a screw made up of different elements and animating it by rotatation. The elements are so called conveying elements (denoted by GFA)...
3
votes
1answer
40 views

Tone Mapping image manipulation

This code is extremely slow and ideally I would appreciate someone walking me through getting this going on the GPU, but if nobody has time for that which is understandable, any and all optimisations ...
5
votes
1answer
101 views

Drawing a grid-based particle system

For some time now, I've been working on a game which is superficially similar in appearance to this one. A world is filled with particles that move and change state frequently (per frame, often). ...

1
2 3 4 5