Radiating vector issues
in
Programming Questions
•
1 year ago
Is there any way to take a star with 10 vector points and radiate them from the center without using the scale function? I've been beating my head against the wall with int loops and multiplying each point by float commands to increase all the points in size equally. here is the example I have; (i've been tweaking wit the left star)
size (800,400);
background (255);
noFill();
strokeWeight (13);
line (400,0,400,400);
rect (6.5,6.5,790,390);
for (float p=.9; p<10; p+=.1){//p is stand-in for i
pushMatrix();
translate (-372.5,-433);
noFill();
strokeWeight(13);
beginShape();
vertex(115*p,460*p);//1
vertex(460*p,460*p);//2
vertex(575*p,115*p);//3
vertex(690*p,460*p);//4
vertex(1035*p,460*p);//5
vertex(747.5*p,690*p);//6
vertex(862.5*p,1035*p);//7
vertex(575*p,805*p);//8
vertex(285.5*p,1035*p);//9
vertex(402.5*p,690*p);//10
endShape(CLOSE);
popMatrix();
}
This ends up giving me the desired scaling up of size but no pushMatrix can have me shift the progression of size to radiate from the center of the shape. And that is my issue. Does anyone have any tips/ideas? I can't afford to keep buying plaster to fill the holes in the walls.
1