DIBUJO ASISTIDO POR ORDENADOR
LISTADO 1

   DECLARE FUNCTION MAX! (a!, b!)
   Valores de prueba
   X1 = 0: Y1 = 30: X2 = 320: Y2 = 170: C = 2
   ' MODO 320x200
   SCREEN 1
   Componentes del vector desplazamiento
   DX = X2 - X1
   DY = Y2 - Y1
   NUMERO DE PASOS
   ST = INT(MAX(ABS(DX), ABS(DY))) + 1
   Tamaño del paso en cada dirección
   DXS = DX / ST
   DYS = DY / ST
   Redondeo inicial
   X = X1 + .5
   Y = Y1 + .5
   Bucle de dibujo
   FOR U = 1 TO ST
   Iluminamos el pixel
   PSET (INT(X), INT(Y)), C
   Punto siguiente
   X = X + DXS
   Y = Y + DYS
   NEXT U
   Punto final
   PSET (INT(X), INT(Y)), C
   FUNCTION MAX (a, b)
   IF (a > b) THEN
   MAX = a
   ELSE
   MAX = b
   END IF

Índice


© 1996-99, euitmt WWW team
Última modificación: 9 de Julio de 1999 - 13:38:09