Thursday, December 23, 2004

final java project

The 'Path Diary' interface - java processing

Goals
1. I need to make unlimited random paths and the paths should come back same position every time.
2. The paths have several random red spots on their paths.
3. The red spot should show the picture which shows a circumstance of thecertain area of the map.
4. When the red spot is rollovered by a mouse, the small images show the big images with text information.
5. If a use clicks the image on the red spot, they see moive file.

Problems
1. How to detect position of the random lines and make the ramdom number spots?
2. How to make the rollover image on the random red spots?
3. How to make the link on the java applete?

[The 'Path Diary' Interface]
- html, java script, and java processing
http://a.parsons.edu/~jslee/interface2004/ani_diary.html

[java processing 01]
http://a.parsons.edu/~jslee/java2004/diary03/applet/

[java procession 02 - in array]
http://a.parsons.edu/~jslee/java2004/re_path02/applet/


Monday, December 06, 2004

Home Work 10 : Java Applet






Monday, November 08, 2004

lab9 : real JAVA

applications : notepad, command prompt
class name = file name

unix command summary
http://www.bsd.org/unixcmds.html

[notepad - helloworld.java]
class helloworld { public static void main(String args[]){ System.out.println("Hello world."); }}

**commands
(javac -classpath . helloworld.java)
javac helloworld.java
java -cp . helloworld

----------------------------
class hellovars {
public static void main(String args[]){
int xInt;
float xFloat;
boolean xBool;
String xString;

xInt = 34;
xFloat = 23.654f;
xBool = false;
xString = "Real Java.";
System.out.println(xInt + " " + xFloat + " " + xBool + " " + xString + " ");
}
}-------------------------------------

---------------------------------
class hellovargs {
public static void main(String args[]){

System.out.println("value 1:" + args[0]);
System.out.println("value 2:" + args[1]);
System.out.println("Num of args" + args.length);
}
}---------------------------------------

javac hellovargs.java
java -cp . hellovargs 89 79

java -cp . hellovargs hello java world

---------------------------------

class hellovargs2 {
public static void main(String args[]){
int argVal;

argVal = Integer.parseInt(args[0]);
for(int i=0;i System.out.println("Hello world." + i);
}
}
}

-----------------------------------------

java -cp . hellovargs2 100

Sunday, November 07, 2004

Home Work 8 : Image Processing



custom image processing 1: Click here to see!



custom image processing 2: Click here to see!



custom image processing 3: Click here to see!



interactive image processing: Click here to see!

Monday, November 01, 2004

Lab 8 : image processing 2

BImage b;

void setup(){
size(300,300);
background(0);
b= loadImage("happy.jpg");


//image(b,0,0);
//fill(b.pixels[10000]);
//rect(50,50,200,200);

//println(b.width);
}

void loop(){
int randwidth = (int)random(5,10);
background(255);
for (int x=0;x for (int y=0;y
fill(b.pixels[x+y*b.width]);
noStroke();

ellipse(x,y,randwidth,randwidth);
}
}
}
-------------------------------------------
BImage b;

void setup(){
size(300,300);
background(0);
b= loadImage("happy.jpg");


//image(b,0,0);
//fill(b.pixels[10000]);
//rect(50,50,200,200);

//println(b.width);
}

void loop(){
background(255);
for (int x=0;x for (int y=0;y
fill(b.pixels[x+y*b.width]);
noStroke();

rect(x,y,8,8);
}
}
}

Lab 8 : image processing

LOCATION = X+Y*WIDTH
---------------
BImage b;

void setup(){
size(300,300);
background(0);
b= loadImage("happy.jpg");

image(b,0,0);
fill(pixels[10000]);
rect(50,50,200,200);
}

void loop(){

}
------------------
BImage b;

void setup(){
size(300,300);
background(0);
b= loadImage("happy.jpg");

//image(b,0,0);
fill(b.pixels[10000]);
rect(50,50,200,200);
}

void loop(){

}
-----------------------
http://processing.org/reference/BImage.html
--------------------BImage b;


void setup(){
size(311,320);
background(0);
b= loadImage("happy.jpg");

for (int x=0;x<311;x++){
for (int y=0;y<320;y++){
stroke(b.pixels[x+y*width]);
//delay(250);
point(x,y);
}
}
//image(b,0,0);
//fill(b.pixels[10000]);
//rect(50,50,200,200);

//println(b.width);
}

