
Variable Declarations
FIXEDPOINT VLDx, VRDx, HDx
FIXEDPOINT VLDy, VRDy, HDy
FIXEDPOINT TX1, TY1, TX2, TY2, tx, ty
INTEGER x, y
Code Begins
VLDx = (Cx - Ax) / 16 'Rate of change of X down the left side of the wonky square
VRDx = (Dx - Bx) / 16 'Rate of change of X down the right side
VLDy = (Cy - Ay) / 16 'Rate of change of Y down the left side
VRDy = (Dy - By) / 16 'Rate of change of Y down the right side
TX1 = Ax
TY1 = Ay
TX2 = Bx
TY2 = By
loop y from 0 to 15
HDx = (TX2-TX1) / 16 'Rate of change of X across the wonky polygon
HDy = (TY2-TY1) / 16 'Rate of change of Y across the wonky polygon
tx = TX1
ty = TY1
loop x from 0 to 15
Image2(x, y) = Image1( int(tx), int(ty) )
tx = tx + HDx
ty = ty + HDy
end of x loop
TX1 = TX1 + VLDx;
TY1 = TY1 + VLDy;
TX2 = TX2 + VRDx;
TY2 = TY2 + VRDy;
end of y loop
|