LaserBoy also renders frames and frame sets from functions. This was how I made art in LaserBoy before I wrote the drawing tools. Many of the frames that come with LaserBoy were math generated.
This is a snippet from the Linux version of LaserBoy. Since I had so much other work to do in porting LaserBoy to any OS, I haven't worked on this. But it's still in there. There is just no easy interface for it.
In order to make use of it, you would need to be able to compile the source.
Code:
//################################################################################
ez_ilda_point A(int point, int frame_index) // single frame, 40 points, 3D spring
{
ez_ilda_point P;
float factor = (point / 8.0) * two_pi;
P.x = (short int)(900 * sin(factor));
P.y = (short int)(900 * cos(factor));
P.z = (short int)(point * 300 - 6000);
P.k = 0;
P.c = 1;
return P;
}
//################################################################################
ez_ilda_point B(int point, int frame_index)
{
ez_ilda_point P;
float factor = (point / 20.0) * two_pi,
shift = (two_pi / 60.0) * frame_index;
P.x = (short int)(point * 1200);
P.y = (short int)(sin(3.5 * factor + shift) * point * 200);
P.z = (short int)(0);
P.k = 0;
P.c = point * 2 + 2;
return P;
}
//################################################################################
// The functions A, B and F are definitions for all points in an ez_ilda_frame
// and possibly all frames in an animated frame set.
// There is are ctors for ez_ilda_frame and for ez_ilda_frame_set
// ez_ilda_frame(ez_ilda_point(*F)(int, int), int points_per_frame, int frame_index);
// ez_ilda_frame_set(ez_ilda_point(*F)(int, int), int points_per_frame, int num_frames);
// When calling these the total number of points and frames is defined.
//--------------------------------------------------------------------------------
ez_ilda_point F(int point, int frame_index)
{
ez_ilda_point P;
float factor = (point / 699.0) * 30 * pi;
P.x = (short int)(22000 * sin(factor) * (sin(31 * factor / 15)) );
P.y = (short int)(22000 * cos(factor) * (sin(31 * factor / 15)) );
P.z = (short int)((point * 40) - 14000);
P.k = 0;
P.c = point % 253 + 2;
return P;
}