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
View trefwoorden-koppelen.md

Trefwoorden koppelen

RDF Turtle triples

@prefix tw: <https://archief.io/trefwoorden#> .
@prefix v: <https://archief.io/veld#> .
@prefix soort: <https://archief.io/soort#> .
@prefix aio: <https://archief.io/id/> .
@prefix cat: <https://commons.wikimedia.org/wiki/Category:> .
View Globe4D gx1000 perspective.pde
float w=1200, h=1200, wd2=w/2, hd2=h/2, wdh=w/h;
float distToCam = 1900;
perspective(atan(hd2/distToCam)*2, wdh, distToCam, 10000);
camera(0, 0, -distToCam, 0, 0, 0, 0, 1, 0);
scale(-1, 1, 1);
@companje
companje / guidsByTrefwoord.php
Created Apr 14, 2020
SPARQL query get GUIDs by Trefwoord
View guidsByTrefwoord.php
<?php
header("Content-type: text/json");
$trefwoord = $_GET["trefwoord"];
$sparqlquery = '
PREFIX veld: <http://archief.io/veld#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT distinct * WHERE {
@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 / 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 / ChromaticAberration.pde
Last active Feb 18, 2020
Chromatic Aberration with blueScaler and yellowDecrease
View ChromaticAberration.pde
#define PROCESSING_TEXTURE_SHADER
uniform sampler2D texture;
varying vec4 vertTexCoord;
//downscale the blue channel to correct
//for chromatic aberration of fish eye lens
const float blueScaler = 1 - (1 / 600.);
void main() {
//also decrease the amount of yellow towards outside
@companje
companje / loadPointsAndTriangles.pde
Last active Feb 18, 2020
Load Points and Triangles from textfile with Processing
View loadPointsAndTriangles.pde
//points = loadPoints("points.txt");
//triangles = loadTriangles("triangles.txt", points);
class Triangle {
PVector p[] = new PVector[3];
}
ArrayList<PVector> loadPoints(String filename) {
ArrayList<PVector> points = new ArrayList();
for (String line : loadStrings(filename)) {
@companje
companje / beeldbank-redirect.php
Last active Dec 16, 2019
beeldbank-redirect.php
View beeldbank-redirect.php
usage: ?guid=E3951481AF0A54C18999B79BE2449EC1 of via .htaccess
<?php
$apiKey = "b29fb3e4-5302-11e6-8975-2b551e9b96f4";
$guid = strtolower($_GET["guid"]);
if (strlen($guid)!=32) die("404");
$a = substr($guid,0,8);
$b = substr($guid,8,4);
$c = substr($guid,12,4);
$d = substr($guid,16,4);
You can’t perform that action at this time.