Skip to content

Instantly share code, notes, and snippets.

Rick Companje companje

Block or report user

Report or block companje

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@companje
companje / map.glsl
Created Jan 23, 2018
map() function for GLSL known from Processing & openFrameworks
View map.glsl
float map(float value, float min1, float max1, float min2, float max2) {
return min2 + (value - min1) * (max2 - min2) / (max1 - min1);
}
@companje
companje / decrypt.py
Last active Mar 23, 2020
Experiment with Davinci version 3 protocol encrypt / decrypt / upload (based on pythreedub)
View decrypt.py
from Crypto.Cipher.AES import AESCipher, MODE_ECB, MODE_CBC
file = open("flatcube/flatcube-1-layer.3w", 'rb')
string = file.read()
enc_gcode = string[0x2000:]
aes = AESCipher("@xyzprinting.com@xyzprinting.com", mode=MODE_ECB, IV=chr(0)*16)
gcode = aes.decrypt(enc_gcode)
print gcode
@companje
companje / Restart Globe4D.bat
Last active Mar 9, 2020
Restart Globe4D (with taskkill / kill)
View Restart Globe4D.bat
@ECHO OFF
::KILL PREVIOUS INSTANCES
C:\Windows\System32\taskkill.exe /f /im javaw.exe
cls
::FIRST START DRIVER
CD C:\Users\Rick\Documents\Processing\Globe4D-AllianzDriver3\Globe4D\application.windows64\
Globe4D.exe
@companje
companje / PanZoom.js
Created Nov 1, 2018
Pan / Zoom P5.js
View PanZoom.js
//Zoom/Pan Component
//by Rick Companje, Nov 1, 2018.
//Enjoy!
var img;
var w, h, tow, toh;
var x, y, tox, toy;
var zoom = .01; //zoom step per mouse tick
function preload() {
@companje
companje / DUAL-4K-performance-test.pde
Created Mar 3, 2020
Rotating globe on DUAL 4K experiment performance test
View DUAL-4K-performance-test.pde
PGraphics pg;
PShape sphere, screen1, screen2;
float w=3840, h=w, hd2=h/2, wdh=w/h;
float distToCam = 1900;
void setup() {
fullScreen(OPENGL, SPAN);
pg = createGraphics((int)h, (int)h, OPENGL);
@companje
companje / CamTest.pde
Last active Mar 3, 2020
Kurokesu C1 Pro webcam cam camera (with modified firmware) + 1.25mm FishEye lens working in Processing
View CamTest.pde
import processing.video.*;
Capture cam;
void setup() {
size(640, 480, P3D);
cam = new Capture(this, 640, 480, "i Zone 1080p Starvis Camera");
cam.start();
}
@companje
companje / imageOnSphere.pde
Created Mar 3, 2020
imageOnSphere (prev known as 'sphereCap' - warps image onto a sphere)
View imageOnSphere.pde
PShape imageOnSphere(PImage img, float sphereRadius) {
//textureMode(NORMAL);
PShape sh = createShape(GROUP);
sh.setStroke(false);
float cx = img.width/2;
float cy = img.height/2;
float radius = img.width/2;
int rres = 30;
float rStep = radius/rres;
View orientateOnSphere.pde
void orientateOnSphere(PVector p) { // p doesn't have to be normalized
rotate(new Quaternion().fromVectors(new PVector(0, 0, 1), p));
translate(0, 0, p.mag());
float a = -(atan2(screen().y-screen(0, 100, 0).y, screen().x-screen(0, 100, 0).x) + HALF_PI); //angle van loodrechte vector
float b = atan2(-(screen().y-p.mag()), -(screen().x-p.mag())) + HALF_PI; //angle tov screen center
rotateZ(a + b);
}
@companje
companje / BarycentricColor.pde
Last active Mar 2, 2020
Barycentric Color - triangular interpolation - interpolate between three colors
View BarycentricColor.pde
PVector a = new PVector(100, 100);
PVector b = new PVector(200, 100);
PVector c = new PVector(150, 200);
color red = color(255,0,0);
color green = color(0,255,0);
color blue = color(0,0,255);
void setup() {
size(500, 500, P2D);
@companje
companje / MAIS-Flexis-archiefeenheidssoorten.csv
Last active Feb 26, 2020
Afkortingen van MAIS Flexis Archiefeenheidssoorten
View MAIS-Flexis-archiefeenheidssoorten.csv
Afkorting Archiefeenheidssoort
WINVERL Aanwinsten en verliezen
ADRS Adres
AFF Affiche
AFK Afkorting
AFKB Afkortingbeschrijving
AVIT Akte van indemniteit
AMBR Ambtenaar
ABK2 Archiefblok
ADS Archiefdoos
You can’t perform that action at this time.