void loop(){

}
---------------
BImage b;

void setup(){
size(311,320);
background(0);
b= loadImage("happy.jpg");


//image(b,0,0);
//fill(b.pixels[10000]);
//rect(50,50,200,200);

println(b.height);
}

void loop(){
for (int x=0;x for (int y=0;y
float rVal = red(b.pixels[x+y*width])+x/100;
float gVal = green(b.pixels[x+y*width])+x/100;
float bVal = blue(b.pixels[x+y*width])+x/100;

stroke(rVal,gVal,bVal);
point(x,y);
}
}
}

-----------------------------
Photoshop/filter/other/custom/(matrix map) blur – same value scale9, shapen 9,-1(neiberhood) scale 1

Sunday, October 31, 2004

Home Work 7 : Halloween cards



Halloween Ghost & Bat eCard: Click here to see!



Halloween Pumpkin eCard: Click here to see!



Halloween Spider eCard: Click here to see!

Monday, October 25, 2004

lab7 : drawing line

float preX;
float preY;
float counter;
float amp;

void setup(){
size (200,200);
background(255);
}

void loop(){

counter=counter+0.5;
amp=20;

if (mousePressed){
ecllipse(preX, preY, mouseX+cos(counter)*amp, mouseY+sin(counter)*amp);
}

preX=mouseX+cos(counter)*amp;
preY=mouseY+cos(counter)*amp;
}
------------------------------------------------------
float[] mousePtsX = new float[100];
float[] mousePtsY = new float[100];
int counter;

void setup(){
size (200,200);
background(255);
}

void loop(){
for(int i=0;i line(mousePtsX[i], mousePtsY[i], mousePtsX[i+1], mousePtsY[i+1]);
}
}

void mouseDragged(){
if (counter<100){
mousePtsX[counter] = mouseX;
mousePtsY[counter] = mouseY;
counter++;
}
}
------------------------------------------------------

float[] mousePtsX = new float[100];
float[] mousePtsY = new float[100];
int counter;

void setup(){
size (200,200);
background(255);
}

void loop(){
background(255);
for(int i=0;i line(mousePtsX[i], mousePtsY[i], mousePtsX[i+1], mousePtsY[i+1]);
}
}

void mouseDragged(){
if (counter<100){
mousePtsX[counter] = mouseX;
mousePtsY[counter] = mouseY;
counter++;
}
for(int i=0;i mousePtsX[i] = mousePtsX[i]*1.01;
mousePtsY[i] = mousePtsY[i]/1.01;
}
}
------------------------------------------------------

lab7

float counter;

void setup(){
}

void loop(){
background(255);
counter = counter + 0.1;
//println(sin(counter));
rectMode(CENTER_DIAMETER);
rect(cos(counter)*50+50, sin(counter)*50+50,5,5);
}
----------------------------------------------------------
void setup(){
size (200,200);
}

void loop(){
if (mousePressed){
point(mouseX, mouseY);
}
}
----------------------------------------------------------------
void setup(){
size (200,200);
background(255);
}

void loop(){
if (mousePressed){
//line(mouseX, mouseY, pmouseX, pmouseY);
rect(pmouseX, pmouseY, abs(mouseX-pmouseY),abs(mouseY-pmouseX));
}
}
------------------------------------------
float preX;
float preY;

void setup(){
size (200,200);
background(255);
}

void loop(){
float rand1=random(10);
float rand2=random(10);

if (mousePressed){
line(mouseX, mouseY, preX+rand1, preY+rand2);
}

preX=mouseX+rand1;
preY=mouseY+rand2;
}
----------------------------------------

lab7 : 2 dimensional array

int[][]a=new int[3][4];
------------------------------------

lab7:3D

void setup(){
size (200,200);
}

void loop(){

background(255);

push();
translate(100,25,0);
box(20,20,40);
pop();
push();
translate(100,50,0);
box(20,20,40);
pop();

}
------------------------------------------------------

float counter;

void setup(){
size (200,200);
}

void loop(){

background(255);
counter+=0.01;
lights();
//noStroke();

fill(255,0,0);
push();
translate(100,100,100);
rotateZ(counter);
translate(50,0,0);
box(20,20,40);
pop();

push();
translate(100,100,50);
rotateY(counter);
translate(50,0,0);
box(20,20,40);
pop();
}