We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › is there anyone to help me
Page Index Toggle Pages: 1
is there anyone to help me? (Read 791 times)
is there anyone to help me?
Aug 7th, 2007, 9:34am
 
Hello.
I want to make some pictures like below.

http://211.233.20.26/images/pv/60/11/02/60110271.jpg

http://211.233.20.25/images/pv/60/13/99/60139958.jpg

http://211.233.20.25/images/pv/60/13/99/60139960.jpg

but I'm a beginner and I don't know what exactly i have to study to make these pictures. Unfortunately i must finish these as soon as possible(it must be finished this week).

so i ask you to help me. i'd really appreciate it if one of you can teach me or give me some hint.

thank you
Re: is there anyone to help me?
Reply #1 - Aug 7th, 2007, 12:36pm
 
give these a try:

http://processing.org/learning/basics/bezier.html

http://processing.org/reference/bezier_.html

F
Re: is there anyone to help me?
Reply #2 - Aug 7th, 2007, 12:37pm
 
oh, and i recommend removing your email-address .. this forum get's lot's of attention and you don't want to give your address to all these spambots. Wink

F
Re: is there anyone to help me?
Reply #3 - Aug 7th, 2007, 1:04pm
 
it's still vague for me.
anyway i'll try.
thanks fjen.
Re: is there anyone to help me?
Reply #4 - Aug 7th, 2007, 1:42pm
 
these seem to be bezier lines drawn on top of each other .. so you could use the example / reference i gave you to build something similar. we're not going to do your homework here Wink . give it a try and ask again (post your code) if you run into trouble.

hint:

- (1) create variables to hold the current position of the bezier lines x,y values
- (2) create a variable to hold the current line color
- in draw() set color, draw a bezier-line, increment the values: (1), (2)

F
Re: is there anyone to help me?
Reply #5 - Aug 16th, 2007, 9:08pm
 
You could draw an ellipse,
using
ellipse(x, y, width, height)
and also
ellipseMode(), stroke(), fill(), noFill(), color(), etc...

put the ellipse inside a loop, (the draw() loop itself or another inner loop),
then on each iteration, update some/many/all of the parameters:
x=x+deltax or x=fx(t)
y=y+deltay or y=fy(t)
width=...
height=...
color=...
alpha=...

You can use cyclic functions like sin(), cos() ...

Run the following, then change it:

int n=800;//image size
int margin=8;
float n2,n4;

void setup() {
 int nn=n-2*margin;
 n2=nn/2.00;
 n4=nn/4.00;
 int maxWidth=n;
 int maxHeight=n;
 size(n,n);
 background(0);
 noFill();
 ellipseMode(CENTER);
 noLoop();
}

void draw() {
 int r,g,b,a;
 float x,y,w,h;
 //initial color
 r=0;
 g=100;
 b=200;
 a=30;
 for (int t = 0; t < 2000; t++) {
   float tt=t*TWO_PI/500;
   //change color
   r=(r+10)%255;
   g=(g+15)%255;
   b=(b+20)%255;
   //a=(a+2)%50;
   stroke(r,g,b,a);
   //set center x,y
   x=margin+n4+n4*(1+sin(2.0*tt));
   y=margin+n4+n4*(1+cos(1.0*tt));
   //set width,height
   w=n2*sin(2.0*tt);
   h=n2*cos(1.0*tt);
   //draw ellipse
   ellipse(x, y, w, h);
 }//for

}
Page Index Toggle Pages: 1