Post by tsh73 on May 26, 2023 14:14:18 GMT
So as Wikipedia says, eye/brain has some 80 ms lag - between something happened and you actually got it.
But how we can reflect flying balls?
Brain predicts where ball would be.
This program shows this lag. Run it with dt=500, see there are no tricks in the program
- red dot appears for single tact, in sync with green one
Now uncomment next line (dt=40)
I clearly see red light lags!
(Haha
I did it after few days of looking to Wikipedia article.
And so my colors are reversed and bullet is too big.
Anyway effect shows - thogh not as good as in Wikiperia animation.
)
But how we can reflect flying balls?
Brain predicts where ball would be.
This program shows this lag. Run it with dt=500, see there are no tricks in the program
- red dot appears for single tact, in sync with green one
Now uncomment next line (dt=40)
I clearly see red light lags!
(Haha
I did it after few days of looking to Wikipedia article.
And so my colors are reversed and bullet is too big.
Anyway effect shows - thogh not as good as in Wikiperia animation.
)
'Flash lag illusion
'https://en.m.wikipedia.org/wiki/Flash_lag_illusion
nomainwin
open "Flash lag illusion" for graphics_nsb_nf as #gr
#gr "trapclose [quit]"
#gr "down; fill black; home; posxy cx cy"
dt=500 ' set dt to 500. You see red dot appears for single tact, in sync with green one
'dt=40 'now set dt smaller. I clearly see red light lags!
dx=10
s=10
x=0
xs=s*int(cx/s)
timer dt, [tick]
wait
[tick]
#gr "discard"
#gr "place ";x;" ";cy
#gr "backcolor black"
#gr "boxfilled ";x+s;" ";cy+s
if x=xs then
#gr "place ";x;" ";cy+2*s
#gr "backcolor black"
#gr "boxfilled ";x+s;" ";cy+s+2*s
end if
x=x+s
#gr "place ";x;" ";cy
#gr "backcolor green"
#gr "boxfilled ";x+s;" ";cy+s
if x=xs then
#gr "place ";x;" ";cy+2*s
#gr "backcolor red"
#gr "boxfilled ";x+s;" ";cy+s+2*s
end if
if x>2*cx then x = 0
wait
[quit]
timer 0
close #gr
end