Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
skucky
skucky's Profile
1
Posts
1
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Blinkin on eyes applet
[2 Replies]
12-Mar-2013 01:42 PM
Forum:
Programming Questions
Hi, Im noob and my code is:
void setup()
{
size(400,200);
background(0);
stroke(12,12,12);
smooth();
frameRate(30);
stroke(0);
ellipseMode(CORNERS);
ellipse(15,60,185,140);
stroke(0);
ellipseMode(CORNERS);
ellipse(215,60,385,140);
}
void draw()
{
background(0);
smooth();
frameRate(30);
//:Вежда лява
fill(255);
rectMode(CENTER);
rect(100,35,170,15);
//:Вежда дясна
fill(255);
rectMode(CENTER);
rect(300,35,170,15);
//:Орбита (голяма) лява
fill(255);
ellipseMode(CORNERS);
ellipse(15,60,185,140);
//:Орбита (малка) лява
fill(255);
ellipseMode(CORNERS);
ellipse(215,60,385,140);
//:Цвят и движение на заницата (Ляво)
int x = constrain (mouseX, 70, 130);
fill(mouseX,0,mouseY);
strokeWeight(6);
ellipseMode(CENTER);
ellipse(x,100,70,70);
//:Цвят и движение на заницата (дясно)
int y = constrain (mouseX, 270, 330);
fill(mouseX,0,mouseY);
strokeWeight(6);
ellipseMode(CENTER);
ellipse(y,100,70,70);
//:Pupille ляво
int m = constrain (mouseX, 53, 148);
int n = constrain (mouseY, 80, 120);
fill(0);
stroke(0);
ellipseMode(CENTER);
ellipse(m,n,20,20);
//:Pupille дясно
int a = constrain (mouseX, 250, 350);
int b = constrain (mouseY, 80, 120);
fill(0);
stroke(0);
ellipseMode(CENTER);
ellipse(a,b,20,20);
}
void mousePressed() //raises the eybrow
{
frameRate(10);
fill(0);
rectMode(CENTER);
rect(100,35,170,15);
fill(255);
rectMode(CENTER);
rect(100,10,170,15);
//:gives the coordinates in the comment box
println (""+mouseX+"+"+mouseY+"");
}
void blinkInterval() //Мигане
{
if (millis() < 8000)
{
frameRate(7);
fill(0);
stroke(0);
rectMode(CENTER);
rect(15,70,350,55);
fill(0);
stroke(0);
rectMode(CENTER);
rect(15,130,350,45);
fill(0);
stroke(0);
rectMode(CENTER);
rect(385,70,350,55);
fill(0);
stroke(0);
rectMode(CENTER);
rect(385,130,350,45);
}
I want to make the eyes blinkin in interval of 3 seconds...
«Prev
Next »
Moderate user : skucky
Forum