exspline(3alleg4)


NAME

   exspline  -  Constructing  smooth  movement  paths  from spline curves.
   Allegro game programming library.

SYNOPSIS

   #include <allegro.h>

   Example exspline

DESCRIPTION

   This program demonstrates the use of spline  curves  to  create  smooth
   paths  connecting  a  number  of  node  points.  This can be useful for
   constructing realistic motion and animations.

   The technique is to connect the series of guide  points  p1..p(n)  with
   spline curves from p1-p2, p2-p3, etc. Each spline must pass though both
   of its guide points, so they must be used as the first  and  fourth  of
   the  spline  control  points.  The  fun  bit is coming up with sensible
   values for the second and third spline control points,  such  that  the
   spline  segments  will  have equal gradients where they meet. I came up
   with the following solution:

   For each guide point p(n), calculate the desired tangent to  the  curve
   at that point. I took this to be the vector p(n-1) -> p(n+1), which can
   easily be calculated with  the  inverse  tangent  function,  and  gives
   decent looking results. One implication of this is that two dummy guide
   points are needed at each end of the  curve,  which  are  used  in  the
   tangent calculations but not connected to the set of splines.

   Having  got  these  tangents,  it  becomes fairly easy to calculate the
   spline control points. For a spline between guide points p(a) and p(b),
   the  second  control  point  should lie along the positive tangent from
   p(a), and the third control point should lie along the negative tangent
   from  p(b).  How  far they are placed along these tangents controls the
   shape of the curve: I found that applying a 'curviness' scaling  factor
   to the distance between p(a) and p(b) works well.

   One  thing  to  note about splines is that the generated points are not
   all equidistant. Instead they tend to bunch up nearer to  the  ends  of
   the  spline,  which  means you will need to apply some fudges to get an
   object to move at a constant speed. On the other  hand,  in  situations
   where  the  curve  has  a  noticeable change of direction at each guide
   point, the effect can be quite nice because it makes  the  object  slow
   down for the curve.

SEE ALSO

   END_OF_MAIN(3alleg4),    SCREEN_W(3alleg4),    acquire_screen(3alleg4),
   alert(3alleg4),     allegro_error(3alleg4),      allegro_init(3alleg4),
   allegro_message(3alleg4),   calc_spline(3alleg4),  circlefill(3alleg4),
   clear_keybuf(3alleg4),                         clear_to_color(3alleg4),
   desktop_palette(3alleg4),      fixatan2(3alleg4),      fixcos(3alleg4),
   fixed(3alleg4),  fixmul(3alleg4),  fixsin(3alleg4),   fixsqrt(3alleg4),
   fixtof(3alleg4),   fixtoi(3alleg4),   font(3alleg4),   ftofix(3alleg4),
   install_keyboard(3alleg4),                      install_mouse(3alleg4),
   install_timer(3alleg4),          itofix(3alleg4),         key(3alleg4),
   keypressed(3alleg4), line(3alleg4), makecol(3alleg4), mouse_b(3alleg4),
   mouse_x(3alleg4),       mouse_y(3alleg4),       palette_color(3alleg4),
   poll_mouse(3alleg4),     readkey(3alleg4),     release_screen(3alleg4),
   screen(3alleg4),      set_gfx_mode(3alleg4),      set_palette(3alleg4),
   show_mouse(3alleg4),    spline(3alleg4),    textout_centre_ex(3alleg4),
   textprintf_centre_ex(3alleg4),  textprintf_ex(3alleg4), vsync(3alleg4),
   xor_mode(3alleg4)





Opportunity


Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.

Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.





Free Software


Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.


Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.





Free Books


The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.


Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.





Education


Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.


Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.