05-18-2026, 09:08 PM
This was a graphics demo that I converted to RCBasic some 4 or 5 years ago... I had a few minutes to spare and thought, "Why not?", and modified it to run with N7... Adjust the fwait to suit your device. I had to slow it down as it ran too fast... lol
The original listing would draw all four sides of each surface and 'floodfill'... The use of the more efficient 'draw poly' is the reason for slowing it down...
Code:
set window "Gold Waves", 600, 480, false
set redraw off
#win32
for t = 1 to 99 step 0.3
set color 64, 0, 0
cls
for y1 = 0 to 24
for x1 = 0 to 24
x=(12*(24-x1))+(12*y1)
y=(0-6*(24-x1))+(6*y1)+300
d=((10-x1)^2+(10-y1)^2)^0.5
h=60*sin(x1/4+t)+65
if t > 10 and t < 20 then
h=60*sin(y1/4+t)+65
endif
if t > 20 and t < 30 then
h=60*sin((x1-y1)/4+t)+65
endif
if t > 30 and t < 40 then
h=30*sin(x1/2+t)+30*sin(y1/2+t)+65
endif
if t > 40 and t < 50 then
h=60*sin((x1+y1)/4+t)+65
endif
if t > 50 and t < 60 then
h=60*sin(d*0.3+t)+65
endif
' Draw "wave"
set color 100+h,100+h,h
draw poly [x,y-h,x+10,y+5-h,x+20,y-h,x+10,y-5-h], true ' TOP
set color 60,60,0
draw poly [x,y-h,x+10,y+5-h,x+10,y,x,y-5], true ' FRONT-LEFT
set color 150,150,0
draw poly [x+10,y+5-h,x+10,y,x+20,y-5,x+20,y-h], true ' FRONT-RIGHT
if keydown(KEY_ESCAPE, true) then
end
endif
next
next
redraw
fwait 20
next
wait 1000The original listing would draw all four sides of each surface and 'floodfill'... The use of the more efficient 'draw poly' is the reason for slowing it down...
Logic is the beginning of wisdom.
Live long and prosper.
Live long and prosper.


