Skip to content

Instantly share code, notes, and snippets.

View volfegan's full-sized avatar
💭
Still Operational

Daniel Leite Lacerda volfegan

💭
Still Operational
View GitHub Profile
@volfegan
volfegan / Ilumination_2DNormal_mapping.pde
Last active April 30, 2022 04:53
Pseudo 3D Illumination effect using 2D normal map images
//Selects a normal map image with naming convection: image_normal.xxx
//Tries to find the original image (image.xxx) by removing "_normal" if any exists.
//References:
//https://en.wikipedia.org/wiki/Normal_mapping
//https://github.com/leonardo-ono/Java2DNormalMapEffectTest/blob/main/src/Test.java
//https://learnopengl.com/Advanced-Lighting/Normal-Mapping
//https://ogldev.org/www/tutorial26/tutorial26.html
@volfegan
volfegan / Dissolving_image_effect.pde
Last active April 25, 2022 03:47
A burn/dissolving image effect that flows using either a 2D noise map or some image pixel brightness
//Reference:
//https://www.youtube.com/watch?v=cLkORfzQPEU
//https://github.com/leonardo-ono/Java2DIntegrationDisintegrationEffectTest/blob/main/src/Test.java
float flowValue=350;//354~255 (display full image), -54~Zero (no image)
float flowDirection=-1;//1 (re-creating) or -1 (burning/dissolving)
float[][] flowMap; //2D map of brightness on how to proceed the dissolving effect
PImage source;
@volfegan
volfegan / Pseudo3D_floating_spheres.pde
Created April 21, 2022 21:14
Oldschool pseudo3D floating spheres
//References:
//https://www.dwitter.net/d/11965
//https://www.dwitter.net/d/11981
float t;
void setup() {
size(1280, 720);
noStroke();
fill(0, 255, 0);
}
void draw() {
@volfegan
volfegan / GJK_algorithm.pde
Last active April 15, 2022 20:56
GJK algorithm for a simple 2D collision detection (Processing)
/* Function for GJK algorithm collision detection
* @author Volfegan Geist [Daniel Leite Lacerda]
* https://github.com/volfegan/GeometricAlgorithms
*/
/*
//Resources:
//https://www.youtube.com/watch?v=ajv46BSqcK4
//https://github.com/kroitor/gjk.c
//https://observablehq.com/@esperanc/2d-gjk-and-epa-algorithms
//https://en.wikipedia.org/wiki/Gilbert%E2%80%93Johnson%E2%80%93Keerthi_distance_algorithm
@volfegan
volfegan / Parabolic_Hadouken_Fire.pde
Last active December 17, 2021 19:31
Some parabolic Hadouken shooting fire
//https://www.youtube.com/watch?v=PqW1GOrVMS0
//https://www.dwitter.net/d/24463
//https://www.dwitter.net/d/24467
float d, t, beam, spread_wave=0;
void setup() {
size(1280, 720);
stroke(255);
noStroke();
clear();
}
@volfegan
volfegan / Pestis_algae.pde
Created December 13, 2021 21:48
Algae underwater floating shape
//https://www.youtube.com/watch?v=oeJd53nj7lk
float t, x, y, w;
void setup() {
size(1080, 480);
stroke(255);
fill(255);
}
void draw() {
clear();
t+=.1;
@volfegan
volfegan / abstractArtShadowsInWall.pde
Last active May 30, 2021 20:40
Procedural converging painting of some shadow+colour abstract art
//reference https://www.dwitter.net/d/22420
float f, k, t, w, X, Y;
void setup() {
size(1280, 720);
colorMode(HSB,360,255,255);
noStroke();
clear();
}
void draw() {
t+=.005;
@volfegan
volfegan / abstractArtBabylonTower.pde
Last active May 30, 2021 20:26
Procedural converging painting of the Babylon Tower
//remix of https://www.dwitter.net/d/22529
float f, h, k, p, q, t, X, Y;
void setup() {
size(1280, 720);
noStroke();
background(-1);
}
void draw() {
t+=.005;
for (float i=720; i>0; i--) {
@volfegan
volfegan / Image_to_ASCII_flow.pde
Last active January 27, 2024 13:57
Maps an image into different ASCII characters gradients that sometimes form a flow
//References
//Font: http://laemeur.sdf.org/fonts/
//http://paulbourke.net/dataformats/asciiart/
//https://youtu.be/AGR3sfOq2qc?t=5911
//Related
//https://github.com/odditica/ProcessingStuff/blob/master/ItsTerminal/ItsTerminal.pde
//https://github.com/JaceyPenny/ASCIIToImage/blob/master/Main.java
//ASCII gradient references
//"@MBHENR#KWXDFPQASUZbdehx*8Gm&04LOVYkpq5Tagns69owz$CIu23Jcfry%1v7l+it[] {}?j|()=~!-/<>\\\"^_';,:`. "
@volfegan
volfegan / Pseudo3D_TubularPerspective.pde
Created May 17, 2021 20:49
Very subtle pseudo3D tubular/cylindrical perspective effect on 2D images
//Reference:
//https://www.youtube.com/watch?v=E5hFPQrN_o4
//https://github.com/leonardo-ono/Java2DKriptokHorizontalBackgroundScrollTest/blob/master/src/View.java
float dx, dy; //direction of movement x, y
PImage img;
float[][] tubular;
void setup() {
size(1280, 720);