Skip to content

Instantly share code, notes, and snippets.

Avatar

Jean-François Renaud Morpholux

View GitHub Profile
View dashed_triangle.pde
// renaud.jean-francois(arobas)uqam(point)ca
// Syntaxe Processing version 3.5.4
// dimanche, 20 septembre 2020
import garciadelcastillo.dashedlines.*;
DashedLines dash;
PVector [] pts = new PVector[3];
int dist = 0;
@Morpholux
Morpholux / curve_vertex_closed_figure.pde
Created Apr 11, 2020
How to manage creation of a curved close figure, without any apparent joint in segments connection
View curve_vertex_closed_figure.pde
// renaud.jean-francois(arobas)uqam(point)ca
// Syntaxe Processing version 3.5.4
// samedi, 11 avril 2020
int nbSegments = 3; //at least three segments
PVector [] pts = new PVector[nbSegments];
void setup() {
size(600, 600);
background(0);
@Morpholux
Morpholux / blobby_shape.pde
Created Mar 5, 2020
Using curveVertex to create a blob type of closed shape
View blobby_shape.pde
// renaud.jean-francois(arobas)uqam(point)ca
// Syntaxe Processing version 3.5.4
// mercredi, 4 mars 2020
int numPoints = 7;
float[] posX = new float[numPoints];
float[] posY = new float[numPoints];
float radius;
float theta = TWO_PI / numPoints;
View effet_verre_cannele.pde
// renaud.jean-francois(arobas)uqam(point)ca
// Syntaxe Processing version 3.5.3
// jeudi, 19 septembre 2019
/*
Remake of an effect that I saw in a post on Facebook.
https://www.facebook.com/groups/creativecodingp5/permalink/2371544796426883/
*/
PImage img;
View square_rounded_pattern.pde
float [] deltas = new float [8];
void setup() {
size(800, 800);
background(0);
noStroke();
noLoop();
}
void draw() {
@Morpholux
Morpholux / constant_circular_orbit.pde
Last active Feb 5, 2019
Use of PVector to make an object rotate at constant speed around an origin point
View constant_circular_orbit.pde
// Constant circular orbit
PVector pos, zAxis;
float radius = 200, force = 10;
void setup() {
size(600, 600);
background(0);
noStroke();
pos = new PVector(radius, 0);
@Morpholux
Morpholux / shift_hsb_values.pde
Last active Sep 24, 2018
Manière de créer des recettes de couleurs apparentées à une référence
View shift_hsb_values.pde
// renaud.jean-francois(arobas)uqam(point)ca
// Syntaxe Processing version 3.4
// dimanche, 23 septembre 2018
// Pour réaliser une conversion du mode couleur avec la classe Java
// http://docs.oracle.com/javase/1.5.0/docs/api/java/awt/Color.html
import java.awt.Color;
float shiftHue = 0.1;
float shiftSat = 0.1;
@Morpholux
Morpholux / main_sketch.pde
Last active Jul 27, 2018
Code to handle multiple applets of the same sketch
View main_sketch.pde
// renaud.jean-francois(arobas)uqam(point)ca
// Syntaxe Processing version 3.3.7
// dimanche, 22 juillet 2018
// Multiple instances of the same sketch
// Base on GoToLoop’s solution for Multiple PApplet
// https://forum.processing.org/two/discussion/comment/43019/#Comment_43019
ArrayList <PApplet> applets = new ArrayList<PApplet>();
@Morpholux
Morpholux / gui_to_scale_rect.pde
Last active Jun 21, 2018
Rectangle scaling interface
View gui_to_scale_rect.pde
// 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 Jun 11, 2018
Chemin courbe en traits pointillés
View dashed_circle.pde
// 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