Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
elilor
elilor's Profile
1
Posts
0
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Changing the size of bezier curves, please help asap
[3 Replies]
11-Apr-2013 04:31 AM
Forum:
Programming Questions
Hi
I am trying to
make instances of my object with varying sizes. I have not been able to figure out how to uniformally change the size of bezier curves.
void setup() {
size(500, 500);
smooth();
background(119,159,245);
//new instance
SeaSerpent serpent;
serpent= new SeaSerpent(50, 50);
serpent.display();
}
class SeaSerpent {
//fields
//float size; //controls the size
float w;//controls width of eye
float h;//controls height of eye
float x; //controls location
float y;// controls location
color theColor; //controls color of fill and line
color theColor2; //controls color of fill and line
float s;//controls size
//constructors
ELorenzanaThingy( float _x, float _y) {
x=_x;//controls location
y=_y;
w=10; // change this to change eye size
theColor=color(8,111,69); //change this to change color of serpent
theColor2=color(255); // change this to change color of eye
}
//methods
void display () {
//body curves
noFill();
stroke (theColor);
strokeWeight(30);
bezier(x+96, y+98, x+95, y+70, x+76, y+59, x+54, y+59);
strokeWeight(40);
bezier(x+96, y+98, x+123, y+210, x+264, y+188, x+274, y+75);
strokeWeight(37);
bezier(x+333, y+103, x+439, y+52, x+268, y-9, x+274, y+75);
strokeWeight(33);
bezier(x+333, y+103, x+267, y+147, x+300, y+225, x+384, y+163);
//head curves
strokeWeight(20);
fill(theColor);
bezier(x+96, y+98, x+54, y-57, x+20, y+91, x- 38, y+64);
bezier(x+90, y+98, x+49, y+158, x+8, y+127, x-21, y+115);
//eye
strokeWeight(5);
fill(theColor2);
ellipse(x+50, y+40, w*4, w*3);
ellipse(x+50, y+40, w*2,w);
}
}
«Prev
Next »
Moderate user : elilor
Forum