topical media & game development

talk show tell print

math -- animation 4

math(s) / tutorial(s)

combine color(s)



  color24 = red << 16 | green << 8 | blue;
  color32 = alpha << 24 | red << 16 | green << 8 | blue;
  

extract color(s)



  red = color24 >> 16;
  green = color24 >> 8 & 0xFF;
  blue = color24 & 0xFF;
  

  alpha = color32 >> 24;
  red = color32 >> 16;
  green = color32 >> 8 & 0xFF;
  blue = color32 & 0xFF;
  

draw curve(s)



     // draw through (xt,yt) with endpoints (x0,y0) and (x2,y2)
  x1 = xt * 2 - (x0 + x2)/2; 
  y1 = xt * 2 - (y0 + y2)/2; 
  moveTo(x0,y0);
  curveTo(x1,y1,x2,y2);
  


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.