summaryrefslogtreecommitdiff
path: root/bezierstroke.pde
diff options
context:
space:
mode:
authorgit@eclectronics.org <git@eclectronics.org@eclectronics.org>2012-02-22 13:59:46 +0000
committergit@eclectronics.org <git@eclectronics.org@eclectronics.org>2012-02-22 13:59:46 +0000
commita883f0f930a2389d25ac0573e113df62bb1f5fe9 (patch)
tree3a45b0e8a794d2488cbe7ccb7ea79e98d8eb8485 /bezierstroke.pde
parent4deda1a179b3b644173fba67be00fc55063cc9d7 (diff)
straghtline renderings etc
Diffstat (limited to 'bezierstroke.pde')
-rw-r--r--bezierstroke.pde30
1 files changed, 29 insertions, 1 deletions
diff --git a/bezierstroke.pde b/bezierstroke.pde
index 3c96023..d7fc939 100644
--- a/bezierstroke.pde
+++ b/bezierstroke.pde
@@ -145,7 +145,7 @@ class gradientstroke3D {
noFill();
float spos=0.0;
- float step=.03; //optimise
+ float step=0.03; //optimise
//quad corner points
//these are perpedicular on the screen as we are making a gradient line system
@@ -192,3 +192,31 @@ class gradientstroke3D {
}
}
+
+class linear3D {
+ float linewidth;
+ color col;
+ sphereMap smap;
+ float hw,hh;
+ linear3D(float _l,color _c,sphereMap _sp){
+ linewidth=_l;
+ col=_c;
+ smap=_sp;
+ hw=(getWidth()/2);
+ hh=(getHeight()/2);
+ }
+ void drawstroke(RPoint Sp,RPoint Ep) {
+ drawstroke(Sp,Ep,col);
+ }
+ void drawstroke(RPoint Sp,RPoint Ep,color _col) {
+ noFill();
+ stroke(red(_col),green(_col),blue(_col),255);
+ strokeWeight(linewidth);
+ RPoint L0=smap.per(Sp,4);
+ RPoint L1=smap.per(Ep,4);
+ line(L0.x+hw,L0.y+hh,L1.x+hw,L1.y+hh);
+ }
+
+}
+
+