Loading...
Processing Forum
Recent Topics
All Forums
Move this topic
Forum :
Share your Work
Programming Questions
Core Library Questions
Contributed Library Questions
Android Processing
Processing with Other Languages
Integration and Hardware
Library and Tool Development
Events and Opportunities
General Discussion
Sub forum :
Move this topic
Cancel
General Discussion
Other
oatcracker
how to draw a line with different strokeweights at both of its ends?
in
General Discussion
•
Other
•
11 months ago
may i ask how to draw a line with different strokeweights at both of its ends? kindly of like an arrow ...
thanks!
1
Replies(5)
cedrickie..
Re: how to draw a line with different strokeweights at both of its ends?
11 months ago
No way to do it with the line() and strokeWeight command. What about drawing a triangle instead ?
http://www.processing.org/reference/triangle_.html
cause thats more or less what it is.
Beside that, the beginShape(), endShape() funktions might also help...
and you could also do it with drawing a lot of circles, with changing radius, there are different ways depending on your needs
Leave a comment on cedrickiefer's reply
oatcracker
Re: how to draw a line with different strokeweights at both of its ends?
11 months ago
noted with thanks!
Leave a comment on oatcracker's reply
oatcracker
Re: how to draw a line with different strokeweights at both of its ends?
11 months ago
currently I'm drawing a group of points with changing strokeweight and tranparency to realize this effect :
Leave a comment on oatcracker's reply
cedrickie..
Re: how to draw a line with different strokeweights at both of its ends?
11 months ago
yes, as said, that could be a solution as well. if you dont want a straight line. you might also use the bezierPoint() Function with the same approach. although the transparency doesnt work well because of the overlapping circles.
void setup(){
size(500,500);
smooth();
}
void draw(){
background(0,0,255);
noStroke();
noFill();
bezier(85, 120, 110, 210, 390, 590, 315, 280);
int steps =250;
for (int i = 0; i <= steps; i++) {
fill(255,0,0,i);
float t = i / float(steps);
float x = bezierPoint(85, 110, 390, 315, t);
float y = bezierPoint(120, 210, 590, 280, t);
ellipse(x, y, i/10.0,i/10.0);
}
}
Leave a comment on cedrickiefer's reply
oatcracker
Re: how to draw a line with different strokeweights at both of its ends?
11 months ago
thanks!
small tweak:
void setup() {
size(500, 500);
smooth();
}
void draw() {
background(0, 0, 255);
noStroke();
noFill();
bezier(85, 120, 110, 210, 390, 590, 315, 280);
int steps =300;
for (int i = 0; i <= steps; i++) {
fill(255, 0, 0, map(steps-i, 0, steps, 0, 255));
float t = i / float(steps);
float x = bezierPoint(85, 110, 390, 315, t);
float y = bezierPoint(120, 210, 590, 280, t);
ellipse(x, y, i/10.0, i/10.0);
}
}
Leave a comment on oatcracker's reply
Change topic type
Topic Type :
Discussions
Questions
No of days :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Change topic type
Cancel
Link this topic
Provide the permalink of a topic that is related to this topic
Permalink
Save
Close
Reply to oatcracker's question
Top
Reply
{"z3978071":[25080000001805355,25080000001805397],"z7307287":[25080000001806264,25080000001806273,25080000001806277,25080000001806319]}
Statistics
5
Replies
333
Views
0
Followers
Tags
No tags available for this topic.
Cancel
Actions
Permalink
Related Posts
Thread / Recursion
'Filling' the gaps between ...
How can I get the position of any c...
how to let things move or be intera...
curve with different weights