Whatever, some of you may know, for very long time there was a tool, a physical tool to reproduce or resize an drawing. I don't remember the name and can't find it on google, so let me explain : On one end you hold a pencil, drawing the original, and on the other end there was another pencil which draw the resized pic. The pencils where connected through this undescriptible (but simple) mecanisme i can't tell in english, hey .. there was a fixed plot and the 2 pencils where waving around. It was like pliers. Hence i want to make that run in Qbasic.
The green plots are pencils, the black plot is the fixed center. I never used such a thing... but i was wondering if i could make a sort of zoom using the idea in qb.
I will draw a shadow behind the object, since this is relative easy. the coordinates of the shadow points are :
If the light spot is before the object at distance 1 at the left bottom, the plan of the shadow is behind the object at distance 1, the shadow will be twice so high than the object, and :
Shadow coordinates for a point(x, y) = X, Y are function of the distance to bottom * factor (=(distance plan/distance spot) * 2, or something alike)
One must remember however that the shadow will hold as much points as the object, NO MORE ! since the shadow is bigger than the object, it will contain holes... So if one would like to achieve a plain colored (screen 2 = black) shadow, this is more difficult imho.
'get the spot coordinates, from the right bottom, XS, YS :
XS = 0: YS = 0
FOR xx = 370 TO 170 STEP -1
FOR yy = 40 TO 130
IF POINT(xx, yy) = 1 THEN XS = xx: EXIT FOR
NEXT yy
IF XS <> 0 THEN EXIT FOR
NEXT xx
FOR yy = 130 TO 40 STEP -1
FOR xx = 170 TO 370
IF POINT(xx, yy) = 1 THEN YS = yy: EXIT FOR
NEXT xx
IF YS <> 0 THEN EXIT FOR
NEXT yy
PRINT XS, YS
XS = XS + 200
'YS = YS + 10
'draw the shadow, from top :
FOR y = 40 TO 130 STEP 2
FOR x = 170 TO 370 STEP 2
IF POINT(x, y) = 1 THEN
a = RND * 2 + 1
PSET (x + ((x - XS) * F + a), y + ((y - YS) * F) + a), 1
END IF
NEXT x
NEXT y