How to fill a vertex with hash lines ?
in
Programming Questions
•
8 months ago
Hey guys,
I just wrote a script with some statistics in it and I don't like what it looks like when I just get this flat look a vertex normaly has…
I found a link to a "how to fill a ellipse with hashlines"
- float startAngle;
float density;
float radius;
void setup() {
size(800,800);
smooth();
stroke(0);
noFill();
startAngle = PI/3;
radius = 380;
density = 0.01;
}
void draw() {
background(255);
startAngle = atan2(height/2-mouseY,width/2-mouseX);
translate(width/2,height/2);
noFill();
stroke(0);
strokeWeight(0.5);
for(float i = -1; i <1;i+=density) {
float angle = acos(i);
line(cos(startAngle+angle)*radius,sin(startAngle+angle)*radius,cos(startAngle-angle)*radius,sin(startAngle-angle)*radius);
}
strokeWeight(1.5);
ellipse(0,0,radius*2,radius*2);
fill(220,220,0);
stroke(255);
for(float i = radius-10; i>0;i-= 15) {
ellipse(0,0,i*2,i*2);
}
}
The filling of the outer ring is pretty much what I want the vertex to look like.
Is there anyone out there who perhaps already did this and can help me out ?
Best regards & thanks for your help…
1