classes van de gebruikte curven. terug naar de inleiding
De class "BezierQuadr"
class BezierQuadr extends Curven
{
BezierQuadr(float xa1_, float ya1_, float xa2_, float ya2_, //ankerpunten a1 en a2
float xc1_, float yc1_, //controlepunt c1
color c_) {
xa1 = xa1_; ya1 = ya1_; xa2 = xa2_; ya2 = ya2_;
xc1 = xc1_; yc1 = yc1_; xc2 =
c = c_;
}
void display() {
fill(c);
beginShape();
vertex(xa1, ya1); //eerste ankerpunt
quadraticVertex(xc1, yc1, xa2,ya2); //eerste controlepunt en tweede ankerpunt
endShape(CLOSE);
}
}
De class "BezierCub"
class BezierCub extends Curven{
BezierCub (float xa1_, float ya1_, float xa2_, float ya2_,
float xc1_, float yc1_, float xc2_, float yc2_,
color c_) {
xa1 = xa1_; ya1 = ya1_; xa2 = xa2_; ya2 = ya2_;
xc1 = xc1_; yc1 = yc1_; xc2 = xc2_; yc2 = yc2_;
c = c_;
}
void display() {
beginShape();
fill(c);
vertex(xa1, ya1);
bezierVertex(xc1, yc1, xc2, yc2, xa2, ya2);
endShape(CLOSE);
}
}
class "BezierQuadrCub"
class BezierQuadrCub extends Curven {
//argumenten van de constructor
BezierQuadrCub(float xa1_, float ya1_, float xa2_, float ya2_, float xa3_, float ya3_, //a1, a2, en a3
float xc1_, float yc1_, float xc2_, float yc2_, float xc3_, float yc3_, //c1, c2, en c3
color c_){
xa1 = xa1_; ya1 = ya1_; xa2 = xa2_; ya2 = ya2_; xa3 = xa3_; ya3 = ya3_;
xc1 = xc1_; yc1 = yc1_; xc2 = xc2_; yc2 = yc2_; xc3 = xc3_; yc3 = yc3_;
c = c_;
}
void display() {
fill(c);
beginShape();
vertex(xa1, ya1); //eerste ankerpunt
quadraticVertex(xc1,yc1, xa2,ya2); //eerste controlepunt en tweede ankerpunt
bezierVertex(xc2, yc2, xc3, yc3, xa3, ya3); //tweede en derde controlepunt en derde ankerpunt
endShape(CLOSE);
}
}
class "Bezier2Quadr"
class Bezier2Quadr extends Curven
{
Bezier2Quadr(float xa1_, float ya1_, float xa2_, float ya2_, float xa3_, float ya3_, //ankerpunten a1, a2 en a3
float xc1_, float yc1_, float xc2_, float yc2_, //controlepunten c1 en c2
color c_) {
xa1 = xa1_; ya1 = ya1_; xa2 = xa2_; ya2 = ya2_; xa3 = xa3_; ya3 = ya3_;
xc1 = xc1_; yc1 = yc1_; xc2 = xc2_; yc2 = yc2_;
c = c_;
}
void display() {
fill(c);
beginShape();
vertex(xa1, ya1); //eerste ankerpunt
quadraticVertex(xc1,yc1, xa2,ya2); //eerste controlepunt en tweede ankerpunt
quadraticVertex(xc2,yc2, xa3,ya3); //tweede controlepunt en derde ankerpunt
endShape(CLOSE);
}
}
class "Bezier3Quadr" een classe met drie gekoppelde kwadratische bezier curven
class Bezier3Quadr extends Curven {
//argumenten van de constructor
Bezier3Quadr(float xa1_, float ya1_, float xa2_, float ya2_, float xa3_, float ya3_, float xa4_, float ya4_, //ankerpunten a1, a2 en a3
float xc1_, float yc1_, float xc2_, float yc2_, float xc3_, float yc3_, //controlepunten c1 en c2
color c_){
xa1 = xa1_; ya1 = ya1_; xa2 = xa2_; ya2 = ya2_; xa3 = xa3_; ya3 = ya3_; xa4 = xa4_; ya4 = ya4_;
xc1 = xc1_; yc1 = yc1_; xc2 = xc2_; yc2 = yc2_; xc3 = xc3_; yc3 = yc3_;
c = c_;
}
void display() {
fill(c);
beginShape();
vertex(xa1, ya1); //eerste ankerpunt
quadraticVertex(xc1, yc1, xa2,ya2); //eerste controlepunt en tweede ankerpunt
quadraticVertex(xc2, yc2, xa3, ya3);//tweede controlepunt en derde ankerpunt
quadraticVertex(xc3, yc3, xa4, ya4);//derde controlepunt en vierde ankerpunt
endShape(CLOSE);
}
}
De classs "Bezier2Cub"
class Bezier2Cub extends Curven {
//argumenten van de constructor
Bezier2Cub(float xa1_, float ya1_, float xa2_, float ya2_, float xa3_, float ya3_, //ankerpunten a1, a2 en a3
float xc1_, float yc1_, float xc2_, float yc2_,
float xc3_, float yc3_, float xc4_, float yc4_, //controlepunten c1, c2, c3 en c4
color c_){
xa1 = xa1_; ya1 = ya1_; xa2 = xa2_; ya2 = ya2_; xa3 = xa3_; ya3 = ya3_;
xc1 = xc1_; yc1 = yc1_; xc2 = xc2_; yc2 = yc2_; xc3 = xc3_; yc3 = yc3_; xc4 = xc4_; yc4 = yc4_;
c = c_;
}
void display() {
fill(c);
beginShape();
vertex(xa1, ya1); //eerste ankerpunt
bezierVertex(xc1,yc1, xc2,yc2, xa2,ya2); //eerste en tweede controlepunt en tweede ankerpunt
bezierVertex(xc3,yc3, xc4,yc4, xa3,ya3); //derde en vierde controlepunt en derde ankerpunt
endShape(CLOSE);
}
}
De classs "Bezier3Cub"
class Bezier3Cub extends Curven {
//argumenten van de constructor
Bezier3Cub(float xa1_, float ya1_, float xa2_, float ya2_, //ankerpunten a1 en a2
float xa3_, float ya3_, float xa4_, float ya4_, //ankerpunten a3 en a4
float xc1_, float yc1_, float xc2_, float yc2_, //controlepunten c1 en c2
float xc3_, float yc3_, float xc4_, float yc4_, //controlepunten c3,en c4
float xc5_, float yc5_, float xc6_, float yc6_, //controlepunten c5,en c6
color c_){
xa1 = xa1_; ya1 = ya1_; xa2 = xa2_; ya2 = ya2_; xa3 = xa3_; ya3 = ya3_; xa4 = xa4_; ya4 = ya4_;
xc1 = xc1_; yc1 = yc1_; xc2 = xc2_; yc2 = yc2_; xc3 = xc3_; yc3 = yc3_;
xc4 = xc4_; yc4 = yc4_; xc5 = xc5_; yc5 = yc5_; xc6 = xc6_; yc6 = yc6_;
c = c_;
}
void display() {
fill(c);
beginShape();
vertex(xa1, ya1); //eerste ankerpunt
bezierVertex(xc1, yc1, xc2, yc2, xa2, ya2); //eerste en tweede controlepunt en tweede ankerpunt
bezierVertex(xc3, yc3, xc4, yc4, xa3, ya3); //derde en vierde controlepunt en derde ankerpunt
bezierVertex(xc5, yc5, xc6, yc6, xa4, ya4); //derde en vierde controlepunt en derde ankerpunt
endShape(CLOSE);
}
}
De class "BezierQuadrCubQuadr"
class BezierQuadrCubQuadr extends Curven {
//argumenten van de constructor ankerpunten 1 t/m 4
BezierQuadrCubQuadr(float xa1_, float ya1_, float xa2_, float ya2_, float xa3_, float ya3_, float xa4_, float ya4_,
//controlepunten c1, c2 c3 en c4
float xc1_, float yc1_, float xc2_, float yc2_, float xc3_, float yc3_, float xc4_, float yc4_,
color c_){
xa1 = xa1_; ya1 = ya1_; xa2 = xa2_; ya2 = ya2_; xa3 = xa3_; ya3 = ya3_; xa4 = xa4_; ya4 = ya4_;
xc1 = xc1_; yc1 = yc1_; xc2 = xc2_; yc2 = yc2_; xc3 = xc3_; yc3 = yc3_; xc4 = xc4_; yc4 = yc4_;
c = c_;
}
void display() {
fill(c);
beginShape();
vertex(xa1, ya1); //eerste rode ankerpunt
quadraticVertex(xc1,yc1, xa2,ya2); //eerste controlepunt en tweede ankerpunt
bezierVertex(xc2, yc2, xc3, yc3, xa3, ya3);//tweede en derde controlepunt en derde ankerpunt
quadraticVertex(xc4,yc4, xa4,ya4); //vierde controlepunt en vierde lichtblauwe ankerpunt
endShape(CLOSE);
}
}
De class "BezierCubQuadrCub"
class BezierCubQuadrCub extends Curven {
//argumenten van de constructor ankerpunten a1 t/m a4
BezierCubQuadrCub(float xa1_, float ya1_, float xa2_, float ya2_, float xa3_, float ya3_, float xa4_,float ya4_,
//controlepunten c1, t/m c5
float xc1_, float yc1_, float xc2_, float yc2_, float xc3_, float yc3_,
float xc4_, float yc4_, float xc5_, float yc5_,
color c_){
xa1 = xa1_; ya1 = ya1_; xa2 = xa2_; ya2 = ya2_; xa3 = xa3_; ya3 = ya3_; xa4 = xa4_; ya4 = ya4_;
xc1 = xc1_; yc1 = yc1_; xc2 = xc2_; yc2 = yc2_; xc3 = xc3_; yc3 = yc3_; xc4 = xc4_; yc4 = yc4_; xc5 = xc5_; yc5 = yc5_;
c = c_;
}
void display() {
fill(c);
beginShape();
vertex(xa1, ya1); //eerste rode ankerpunt
bezierVertex(xc1,yc1, xc2,yc2, xa2,ya2); //eerste en tweede controlepunt en tweede ankerpunt
quadraticVertex(xc3,yc3, xa3,ya3); // derde controlepunt en derde ankerpunt
bezierVertex(xc4,yc4, xc5,yc5, xa4,ya4); // vierde en vijfde controlepunt en vierde ankerpunt
endShape(CLOSE);
}
}