Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SCREEN 400,300
- 'Const sw=400
- 'Const sh=300
- sw=200
- sh=150
- SCREEN sw,sh,0,2
- Smooth2D ON
- kuva=LoadImage("media/map.bmp")
- ResizeImage kuva,sw,sh
- DrawImage kuva,0,0
- DrawScreen
- precalc= Timer()
- Dim offset(sw,sh,1) As Float
- Dim col(sw,sh,2)
- 'Lock' Image(kuva)
- For x=1 To sw-1
- For y=1 To sh-1
- ox=0
- oy=0
- For xx=-1 To 1
- For yy=-1 To 1
- PickImageColor kuva,x+xx,y+yy
- If xx And yy Then
- c=((getRGB(RED)+getRGB(GREEN)+getRGB(BLUE)))/3
- 'v=GetPixel(x+xx,y+yy)
- If xx=0 And yy=0 Then d=c
- d=Distance(0,0,xx,yy)
- ox=ox+c*xx/d
- oy=oy+c*yy/d
- Else
- col(x,y,0)=getRGB(RED)
- col(x,y,1)=getRGB(GREEN)
- col(x,y,2)=getRGB(BLUE)
- EndIf
- Next yy
- Next xx
- 'SetWindow ""+ox
- 'normalisoini tänne
- offset(x,y,0)=ox'-d*3
- offset(x,y,1)=oy'-d*3
- Next y
- SetWindow ""+(x/2)
- Next x
- 'Unlock
- precalc = Timer() - precalc
- Repeat
- t=Timer()/3
- x1=sw/2+Sin(t/5)*sw/3
- x2=sw/2+Sin(t/7)*sw/3
- x3=sw/2+Sin(t/11)*sw/3
- y1=sh/2+Sin(t/7)*sh/3
- y2=sh/2+Sin(t/11)*sh/3
- y3=sh/2+Sin(t/13)*sh/3
- Lock
- For x=1 To sw-1
- 'a= Not a
- For y=1+a To sh-2 'Step 2
- 'v3=ATan(20/Distance(x3,y3,x+offset(x,y,0),y+offset(x,y,1)))
- 'v2=ATan(20/Distance(x2,y2,x+offset(x,y,0),y+offset(x,y,1)))
- 'v=ATan(20/Distance(x1,y1,x+offset(x,y,0),y+offset(x,y,1)))
- 'PutPixel2 x,y,'v+v2 shl 8 +v3 shl 16'<>0)*255
- 'v#=ATan(20/Distance(x1,y1,x+offset(x,y,0),y+offset(x,y,1)))/90
- 'v3#=ATan(20/Distance(x3,y3,x+offset(x,y,0),y+offset(x,y,1)))/90
- 'v2#=ATan(20/Distance(x2,y2,x+offset(x,y,0),y+offset(x,y,1)))/90
- v#=sin(ATan(10/Distance(x1,y1,x-offset(x,y,0),y-offset(x,y,1))))'/90
- v3#=sin(ATan(10/Distance(x3,y3,x-offset(x,y,0),y-offset(x,y,1))))'/90
- v2#=sin(ATan(10/Distance(x2,y2,x-offset(x,y,0),y-offset(x,y,1))))'/90
- 'v#=valo(int(x+offset(x,y,0)+256+sw+x1),Int(y+offset(x,y,1)+256+sh)+x2)
- PutPixel2 x,y,Int(col(x,y,0)*v Shl 16+col(x,y,1)*v2 Shl 8+col(x,y,2)*v3)
- 'CopyBox int(x+offset(x,y,0)),Int(y+offset(x,y,1)),1,1,x-sw/2,y-sh/2,Image(kuva),SCREEN()
- Next y
- Next x
- Unlock
- SetWindow FPS()+" "+precalc
- DrawScreen OFF
- Forever
- WaitKey
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement