Skip to content

Instantly share code, notes, and snippets.

View Morpholux's full-sized avatar

Jean-François Renaud Morpholux

View GitHub Profile
@Morpholux
Morpholux / gui_to_scale_rect.pde
Last active June 21, 2018 01:51
Rectangle scaling interface
// renaud.jean-francois(arobas)uqam(point)ca
// Syntaxe Processing version 3.3.7
// mardi, 19 juin 2018
// Rectangle scaling interface :
// Click and drag a pseudo cursor from any corners to change size accordingly.
// There is also a corner snap effect for the pseudo cursor,
// and some limitations (min-max) for the expanding or the contract size.
// Set variables to your needs
@Morpholux
Morpholux / dashed_circle.pde
Last active June 11, 2018 21:37
Chemin courbe en traits pointillés
// renaud.jean-francois(arobas)uqam(point)ca
// Syntaxe Processing version 3.3.7
// samedi, 9 juin 2018
// Ajustez au besoin
int steps_per_segment = 10; // il y a quatre segments courbe dans le cercle
float rayon = 280;
float centrex, centrey;
// Formule permettant d’établir la distance d’un levier dans une figure circulaire
@Morpholux
Morpholux / telegraphic_style_line_partition.pde
Last active May 10, 2018 03:53
Example of a simple drawing machine
// renaud.jean-francois(arobas)uqam(point)ca
// Syntaxe Processing version 3.3.7
// mercredi, 9 mai 2018
// Press spacebar to draw white lines segment while caret is moving.
color c = color(40);
int posX, posY;
int stepLength = 2;
int margin = 50;
@Morpholux
Morpholux / save_frame_with_timer_event.pde
Last active May 8, 2018 13:44
Example of a recording command dependent of a sensor value and regulated by a timer
// renaud.jean-francois(arobas)uqam(point)ca
// Syntaxe Processing version 3.3.7
// lundi, 7 mai 2018
// Global variables
boolean record = false; // not ready to record
boolean sensingState = true; // ready to trigger
int chronoStartingTime;
int recordDuration = 100; // in milliseconds
float sensorValue;
@Morpholux
Morpholux / sublime_triangle.pde
Last active December 21, 2017 18:03
Dessin d’un triangle d’or
// renaud.jean-francois(arobas)uqam(point)ca
// Syntaxe Processing version 3.3.6
// jeudi, 21 décembre 2017
// Sublime triangle (triangle d’or)
// golden ratio conjugate = 1 / φ:
float ratioPhi = 1/((1+sqrt(5))/2.0); // 0.6180339887
color teinte1 = color(170, 30, 100);
color teinte2 = color(255, 210, 0);
@Morpholux
Morpholux / hello_world_anim.pde
Last active December 17, 2015 18:59
Un programme destiné à animer l’une après l’autre les lettres d’une chaîne de caractères.
// renaud.jean-francois(arobas)uqam(point)ca
// Syntaxe Processing version 2.0b9
// jeudi, 23 mai 2013
PFont maPolice;
char[] alphabet = {
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
};