Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [graphics]

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

0
votes
0answers
14 views

CPU Barycentric rendering in JavaFX/Kotlin

I am writing a software renderer for the Kotlin port of Dear ImGui. In order to be feature complete, I needed to add barycentric coloring to some triangles for things such as color pickers. I have ...
1
vote
0answers
30 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
45 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
54 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 ...
6
votes
1answer
53 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 ...
0
votes
0answers
97 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 ...
9
votes
2answers
424 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 ...
4
votes
2answers
125 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
68 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
43 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
34 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
27 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
54 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
148 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
39 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
84 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). ...
10
votes
3answers
160 views

Generating image gauges from a value, min and max

One of the things I was recently investigating was the ability to generate "gauge" charts—that is, a chart which shows where a value stands within a range of values. As an example, if we know ...
3
votes
2answers
124 views

Math matrix, mainly for graphics

I wrote a matrix library to replace my old matrix library. I was using my old matrix library to do basic operations for 3D rendering but that library grew old and now I'm seeking to replace it. I'm ...
-1
votes
2answers
443 views

Adding text to video frames

I'm currently trying to add text to a video. To do so I've been manipulating each frame by adding text to each bitmap and then rendering a new video. ...
4
votes
0answers
43 views

TikZ: Arrow pointing to circle from inside through two points

Originally posted here; this comment suggested that I ask this question on this site instead. The code at the bottom produces the correct drawing, shown below. The issue is that I don't think I drew ...
1
vote
0answers
92 views

GLSL Simplex Noise with derivatives

I recently made 2d simplex noise based coherent noise in GLSL. [Here] is the shader toy. I wanted to make an implementation of simplex noise on the gpu in order to get better performance than the CPU ...
6
votes
2answers
115 views

Sims-style walls part 2: Flood fill

A follow up to this post. I've ported all of it to Unity, and generally cleaned it up a little, but looking over the code, the code for flood filling is messy and repetitive. Here's a visual of how it ...
6
votes
1answer
79 views

Drawing circles from array to a Form

I've actually been struggling with painting with VB.Net for a few weeks. All I know is that I shouldn't use CreateGraphics if I can avoid it, so I've done just that....
1
vote
0answers
91 views

Drawing a chessboard pattern using a nested for loop

I've been messing around with a software called Processing, used for user interactions and a lot of cool things. I programmed a pattern from a Chess set but I'm not sure if it's the best way to ...
2
votes
2answers
231 views

Drawing a castle and towers with acm.graphics

The following code is my solution of exercise 10 of chapter 5 of The Art and Science of Java. So here, using acm program and graphics, I need to draw a castle with two side towers and other three ...
2
votes
1answer
97 views

Voxel engine to draw cubes

I am an amateur in OpenGl and for this reason I am seeking to learn only modern OpenGl the 4.x stuff. Once I had completed basic tutorials (rotating cubes, for example) I decided I would try and ...
6
votes
2answers
661 views

Drawing a circle segment

I wrote code to draw a circle segment, such that the segment angle will be facing the mouse. My code: ...
2
votes
0answers
183 views

Draw a panel control with a sunken look

I am relatively new to visual studio. I am in the process of creating a custom control and the same time learning. I have put together the beginning of this control and will love to get some input. ...
4
votes
1answer
599 views

Drawing a word, with a box around one letter

I'm working on a draw function which needs to draw the word 'crux' in the center of the current view and then draw a red box around the 'x' character like this: My ...
0
votes
1answer
108 views

OpenGL framework “SOGL”

Here is my repo, pull requests are always welcome ^^ I know that OpenGL frameworks already exists (OGLPlus, for example) but I developing another one following this set of reasons: To understand how ...
4
votes
3answers
338 views

Simulating a closed particle system in Java

I have this program that simulates a closed particle system. Closed in this context means that the sum of all energies is constant. My primary concern is code itself, yet I would like to hear comments ...
3
votes
1answer
449 views

Java - fill triangle function

I am starting to work on a basic 3D renderer for fun, so right now I have made a triangle fill function to be used when I draw faces on models: ...
5
votes
2answers
213 views

