So one of the most challenging parts of computer graphics has been imitating human movement.
And since I study anthropology, human movement is something I focus on.
So my upgrade of my graphics program, was actually a rewrite, not an upgrade although the tricky functions and the real difficult algorithms, I didn't rewrite I merely copied my previous code for that function.
So I reused a lot of my graphic functions I developed.
I think I have some code on this computer maybe, I will check to show you what a graphics function looks like, one line of algebra...
function change_back(fname:pathstr):boolean;
var
f:file;
scrolbw:real;
wid, hit,spx,spy:word;
g,g2,g3,g4:longint;
nnf,atx,aty,x,y,x2,y2,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10:integer;
actread:integer;
i,j:longint;
pallet:palrec;
clpsav:string;
procedure readpix(x,y:integer);
var
i,j:longint;
thinv:array[1..4024] of byte;
ax,ay,xx,yy,sy,sx:integer;
xxr,yyr:longint;
realwid,realhit,ht:real;
s1,s2,s3,s4:string;
begin
ax:=x;
ay:=y;
realhit:=hit*g;
realhit:=realhit/g2;
realwid:=wid*g;
realwid:=realwid/g2;
sx:=round(realwid/wid);
sy:=round(realhit/hit);
if sx < 1 then sx:=1;
if sy < 1 then sy:=1;
str(ax,s1);
str(ay,s2);
str(round(realwid),s3);
str(round(realhit),s4);
trecs(20,20,getmaxx-20,60,
'Pos X:'+s1+' Pos Y:'+s2+' Width:'+s3+' Height:'+s4);
setviewport(clpboxspot.x,clpboxspot.y,
clpboxspot.x+clpsize.x,clpboxspot.y+clpsize.y,clipon);
for j:= 1 to hit do
begin
blockread(f,thinv,wid,actread);
if keypressed then break;
{if ((aty+round((j*g)/g2)) > y) and
((aty+round((j*g)/g2))+sy < y2)
then}
yyr:=j*g;
yyr:=round(yyr/g2);
yy:=round(yyr);
if ay+yy > clpsize.y then break;
if (ay+yy > 0) then
begin
for i:= 1 to wid do
if thinv[i] <> 0 then
{if (atx+round((i*g)/g2) > x) and (atx+round((i*g)/g2)+sx < x2 ) then}
begin
setfillstyle(1,thinv[i]);
xxr:=i*g;
xxr:=round(xxr/g2);
xx:=round(xxr);
if (ax+xx > 0) then
if (ax+xx <= clpsize.x) then
bar(ax+xx,ay+yy,ax+xx+sx,ay+yy+sy);
end;
end;
end; {j}
setviewport(0,0,getmaxx,getmaxy,clipon);
end;
var
nn3,nn4,ax,ay:integer;
begin
get_area(20,20,getmaxx-20,60,'TEMP5.VAL');
trecs(20,20,getmaxx-20,60,'Capturing '+fname+' Frames to Prefix BAK');
change_back:=false;
assign(f,fname);
{$I-}
reset(f,1);
{$I+}
if ioresult <> 0 then
begin
exit;
end;
if (clpsize.x < 10) then
clpsize.x:=10;
if clpsize.y < 10 then
clpsize.y:=10;
if clpboxspot.x+clpsize.x > (maxx-2) then
begin
clpsize.x:=(maxx-2)-clpboxspot.x;
end;
if clpboxspot.y+clpsize.y > (maxy-2) then
begin
clpsize.y:=(maxy-2)-clpboxspot.y;
end;
blockread(f,wid,2,actread);
blockread(f,hit,2,actread);
seek(f,filesize(f)-772);
blockread(f,atx,2,actread);
blockread(f,aty,2,actread);
x:=clpboxspot.x;
x2:=clpboxspot.x+clpsize.x;
y:=clpboxspot.y;
y2:=clpboxspot.y+clpsize.y;
atx:=1;
aty:=1;
seek(f,4);
g:=100;
g2:=100;
begin
clpsav:=clpprefix;
n1:=10;
n2:=atx;
n3:=aty;
n4:=100;
n5:=100;
n6:=10;
n7:=0;
n8:=0;
n9:=0;
n10:=0;
if snumboxy(1999,-1000,'Moving Background',n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,
'Number of Clips BAK1..BAK[n].VCX','Start X Position from CLP BOX',
'Start Y Position from CLP BOX',
'Start Zoom In Factor','Start Zoom Out Factor',
'Add Zoom In Factor Each Frame',
'Add Zoom Out Each Frame',
'+ Pan Left / - Pan Right Each Frame',
'+ Pan Up / - Pan Down Each Frame','',false) =false then
begin
get_area(20,20,getmaxx-20,60,'TEMP.VAL');
trecs(20,20,getmaxx-20,60,'Cancelled');
getzey;
close(f);
put_area(20,20,getmaxx-20,60,'TEMP.VAL');
put_area(20,20,getmaxx-20,60,'TEMP5.VAL');
exit;
end;
atx:=n2;
aty:=n3;
nnf:=n1;
clpprefix:='BAK';
ax:=atx;
ay:=aty;
g:=n4;
g2:=n5;
nn3:=n8;
nn4:=n9;
for i:= 2 to nnf+1 do
begin
if keypressed then
break;
if g=0 then g:=1;
if g2=0 then g2:=1;
setfillstyle(1,0);
bar(clpboxspot.x,clpboxspot.y,clpboxspot.x+clpsize.x,
clpboxspot.y+clpsize.y);
reset(f,1);
seek(f,4);
readpix(atx,aty);
seek(f,filesize(f)-772);
blockwrite(f,atx,2,actread);
blockwrite(f,aty,2,actread);
close(f);
g:=g+n6;
g2:=g2+n7;
atx:=n2+nn3;
aty:=n3+nn4;
ax:=atx;
ay:=aty;
nn3:=nn3+n8;
nn4:=nn4+n9;
setwritemode(xorput);
setcolor(255);
rectangle(x-1,y-1,x2+1,y2+1);
setwritemode(copyput);
cap_it(clpboxspot.x,clpboxspot.y,clpboxspot.x+clpsize.x,
clpboxspot.y+clpsize.y,f_clip2(i));
setwritemode(xorput);
setcolor(255);
rectangle(x-1,y-1,x2+1,y2+1);
setwritemode(copyput);
end;
end;
{clpprefix:=clpsav;}
change_back:=true;
put_area(20,20,getmaxx-20,60,'TEMP5.VAL');
end;
So there you go. I know I am a nerd I will admit it.
That is all variables and algebra.
Calling other functions elsewhere, in the program, and with a nested function that it calls, placed in the function above the code to do a sub process that is required for that function. All as part of some morphing function or other and animation and accessing a file to do it.
Clearly not something that most ordinary people can do, comprehend, use or remember or debug.
But that is what it takes to do this type of high end graphics programming.
And I don't add lines of text like you do when you work for someone else to tell future programmers what the heck it is and what it does.
You have to comment almost every line but since it is just for me and I understand it well, I don't even comment my code unless it is very very confusing code.
All the variables you name yourself and with Windows code you need to use descriptive language to help understand what the function does.
I often don't bother with that either.