sotsuron

Fork of linearMirrorMotion1017 by Hiromasa Oku

Revision:
28:d86c629b6fd3
Parent:
27:38bc8dc67dab
--- a/renderclass.cpp	Tue Jul 23 03:01:35 2013 +0000
+++ b/renderclass.cpp	Wed Jul 24 08:31:32 2013 +0000
@@ -41,6 +41,7 @@
 {
     translated.clear();
     radious = 200;
+    angle = 0;
        
     ptext = p;
     pc.printf("Size of text to render: %d/n", (*ptext).size() );
@@ -50,7 +51,7 @@
         letter translatedLetter;
         for(int i=0; i<(*itr).letpoints.size(); i++) {
             point2dl tranPoint;
-            tranPoint.x=itr->letpoints[i].x+560*count;
+            tranPoint.x=itr->letpoints[i].x;//+560*count;
             tranPoint.y=-itr->letpoints[i].y;
             tranPoint.laserSwitch=itr->letpoints[i].laserSwitch;
             translatedLetter.letpoints.push_back(tranPoint);
@@ -80,7 +81,7 @@
     //intvx += RENDER_INTERVAL*vx;
     //intvy += RENDER_INTERVAL*vy;
     
-    angle= 0;//(1/9.0)*PI ;//+0.3* atan( vy / vx ) * 0.7*angle;   atan2
+    angle= 0;//atan2(vx,vy) + PI/2;
 }
 
 
@@ -115,7 +116,7 @@
             case NORMAL_POINT:
                 intvx += speedTimer.read_us()*vx;
                 intvy += speedTimer.read_us()*vy;
-                speedTimer.reset();
+                
             
                 point2dl drawPoint=translated[currentLetters].letpoints[currentPoints];
                 transform(drawPoint);               // transform it with the current speed and angle
@@ -145,10 +146,14 @@
                     // switch the laser off and move to the first point of the next letter:
                     
                     currentLetters++;
+                    speedTimer.reset();
+                    intvx = intvy =0;
+                    
+                    
                     if(currentLetters >= translated.size()) {
                         currentLetters = 0;
-                        startSwitch=0;
-                        intvx = intvy =0;
+                        startSwitch=1;
+                        
                         
                     
                     }
@@ -163,10 +168,13 @@
                     firstPointCounter++;
                     
                     // show first point!
+                    intvx = intvy =0;
+                    speedTimer.reset();
+                    
                     point2dl drawPoint=translated[currentLetters].letpoints[0];
                     transform(drawPoint);               // transform it with the current speed and angle
                     IO.writeOutXY(CENTER_AD_MIRROR_X + (int)drawPoint.x , CENTER_AD_MIRROR_Y + (int)drawPoint.y);
-                    speedTimer.reset();
+                    
                     
                     
                     //IO.setRedPower(translated[currentLetters].letpoints[currentPoints].laserSwitch);