Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone, I'm doing a university project and I want to make a spiral with an ellipse to start following the space in between the spiral from the center until the end of the spiral and then to start doing the same automatically. So my question is how can I make the ellipse following the spiral space? This is my code so far:

float time;

void setup()
{
size(900,850);
background(#FFFFFF);
stroke(#000203);
smooth();
time=3;
}

void draw()
{
translate(width/2,height/2);
strokeWeight(4);

beginShape();
for(int t=0;t<205;t++)
{
curveVertex((t*2)*sin(t/4.0),(t*2)*cos(t/4.0));
}
endShape();

ellipse(47/2,42/2,35,35);
}
PVector spiral(float t){
return new PVector(t*2*sin(t/4.0),t*cos(t/4.0));
} 


What I have tried:

I've tried to put ellipse into PVector spiral code and also to change the values into ellipse by putting the values from curveVertex
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900