Hello,
i am completely new to processing
can someone please help me with this code ,
I want to add a background image to it, the background image would be placed in the processing folder/data
- import processing.serial.*;
- import processing.opengl.*;
- Serial serial;
- int serialPort = 1;
- int sen = 3;
- int div = 3;
- Normalize n[] = new Normalize[sen];
- MomentumAverage cama[] = new MomentumAverage[sen];
- MomentumAverage axyz[] = new MomentumAverage[sen];
- float[] nxyz = new float[sen];
- int[] ixyz = new int[sen];
- float w = 256; // board size
- boolean[] flip = {
- false, true, false};
- int player = 0;
- boolean moves[][][][];
- PFont font;
- void setup() {
- size(800, 600, P3D);
- frameRate(25);
- font = loadFont("TrebuchetMS-Italic-20.vlw");
- textFont(font);
- textMode(SCREEN);
- println(Serial.list());
- serial = new Serial(this, Serial.list()[serialPort], 115200);
- for(int i = 0; i < sen; i++) {
- n[i] = new Normalize();
- cama[i] = new MomentumAverage(.01);
- axyz[i] = new MomentumAverage(.15);
- }
- reset();
- }
- void draw() {
- updateSerial();
- drawBoard();
- }
- void updateSerial() {
- String cur = serial.readStringUntil('\n');
- if(cur != null) {
- String[] parts = split(cur, " ");
- if(parts.length == sen ) {
- float[] xyz = new float[sen];
- for(int i = 0; i < sen; i++)
- xyz[i] = float(parts[i]);
- if(mousePressed && mouseButton == LEFT)
- for(int i = 0; i < sen; i++)
- n[i].note(xyz[i]);
.......... the code continues
I check online for the syntax ,even though i found them i cant seem to incorporate it into the above code.
so can someone kindly modify the above code with the right parameters for adding a background image
any form of help would be much appreciated