'=========================================================================== ' Subject: 3D WAVE PATTERN Date: 08-13-97 (08:25) ' Author: Davey W. Taylor Code: QB, QBasic, PDS ' Origin: audio.squad@mailbox.swipnet.se Packet: GRAPHICS.ABC '=========================================================================== '旼컴컴컴컴컴컴컴컴컴컴컴--컴�--� -� � '� ** 3D WAVE PATTERN ** '� Created by Davey W Taylor '� '� This is the original pattern I used for the 3d-flag program. '� I would like to know if it is possible to map an image to '� this pattern using pure basic (no asm). I'm not looking for '� speed, just a good, working program! '� Anyway, if you use this pattern directly or as a base for '� some other graphical thingy, I would appreciate if you mention '� my name... So if you have some code for the image mapping, email! '� '� NOTE: This program uses real time calculation for the pixel pos's '� precalculating this into an array would increase the speed '� tremendously! I simply didn't have the time or will... '� '� ALSO! THE 3D-FLAG EDITOR IS DONE! YOU CAN DOWNLOAD THE PROGRAM AT '� http://dix.dubna.ru/flagdraw/ '� I WILL RELEASE THE SOURCE IN THE NEXT PACKAGE... '읕컴컴--컴�- � � ' ** If you have any comments / suggestions / questions, my email is: ** ' ** audio.squad@mailbox.swipnet.se ** SCREEN 1 CONST pi2! = 6.283186 'pi * 2 CONST speed! = .1 'flag speed CONST movement% = 2 'movement amount CONST space% = 10 'space between pixels CONST startx% = 100 'start x coord. of flag CONST starty% = 70 'start y coort. of flag CONST xsize% = 10 'amount of horiz. pixels CONST ysize% = 5 'amount of vert. pixels CONST wavem! = 1 'waves multiplier DIM d!(1 TO xsize%, 1 TO ysize%) FOR x% = 1 TO xsize% FOR y% = 1 TO ysize% d!(x%, y%) = (x% + y%) / wavem! DO WHILE d!(x%, y%) > pi2! d!(x%, y%) = d!(x%, y%) - pi2! LOOP NEXT y% NEXT x% DO ' WAIT &H3DA, 8 'make it not so fast... FOR x% = 1 TO xsize% FOR y% = 1 TO ysize% d!(x%, y%) = d!(x%, y%) + speed! 'calc. and draw pixels PSET (startx% + (x% * space%) + (COS(d!(x%, y%) - speed!) * movement%), starty% + (y% * space%) + (SIN(d!(x%, y%) - speed!) * movement%)), 0 PSET (startx% + (x% * space%) + (COS(d!(x%, y%)) * movement%), starty% + (y% * space%) + (SIN(d!(x%, y%)) * movement%)), 15 IF d!(x%, y%) > pi2! THEN d!(x%, y%) = d!(x%, y%) - pi2! NEXT y% NEXT x% LOOP WHILE INKEY$ = ""