I have been mashing the codes against each other for a while to try and export some of the great images I am getting.
Here is my code... apparently I am confusing active and static modes?
Any pointers or help to what I am doing wrong would be great. I hope I have not offended anyone with what is probably a very simple fix - I have done a few searches but there is nothing I could understand that would help me.
Thank you in advance. Matt
import processing.dxf.*;
boolean record;
import peasy.*; //PeasyCam library is required. Download from
http://mrfeinberg.com/peasycam/ import javax.media.opengl.*;
import processing.opengl.*;
String image_name = "PB130049"; //set the name of the source .jpg image here. it should exist whithin the sketch 'data' folder.
PImage img;
int mode = RGB;
boolean forward = true;
void keyPressed() {
// use a key press so that it doesn't make a million files
if (key == 'r') record = true;
cam = new PeasyCam(this, 400);
cam.setMinimumDistance(50);
cam.setMaximumDistance(1000);
img = createImage(300, 300, RGB); //smaller image for sampling color values. lower dimensions if performance in your system is bad, or increase for more detail
PImage loaded = loadImage(image_name +".jpg");
img.copy(loaded, 0, 0, loaded.width, loaded.height, 0, 0, img.width, img.height);
}
void draw() {
if (record) {
beginRaw(DXF, "output.dxf");
}
stroke(p, 64); //using an alpha value of 64 - reduce or increase to your taste
if(i % img.width > 0) line(prev.x, prev.y, prev.z, pos.x, pos.y, pos.z); //do not draw row jumps
prev = pos.get();
}
}
void makeAxis(){
int m = 255;
int a = 64; //alpha value of containing box
strokeWeight(2); //line thickness of containing box
for(int i=0; i<m; i++){
//red or hue
stroke(i, 0, 0, a);
line(i, 0, 0, i+1, 0, 0);
stroke(i, m, m, a);
line(i, m, m, i+1, m, m);
stroke(i, m, 0, a);
line(i, m, 0, i+1, m, 0);
stroke(i, 0, m, a);
line(i, 0, m, i+1, 0, m);
//green or saturation
stroke(0, i, 0, a);
line(0, i, 0, 0, i+1, 0);
stroke(m, i, m, a);
line(m, i, m, m, i+1, m);
stroke(0, i, m, a);
line(0, i, m, 0, i+1, m);
stroke(m, i, 0, a);
line(m, i, 0, m, i+1, 0);
//blue or brightness
stroke(0, 0, i, a);
line(0, 0, i, 0, 0, i+1);
stroke(m, m, i, a);
line(m, m, i, m, m, i+1);
stroke(0, m, i, a);
line(0, m, i, 0, m, i+1);
stroke(m, 0, i, a);
line(m, 0, i, m, 0, i+1);
}
strokeWeight(1);