2D SDL Asteroids-like game

I am writing an Asteroids clone in SDL2 using in C. I have written a game loop function that seems to work with no stutter, however I would just like to ensure my game loop will be fast and efficient ...
2
votes
1answer
254 views

Method to draw an open or closed polyline

I'm writing a simple 2D rendering class. Below is the method that creates a polyline. A polyline can be closed or not according to a parameter closed. ...
14
votes
1answer
203 views

Writing little package for rubber ducks in tikz

I'm currently working on a little latex package to bring rubber ducks into tikz (a continuation from https://tex.stackexchange.com/a/347458/36296). As this is the ...
2
votes
2answers
3k views

Java Drawing House

Can anybody tell me if there is a better way code this? As an exercise I was supposed to draw a simple house, and this is the main body of the code I have only I feel it could be way better but can't ...
3
votes
1answer
62 views

Binary values in hexidecimal notation written directly to video memory

In X86 Legacy boot loader prologue the first seven instructions preserve the state of the 8 general purpose and 6 segment registers. This is where they are displayed, right justified without leading ...
5
votes
1answer
578 views

CLIGL - A library for command line graphics

About a year ago I wrote a small library for drawing graphics on the windows command line. I mostly used it for small projects, like a raycaster and a raytracer. I just rediscovered it today, at the ...
5
votes
1answer
177 views

Conway's Game of Life in Win32/GDI

I've implemented Conway's Game of Life using the raw Windows API and GDI as an exercise. I'm wondering if there is room for improvement, though. Beware, large amount of code following: CGOL.h: <...
2
votes
0answers
25 views

Unit sprint mesh rendering

I have built this code in the past and I am reviewing it once again. I have a feeling that I could make the code much faster. Could someone please look at the code. What happens is that every time ...
1
vote
1answer
1k views

Draw grid programatically with borders

I need to draw a grid with some special requirements. My current solution is working but is far away from ideal I guess. Attached you can find the current working solution: Some of my thoughts which ...
2
votes
1answer
122 views

Create boustrophedon path in Matplotlib

I have following code that creates parallel swathes of specified sizes. Can someone suggest a better way of doing this? ...
3
votes
1answer
1k views

JavaScript implementation of Conway's Game Of Life With HTML5 Canvas

I've implemented Conway's Game Of Life with pure JavaScript and HTML5 Canvas. I'm not very good at JS patterns, so are there any ideas on how I can improve this code? For Online demo refer to this ...
0
votes
2answers
1k views

Optimize code use to drawing image

Below I have posted the code I use for drawing pictures. The problem is that when I want to generate more images in full hd size (in loop), the generation time increases significantly. Can somehow ...
7
votes
1answer
536 views

8086 ASM Bresenham's Line Algorithm Pt2

Following the successful review of my implementation of Bresenham's Line Algorithm, I've been asked to upload the full implementation of my project which creates a small animation of shapes moving ...
4
votes
1answer
346 views

FloodFill for Game Algorithm

I was wondering if this FloodFill algorithm was correct for this game I am trying to create it is in the selectColor method of my GameController.java class: ...
1
vote
0answers
105 views

Draw directional flow on html5 canvas grid/checkboard with respect to user defined size and limits

Ultimately I want to be able to draw a checkerboard (wall) of user-defined size. This wall is made up of tiles of a user-defined size. This main wall can then be split up into multiple sections (...
7
votes
2answers
587 views

8086 ASM Bresenham's Line Algorithm

As part of a first year university course in computer architecture some time ago we were tasked with learning 8086 ASM. The final course work required creating a small animation of shapes moving ...
7
votes
3answers
756 views

Car generation algorithm

I have an algorithm which generates some cars (quote unquote) and displays them using Graphics. I would like to know if my code is using Random correctly, and if it has any memory leaks. Or if there ...
3
votes
1answer
207 views

Using graphics to draw on form, in C#

I have a form, which I want to draw on-top some shapes. To be exact, rectangles and lines. This is the "Redraw" method. I call this method every 100ms from a different thread. ...