Skip to content

Instantly share code, notes, and snippets.

View RobinMoretti's full-sized avatar
🏠
Working from home

Robin Moretti RobinMoretti

🏠
Working from home
View GitHub Profile
@RobinMoretti
RobinMoretti / paper-canvas.vue
Last active January 22, 2024 13:07
Simple PaperJs integration in a vuejs 3 component
<script setup>
import paper from "paper"
import { ref, onMounted } from 'vue'
const canvas = ref(null)
onMounted(()=>{
paper.setup(canvas.value);
var path = new paper.Path();
path.strokeColor = 'black';
@RobinMoretti
RobinMoretti / processing-randomMovingLineAndExportImage.pde
Last active October 2, 2023 18:38
Processing - Random moving line and image export
int startX, startY, endX, endY;
int red, green, blue;
void setup() {
startX = (width / 2) - 100;
startY = (height / 2) - 100;
endX = (width / 2) + 100;
endY = (height / 2) + 100;
@RobinMoretti
RobinMoretti / processing-circleWithMousePositionAndFillColor.pde
Created October 2, 2023 18:36
Processing - circle with mouse position and fill color
int circleFillColor = 0;
void setup() {
// la taille du canvas (fenêtre)
size(500, 500);
}
void draw() {
// les couleurs varient entre 0 et 255
circleFillColor = circleFillColor + 1;
@RobinMoretti
RobinMoretti / saveFrame.pde
Created October 10, 2023 05:46
Petit script pour enregistrer l'image du canvas à chaque click sur Processing
// https://processing.org/reference/saveFrame_.html
void mousePressed() {
// enregistre chaque frame -> screen-0001.tif, screen-0002.tif, etc.
saveFrame();
// ou
// enregistre chaque frame -> line-000001.png, line-000002.png, etc.
saveFrame("line-######.png");