This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float map(float value, float min1, float max1, float min2, float max2) { | |
return min2 + (value - min1) * (max2 - min2) / (max1 - min1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///////////////////////////// | |
// NodeJS Server | |
///////////////////////////// | |
var express = require('express'); | |
var app = express(); | |
var http = require('http').Server(app); | |
var io = require('socket.io')(http); | |
var ss = require('socket.io-stream'); | |
var path = require('path'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//... | |
PVector axis = PVector.cross(lens, new PVector(0, 0, -1), null); | |
float angle = PVector.angleBetween(lens, new PVector(0, 0, 1)); | |
pushMatrix(); | |
rotate(angle, axis.x, axis.y, axis.z); | |
translate(0, 0, height/2-3); | |
noFill(); | |
stroke(0); | |
strokeWeight(5); | |
hint(DISABLE_DEPTH_TEST); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
ArrayList<Line> lines = new ArrayList(); | |
float downX, downY; | |
String title = ""; | |
void setup() { | |
size(400, 400); | |
loadLines("vmove.txt"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float d, r, eyeZ = 1900; | |
PShape sphere; | |
Quaternion qTo = new Quaternion(); | |
Quaternion qNow = new Quaternion(); | |
PVector anchorPoint = null; | |
ArrayList<PVector> points = new ArrayList(); | |
PVector center = new PVector(0, 0, 0); | |
PVector top = new PVector(0, 0, 1); | |
void settings() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Adafruit_NeoPixel.h> | |
#define LED_PIN 3 | |
#define LED_COUNT 163 | |
#define DELAYVAL 25 | |
int i=0; | |
Adafruit_NeoPixel pixels(LED_COUNT, LED_PIN, NEO_GRBW + NEO_KHZ800); | |
void setup() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PShape globe; | |
float w,h,eyeZ; | |
void setup() { | |
fullScreen(P3D); | |
w = width; | |
h = height; | |
eyeZ = 1460; // = h/2 + offset | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Quaternion q = new Quaternion(1, 0, 0, 0); | |
ArrayList<PVector> dots = new ArrayList(); | |
PImage tex; | |
PShape sphere; | |
PShader shader; | |
void setup() { | |
size(900, 900, P3D); | |
tex = loadImage("earth.jpg"); | |
sphere = createShape(SPHERE, height/2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Quaternion q = new Quaternion(1, 0, 0, 0); | |
PShape globe; | |
PImage tex; | |
ArrayList<PVector> points = new ArrayList(); | |
float radius; | |
void setup() { | |
size(800, 800, P3D); | |
tex = loadImage("earth.jpg"); | |
radius = height/2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PShader shader; | |
PImage tex; | |
PShape sphere; | |
PVector lensCenter = new PVector(0,0,1); | |
float zoom = 2; | |
void setup() { | |
size(1169, 1169, P3D); | |
tex = loadImage("1539.jpg"); | |
sphere = createShape(SPHERE, height/2); |
NewerOlder