Wiki

Reso-nance numérique | Arts et cultures libres

Outils du site


Panneau latéral

projets:hyperstatic:accueil

Ceci est une ancienne révision du document !


hyperstatic

  • Porteur du projet : Moritz Führer moritzfuehrer
  • Date : 09/06/2017/ - …
  • Licence : CC-by-sa-3.0
  • Description : camera turning around a shiny reflecting metal ball in a evenly lightened white sphere to create a projection with a static image of the metal ball, its reflection that never changes even if the speed of the camera varies
  • Fichiers sources : mettre un lien
  • Lien : mettre un lien

Note d'intention

camera turning around a shiny reflecting metal ball in a evenly lightened white sphere to create a projection with a static image of the metal ball, its reflection that never changes even if the speed of the camera varies

hyperstatic

Notes techniques

Guide pas à pas et conseil pour la réalisation du projet.

Matériaux et outils

Liste de matériel et outils nécessaires.

Codes

Code Arduino

Processing

// A COMMENTER !
// .......
 
// Libs
import processing.video.*;
import processing.serial.*;
 
Capture videocam;
Serial myserial;       
 
// Setup
int W = 1280; //1920x1080 ou 1280x720 ou 1024x768
int H = 720;
int R = 30; // 15 ou 30
String CAM_NAME = "/dev/video2"; // a changer
String ARDUINO_NAME = "/dev/ttyUSB0"; // a changer
boolean DEBUG = false; // afficher la liste des ports série et résolutions de caméra
 
// Other variables
int sensorValue;
int lastSensorValue = 0;
int sensorTime;
int lastSensorTime =0;
PFont f;
String val;
float rpm;
 
void setup () {
 
  fullScreen(); // ou alors size (1280, 720, P2D);
  background(0);
 
  // Affichage des résolutions et des ports séries disponibles 
  if (DEBUG) {
    printArray(Serial.list());
    printArray(Capture.list());
  }
 
  // Arduino
  myserial = new Serial(this, ARDUINO_NAME, 9600);
 
  // Webcam
  videocam = new Capture(this, W, H, CAM_NAME, R);
  videocam.start();
 
  // Font
  f = createFont("SourceCodePro-Regular.ttf", 100);
  textFont(f);
  textAlign(CENTER, CENTER);
}
 
void draw () {  
  // Read Webcam
  if (videocam.available ()) {
    videocam.read ();
  }
 
  // Choose : "image (videocam, 0, 0)" ou "set(0, 0, videocam)"; 
  set(0, 0, videocam);
 
  // Display text
  String t = str((int)rpm) + " T/m";
  text(t, W/2, H/2);
}
 
// Read serial value (from Serial.write() in the Arduino program)
void serialEvent (Serial myPort) {
  sensorValue = myPort.read();
 
  // Find the RPM
  if (sensorValue != lastSensorValue) {
    sensorTime = millis() - lastSensorTime ;
    rpm = 60000 / sensorTime;
  }
 
  lastSensorTime = millis();
  lastSensorValue = sensorValue;
}

Photos

Code pour afficher les images du projet :

{{gallery>?&crop&lightbox}}
/home/resonancg/www/wiki/data/attic/projets/hyperstatic/accueil.1497025017.txt.gz · Dernière modification: 2017/06/09 18:16 de resonance