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 / getBounds.pde
Created Dec 2, 2019
getBounds from points
View getBounds.pde
Rectangle getBounds(ArrayList<PVector> vv) {
if (vv.size()==0) return new Rectangle();
float xMin = Float.POSITIVE_INFINITY;
float yMin = Float.POSITIVE_INFINITY;
float xMax = Float.NEGATIVE_INFINITY;
float yMax = Float.NEGATIVE_INFINITY;
for (int i=1; i<vv.size(); i++) {
xMin = min(xMin,vv.get(i).x);
yMin = min(yMin,vv.get(i).y);
xMax = max(xMax,vv.get(i).x);
@companje
companje / edges.pde
Last active Nov 26, 2019
Finger Tracking based on Edge Finding
View edges.pde
import processing.video.*;
import gab.opencv.*;
OpenCV opencv;
PImage src, canny, scharr, sobel;
Capture cam;
void setup() {
//src = loadImage("1021.png");
size(640, 480);
@companje
companje / Distributed-points-dome.pde
Last active Nov 23, 2019
Distributed points on Dome / Sphere
View Distributed-points-dome.pde
import org.processing.wiki.triangulate.*;
PShape dome;
float w=1200, h=1200, wd2=w/2, hd2=h/2, wdh=w/h, cx=wd2, cy=hd2, r=hd2, d=h;
float distToCam = 1200; //1040; //fisheye=1900, mirror=1040;
float globeScaler = 1.02;
ArrayList<PVector> points;
ArrayList<Triangle> triangles;
void settings() {
@companje
companje / tip-draw-ellipse-instead-spheres-as-marker.pde
Last active Nov 23, 2019
Tip: distortion when drawing markers on a sphere
View tip-draw-ellipse-instead-spheres-as-marker.pde
/*
When you want to draw markers on a sphere keep in mind that 3D markers (like spheres and boxes) are distorted because you see their top as well as their sides instead of just their top.
*/
perspective(atan(r/distToCam)*2, wdh, distToCam, 10000); //fov=35deg //atan(hd2/distToCam)*2
camera(0, 0, -distToCam, 0, 0, 0, 0, 1, 0);
scale(-1, 1, 1);
background(0);
@companje
companje / TwoCams.pde
Created Nov 23, 2019
Two cams / cameras
View TwoCams.pde
import processing.video.*;
Capture cam1, cam2;
void setup() {
size(1280, 480);
//printArray(Capture.list());
cam1 = new Capture(this, "name=HD Pro Webcam C920,size=640x480,fps=30");
//cam2 = new Capture(this, "name=BRIO 4K Stream Edition,size=640x480,fps=30");
cam2 = new Capture(this, "name=Logitech Webcam C930e,size=640x480,fps=30");
cam1.start();
@companje
companje / countries.txt
Created Nov 6, 2019
countries with data
View countries.txt
AGCS
AGI
Allianz RE
Australia
AZP
Belgium
Brazil
Bulgaria
China
Czech Republic
@companje
companje / Restart Globe4D.bat
Created Oct 30, 2019
Restart Globe4D (with taskkill)
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 / mouse-sphere-perspective.pde
Created Oct 29, 2019
Mouse On Sphere In Perspective
View mouse-sphere-perspective.pde
float distToCam = 1040; //1900
float w=1200, h=1200, wd2=w/2, hd2=h/2, wdh=w/h;
void settings() {
fullScreen(P3D);
}
void setup() {
surface.setSize(1200, 1200);
surface.setLocation(360, 0);
You can’t perform that action at this time.