hi
i am trying to put my character in a method/function and then calling it, by:
clearing the background
calling the method scene
providing x,y,rotation, and scale parameters of my chararchter method.
then I want to call my charachter method atleast 8 times with dif positions and rotations and scaling!
now my problem is that when I call my object methods, it doesnt show anything!! I need some help with that and what ive done wrong!
I really appreciate your help.
=========
void setup() {
smooth();
size(600, 600);
drawBackG();
for(int i=1; i<<9; i++){
drawLooLoo(mouseX, mouseY, mouseY/200, - PI/4);
}
void drawBackG(){
background(0);
pushMatrix();
strokeWeight(2);
// the large circle
fill(255);
ellipse(300, 300, 600, 600);
pushMatrix();
translate(300, 300);
strokeWeight(2);
rectMode(CENTER);
//vertical rect
fill(255,8,252,150);
rect(0, 0, -320, -505);
//horizontal rect
fill(61,83,216,250);
rect(0, 0, -505, -320);
//middle medium circle
fill(245,200,77);
ellipse(0, 0, 320, 320);
popMatrix();
//corners circles
fill(255,247,0,210);
ellipse(0, 0, 50, 50);
ellipse(600, 0, 50, 50);
ellipse(0, 600, 50, 50);
ellipse(600, 600, 50, 50);
//top small circle
pushMatrix();
translate(300, 50);
fill(14,49,152);
ellipse(0, 0, 40, 40);
//small quad left
fill(76,121,78);
quad(-100, 90,-130,-2,-60,-2,-30,90);
//small quad right
quad(100, 90,130,-2,60,-2,30,90);
line(0,20,0,90);
popMatrix();
//bottom small circle
pushMatrix();
translate(300, 550);
fill(14,49,152);
ellipse(0, 0, 40, 40);
//small quad left
fill(76,121,78);
quad(-100, -90,-130,2,-60,2,-30,-90);
//small quad right
quad(100, -90,130,2,60,2,30,-90);
line(0,-20,0,-90);
popMatrix();
//left small circle
pushMatrix();
translate(50, 300);
fill(14,49,152);
ellipse(0, 0, 40, 40);
line(20, 0, 90, 0);
popMatrix();
//right small circle
pushMatrix();
translate(550, 300);
fill(14,49,152);
ellipse(0, 0, 40, 40);
line(-20, 0, -90, 0);
popMatrix();
//left triangle
fill(252,118,8);
triangle(18,190,18,18,190,18); //160? to touch
//bottom right tri
pushMatrix();
translate(600,600);
fill(252,118,8);
triangle(-18,-190,-18,-18,-190,-18);
popMatrix();
//bottom left tri
pushMatrix();
translate(0,600);
triangle(18,-18,18,-190,190,-18);
popMatrix();
//up right tri
pushMatrix();
translate(600,0);
fill(252,118,8);
triangle(-190,18,-18,18,-18,190);
popMatrix();
// central circle and the quads
pushMatrix();
translate(300,300);
fill(0);
ellipse(0,0,150,150);
fill(0);
quad(-74,0,-50,-55,50,-55,74,0);
quad(-74,0,74,0,50,55,-50,55);
popMatrix();
//arc left wing
pushMatrix();
translate(37, 105);
fill(252,8,229);//noFill();
arc(10, 35, 277, 277, 0, PI/2);
popMatrix();
//arc right wing
pushMatrix();
translate(563,105);
fill(252,8,229); // noFill();
arc(-10, 35, 277, 277, PI/2, PI);
popMatrix();
//arc right down
pushMatrix();
translate(45, 458);
fill(252,8,229);//noFill();
arc(0, 0, 277, 277, - PI/2, 0);
popMatrix();
//arc left down
pushMatrix();
translate(555,458);
fill(252,8,229);//noFill();
arc(0,0, 277, 277, -PI, - PI/2);
popMatrix();
//curve
pushMatrix();
translate(300,300);
noFill();
strokeWeight(2);
//upper curve
curve(-100,-240,-125,-100,125,-100, 100, -240);
//right side curves
curve(0,-580,0,-160,160,0,580,0);
curve(0,580,0,160,160,0,580,0);
//lower curve
curve(-100,240,-125,100,125,100,100,240);
//left side curves
curve(0,-580,0,-160,-160,0,-580,0);
curve(0,580,0,160,-160,0,-580,0);
popMatrix();
//upper right square
pushMatrix();
translate(80,80);
fill(8,242,252);
rect(0,0,80,80);
popMatrix();
//lower riht square
pushMatrix();
translate(520,520);
rect(0,0,-80,-80);
popMatrix();
//upper right square
pushMatrix();
translate(520,80);
rect(0,0,-80,-80);
popMatrix();
//lower left square
pushMatrix();
translate(80,520);
rect(0,0,80,-80);
popMatrix();
popMatrix();
}
void drawLooLoo(float x,float y,float charScale, float charRotate){
translate(x,y);
scale( charScale );
if(x<width/2){
rotate(charRotate);
}
else {
rotate(charRotate);
}
fill(224,190,95);
noStroke();
ellipse(0,0,100,100);
rect(-50,0,100,70);
noStroke();
curve(30,0,35,70,50,70,60,0);
curve(-55,0,-50,70,35,70,45,0);
fill(255);
ellipse(0,0,50,50);
fill(0);
ellipse(0,0,20,25);
strokeWeight(2);
fill(120,0,0);
curve(0,80, -10, 40, 30, 30, 55, 50);
line(-10, 40, 30, 30);
curve(0,80, 10, 40, -30, 30, -55, 50);
line(10, 40, -30, 30);
curve(0,85, -10, 45, 30, 35, 55, 55);
line(-10, 45, 30, 35);
curve(0,85, 10, 45, -30, 35, -55, 55);
line(10, 45, -30, 35);
curve(0,90, -10, 50, 30, 40, 55, 60);
line(-10, 50, 30, 40);
curve(0,90, 10, 50, -30, 40, -55, 60);
line(10, 50, -30, 40);
curve(0,95, -10, 55, 30, 45, 55, 65);
line(10, 55, -30, 45);
curve(0,95, 10, 55, -30, 45, -55, 65);
line(10, 55, -30, 45);
fill(130,0,0);
ellipse(-30,-30,10,10);
}
1