//The left and right buttons rotate, and mouse pressed brings up alternate text and color.
//here are all my images
//PImage ink;
PImage wallpaper2;
PImage alexMask;
PImage wallpaper;
PImage thinkMask;
PImage thought;
PImage brain;
PImage sociology;
//image for cursor
PImage hall;
//Here are the coordinates for the endpointd of the Bezeir,
//with all Beziers coming from the origin.
//Mechanical is origin
int [] mechanical = {70, -40};
int [] creative = {200, 320};
int [] logical = {430, 290};
int[] thinker = {880, 300};
int[] subconscious = {680, -40};
//int for other lines (subconscious and logical)
int[] oth = {500, 550};
int[] oth2 = {-300, 250};
float scaler =1;
int rotater =1;
PFont font;
//setting up size, images, and font)
void setup(){
size(1000,700, P3D);
scale(scaler);
wallpaper2 = loadImage("Alex_face.png");
alexMask = loadImage("Psychology_map.jpg");
//ink = loadImage("ink.png");
hall = loadImage("Hall.jpg");
brain = loadImage("Thought_NeuronsS.jpg");
thought = loadImage("color.jpg");
sociology = loadImage("sociology.jpg");
font= loadFont("TimesNewRomanPSMT-48.vlw");
textFont(font, 32);
wallpaper = loadImage("Thinker.png");
thinkMask = loadImage("France_map.png");
wallpaper.mask(thinkMask);
wallpaper2.mask(alexMask);
}
//set up image locations and camera panning movement
void draw(){
background(255);
//cursor changes to a hallway with a mouse press
if (mousePressed == true) {
cursor(hall, 0, 0);
}
camera(mouseX, height/2, (height/2) / tan(PI/6), mouseX, height/2, 0, 0, 1, 0);
translate(width/2-700, height/2-400, -100);
stroke(255);
noFill();
//Textured spinning triangle with brain neurons
pushMatrix();
noStroke();
translate(width/2, height/2, 0);
rotateY(map(mouseX, 0, width, -PI, PI));
beginShape();
texture(brain);
vertex(-100, -200, 0, 0, 0);
vertex(100, -140, 0, 300, 120);
vertex(0, 0, 0, 200, 400);
endShape();
popMatrix();
//Second textured triangle that enters screen for sociology picture
pushMatrix();
noStroke();
translate(width/2-100, height/2-200, 0);
rotateY(map(mouseY, 0, width, -HALF_PI, HALF_PI));
beginShape();
texture(sociology);
vertex(-100, -200, -400, 0, 0);
vertex(100, -140, -400, 300, 120);
vertex(0, 0, -400, 0, 200);
endShape();
popMatrix();
pushMatrix();
image(wallpaper, 880, 100);
image(wallpaper2, 0, 200);
translate(50, 700, 50);
popMatrix();
//image(ink, -200, 50);
translate(width/2, height/2);
rotateX(radians(35));
rotateZ(radians(rotater));
stroke(252, 156, 5);
strokeWeight(5);
fill(232, 46, 242);
//Background image and text for center point of Beziers
image(thought, -width,-height-200);
translate(-width/2, -height/2);
fill(255);
text("Origin of thought", 0, -20, 50);
if (mousePressed == true) {
if(dist(mouseX,mouseY,380,289)<80){
fill(255);
text("biological", 380, 420, 100);
}
if(dist(mouseX,mouseY,443,108)<80){
text("sociological", 580, 80, 50);
}
if(dist(mouseX,mouseY,630,270)<80){
text("philosophical", 890, 350, 50);
}
if(dist(mouseX,mouseY,215,290)<80){
text("psychological", 70, 420, 100);
}
if(dist(mouseX,mouseY,100,200)<80){
text("subconscious", -250, 338, 50);
}
if(dist(mouseX,mouseY,350,500)<80){
text("logical", 400, 600, 50);
}
}
//Here are my curved lines and the colors of their fills
fill(190,40,250);
bezier(creative[0],creative[1], 0, creative[0],creative[1], 60, mechanical[0],mechanical[1],80, mechanical[0],mechanical[1], 0);
fill(54, 234, 155);
bezier(mechanical[0],mechanical[1], 0, mechanical[0],mechanical[1], 60, logical[0],logical[1],120, logical[0],logical[1], 0);
fill(100,255,119);
bezier(mechanical[0],mechanical[1], 0, mechanical[0],mechanical[1], 60, thinker[0],thinker[1],60, thinker[0],thinker[1], 0);
fill(255,112,15);
bezier(mechanical[0],mechanical[1], 0, mechanical[0],mechanical[1], 60, subconscious[0], subconscious[1],60, subconscious[0],subconscious[1], 0);
fill(128, 12, 235);
bezier(mechanical[0],mechanical[1], 0, mechanical[0],mechanical[1], 45, oth[0], oth[1],60, oth[0], oth[1], 0);
fill(41, 5, 250);
bezier(mechanical[0],mechanical[1], 0, mechanical[0],mechanical[1], 30, oth2[0], oth2[1],60, oth2[0], oth2[1], 0);
}
//This is for checking coordinates
void mousePressed(){
println(mouseX + ", " + mouseY);
}
//This is for the rotation function, I attempted to add zoom, doesn't currently work
void keyPressed(){
if(keyCode == UP) {
scaler*=.85;
println(scaler);
}
else if (keyCode == DOWN) {
scaler *=1.25;
println(scaler);
}
if(keyCode == LEFT){
rotater += 1;
}
if(keyCode == RIGHT){
rotater -= 1;
}
}