segunda-feira, 2 de maio de 2011

Trabalho de Arte Digital Interativa em grupo

Inicialmente, temos como objetivo trabalhar o medo e os sentidos das pessoas em um meio desconhecido.
Pretendemos utilizar projeções de matos,moitas, ou florestas em um quarto escuro, onde que o usuário fique cercado por estas projeçoes.Conforme a direção que o usuário pisar, por exemplo, o mato começara a se mexer como se tivesse algo escondido, entretento, quando pisar em determinado local um fantasma ou alma aparecerá distante, entretanto irá se aproxiar como se fose atacar a pessoa que estiver ali.

Equipamento necessário:
Computador
Tapete direcional PS2 junto a adaptador usb
Projetores
Webcans

Funcionamento:
Se dará através da direção precionada no tapete, ou direção captada pela webcan.


Código processing, neste codigo conseguimos pausar o gira do cubo quando pisamos na direcional esquerda, e com o triangula podemos piscar a cor vermelha.

import processing.opengl.*;

import procontroll.*;
import net.java.games.input.*;

ControllIO controllIO;
ControllDevice joypad;
ControllStick stick1;
ControllStick stick2;

float transX;
float transY;

void setup(){
size(600,600,OPENGL);

transX = width/2;
transY = height/2;

controllIO = ControllIO.getInstance(this);

joypad = controllIO.getDevice("Twin USB Vibration Gamepad");
joypad.plug(this, "handleButton1Press", ControllIO.ON_PRESS, 1);
joypad.plug(this, "handleButton1Release", ControllIO.ON_RELEASE, 1);
joypad.plug(this, "handleMovement", ControllIO.WHILE_PRESS, 0);

joypad = controllIO.getDevice("Twin USB Vibration Gamepad");
joypad.plug(this, "handleButton1Press", ControllIO.ON_PRESS, 2);
joypad.plug(this, "handleButton1Release", ControllIO.ON_RELEASE, 1);
joypad.plug(this, "handleMovement", ControllIO.WHILE_PRESS, 0);

joypad = controllIO.getDevice("Twin USB Vibration Gamepad");
joypad.plug(this, "handleButton1Press", ControllIO.ON_PRESS, 3);
joypad.plug(this, "handleButton1Release", ControllIO.ON_RELEASE, 1);
joypad.plug(this, "handleMovement", ControllIO.WHILE_PRESS, 0);


joypad = controllIO.getDevice("Twin USB Vibration Gamepad");
joypad.plug(this, "handleButton1Press", ControllIO.ON_PRESS, 4);
joypad.plug(this, "handleButton1Release", ControllIO.ON_RELEASE, 1);
joypad.plug(this, "handleMovement", ControllIO.WHILE_PRESS, 0);


stick1 = joypad.getStick(0);
stick1.setMultiplier(PI);

stick2 = joypad.getStick(1);
stick2.setTolerance(0.06f);
stick2.setMultiplier(0.05f);
}

void handleButton1Press(){
fill(255,0,0);
joypad.rumble(1);
}

void handleButton1Release(){
fill(255);
}

void handleMovement(final float i_x,final float i_y){
transX += i_x;
transY += i_y;
}

void draw(){
background(0);
lights();
translate(transX,transY,0);
rotateX(stick2.getTotalY());
rotateY(stick2.getTotalX());
box(200);
}

Nenhum comentário:

Postar um comentário