Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
wiki:flossmanuals:boitier-interactif-01:accueil [2021/05/30 08:08] damien.muti |
wiki:flossmanuals:boitier-interactif-01:accueil [2021/10/31 15:23] (Version actuelle) lise [Boîtier Interactif : Apprendre la profondeur dans un tableau] |
||
---|---|---|---|
Ligne 3: | Ligne 3: | ||
* **Date** : 03/2021 | * **Date** : 03/2021 | ||
* **Contexte** : projet " | * **Contexte** : projet " | ||
- | * **Fichiers** : | + | * **Fichiers** : {{ : |
* **Lien** : | * **Lien** : | ||
* **Capteurs/ | * **Capteurs/ | ||
Ligne 16: | Ligne 16: | ||
====== Intentions : explication du projet et objectifs ====== | ====== Intentions : explication du projet et objectifs ====== | ||
- | Dans le cadre d'un projet avec le musée des Beaux Arts, l' | + | ==== Le Contexte ==== |
- | ====== | + | Commande |
+ | Chaque élève propose des dispositifs qui pourraient s’insérer | ||
+ | ==== Les Objectifs | ||
+ | Permettre aux enfants d’appréhender la profondeur, la perspective, | ||
+ | ==== Le Dispositif ==== | ||
+ | Une tablette / un ordinateur tactile affiche le tableau d’Émile LOUBON. Elle est reliée à un boitier Arduino, avec des sliders, des potentiomètres et un capteur de distance. Ceux-ci permettent à l’utilisateur de déplacer un personnage dans le tableau. | ||
+ | Il peut le faire de deux différentes manières : | ||
+ | |||
+ | - de haut en bas : le personnage change de taille et de saturation | ||
+ | |||
+ | - de droite à gauche : le personnage ne change pas | ||
+ | |||
+ | Ainsi, le médiateur peut se servir du boitier pour démontrer la perspective aux enfants. | ||
+ | Ensuite, les enfants volontaires peuvent passer à tour de rôle pour s’en servir pendant que leurs camarades se servent du kit tampographique. | ||
+ | ====== Plans et schémas de fonctionnement ====== | ||
+ | {{ : | ||
====== Programmes ====== | ====== Programmes ====== | ||
===== Arduino ===== | ===== Arduino ===== | ||
Ligne 168: | Ligne 183: | ||
</ | </ | ||
===== Processing ===== | ===== Processing ===== | ||
+ | ==== Programme initial ==== | ||
Le programme Processing a pour but de récupérer les différentes données envoyées par la carte Arduino. Chaque donnée constitue un paramètre d' | Le programme Processing a pour but de récupérer les différentes données envoyées par la carte Arduino. Chaque donnée constitue un paramètre d' | ||
+ | |||
+ | Le rendu est le suivant : | ||
+ | {{ : | ||
Le programme est le suivant : {{ : | Le programme est le suivant : {{ : | ||
Ligne 181: | Ligne 200: | ||
int[] serialInArray = new int[NbData]; | int[] serialInArray = new int[NbData]; | ||
int serialCount = 0; // A count of how many bytes we receive | int serialCount = 0; // A count of how many bytes we receive | ||
- | int xPerso, yPerso, | + | int ChoixPerso, CouleurPerso, |
boolean firstContact = false; | boolean firstContact = false; | ||
- | PImage loubon; | + | float xPerso, yPerso, sPerso; |
- | PImage bouvier; | + | PImage |
+ | color c =color(# | ||
+ | int r = 25, g = 42, b=118; | ||
+ | PImage imgMask; | ||
void setup() { | void setup() { | ||
size(1000, | size(1000, | ||
noStroke(); | noStroke(); | ||
- | colorMode(HSB); | + | |
// Initialisation des variables | // Initialisation des variables | ||
ChoixPerso=0; | ChoixPerso=0; | ||
CouleurPerso = 0; // | CouleurPerso = 0; // | ||
- | xPerso = width/2; // Slider 1 | + | xPerso = 0.76*width; // Slider 1 |
- | yPerso = height/2; // Slider 2 - Distance | + | yPerso = 0.84*height; // Slider 2 - Distance |
- | sPerso = 250; //Taille du personnage | + | sPerso = 2000; //Taille du personnage |
- | bouvier = loadImage(" | + | SaturPerso = 255; |
+ | bouvier = loadImage(" | ||
loubon= loadImage(" | loubon= loadImage(" | ||
+ | img = createImage(bouvier.width, | ||
+ | image(loubon, | ||
+ | colorMode(HSB); | ||
// Print a list of the serial ports, for debugging purposes: | // Print a list of the serial ports, for debugging purposes: | ||
printArray(Serial.list()); | printArray(Serial.list()); | ||
+ | imgMask = loadImage(" | ||
+ | imgMask = createImage(bouvier.width, | ||
// I know that the first port in the serial list on my mac | // I know that the first port in the serial list on my mac | ||
// is always my FTDI adaptor, so I open Serial.list()[0]. | // is always my FTDI adaptor, so I open Serial.list()[0]. | ||
Ligne 213: | Ligne 238: | ||
void draw() { /////////////////////////////////////// | void draw() { /////////////////////////////////////// | ||
- | background(loubon); | ||
- | // | ||
- | // Draw the shape | ||
- | // | ||
- | if (ChoixPerso == 0) { | + | |
- | bouvier = loadImage(" | + | image(loubon, |
+ | | ||
+ | bouvier = loadImage(" | ||
+ | img.mask(imgMask); | ||
} | } | ||
if (ChoixPerso == 1){ | if (ChoixPerso == 1){ | ||
- | | + | |
+ | | ||
} | } | ||
if (ChoixPerso == 2){ | if (ChoixPerso == 2){ | ||
- | | + | |
+ | | ||
} | } | ||
- | image(bouvier, | + | |
+ | for (int i = 0; i < bouvier.pixels.length; | ||
+ | int r_i = (bouvier.pixels[i] >> 16) & 0xFF; // Faster way of getting red(argb) | ||
+ | int g_i = (bouvier.pixels[i] >> 8) & 0xFF; | ||
+ | int b_i= bouvier.pixels[i] & 0xFF; // Faster way of getting blue(argb) | ||
+ | if (r_i == r && g_i == g && b_i == b) { | ||
+ | float h = CouleurPerso; | ||
+ | //float h = 128; | ||
+ | float s = SaturPerso; | ||
+ | float b =brightness(bouvier.pixels[i]); | ||
+ | |||
+ | // | ||
+ | |||
+ | img.pixels[i] = color(h, s, b); | ||
+ | } | ||
+ | |||
+ | img.updatePixels(); | ||
+ | |||
+ | } | ||
+ | |||
+ | |||
+ | | ||
+ | |||
+ | image(img, xPerso, yPerso, sPerso, sPerso); | ||
} | } | ||
Ligne 255: | Ligne 304: | ||
ChoixPerso=serialInArray[0]; | ChoixPerso=serialInArray[0]; | ||
CouleurPerso = serialInArray[1]; | CouleurPerso = serialInArray[1]; | ||
- | xPerso = serialInArray[2]*3-50; | + | xPerso =0.2*width +2*serialInArray[2]; |
- | yPerso = serialInArray[3]+100; | + | yPerso = 0.53*height + serialInArray[3]; |
- | sPerso = serialInArray[3]*2+100; | + | sPerso |
+ | SaturPerso | ||
| | ||
// print the values (for debugging purposes only): | // print the values (for debugging purposes only): | ||
- | println(ChoixPerso + " | + | println(ChoixPerso + " |
| | ||
// Send a capital A to request new sensor readings: Envoie d'une letter " | // Send a capital A to request new sensor readings: Envoie d'une letter " | ||
Ligne 270: | Ligne 320: | ||
} | } | ||
</ | </ | ||
+ | |||
====== Réalisation de la maquette ====== | ====== Réalisation de la maquette ====== | ||
vidéos, photos du making of... | vidéos, photos du making of... | ||