Commits

Christopher De Vries committed 443425b

Modified pov code once lights were available, it needs speed.

Comments (0)

Files changed (1)

pov_sketch_bm/pov_sketch_bm.pde

 const unsigned int BLUE = 0x04;
 const unsigned int WHITE = 0x07;
 
-const int inverse_velocity=25; // Inverse of pixels per millisecond motion
+const int inverse_velocity=15; // Inverse of pixels per millisecond motion
 const int overshoot=15; // Pixel overshoot from edge on motion
 
 const int FORWARD=0;
 /* position of strands, measured in pixels */
 int strand_pos[STRANDS] = {
   12,
-  37
+  40
 };
 /* pixel starts of strands in LED chain */
 int strand_start[STRANDS] = {
     }
     else {
       for(j=0;j<pov_image.ny;j++) {
-        set_pixel(&strand_image,0,pov_image.ny*i+j,BLACK);
+        set_pixel(&strand_image,0,strand_start[i]+j,BLACK);
       }
     }
   }
   
   /* Draw the rabbit */
   rabbit_pos = x+rabbit_offset;
-  if(rabbit_pos>=0 && rabbit_pos<rabbit_length) {
-    set_pixel(&strand_image,0,rabbit_start+rabbit_pos,RED);
+  for(i=rabbit_start;i<rabbit_start+rabbit_length;i++) {
+    if(i==rabbit_pos+rabbit_start) {
+      set_pixel(&strand_image,0,i,RED);
+    }
+    else {
+      set_pixel(&strand_image,0,i,BLACK);
+    }
   }
 
   lightStrand_SendEmptyFrame();
-  for(i=0;i<STRANDS*pov_image.ny;i++) {
+  for(i=0;i<STRANDS*pov_image.ny+rabbit_length;i++) {
     get_pixel_rgb(&strand_image,0,i,&red,&green,&blue);
     lightStrand_SendColor(red,green,blue);
   }