Guest User

Untitled

a guest
May 14th, 2018
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Graphics3D 800, 600, 0, 2
  2.  
  3.  
  4. image = LoadTexture("tosw.png")
  5.  
  6.  
  7. image2 = LoadTexture("tosw2.png")
  8.  
  9.  
  10. SetBuffer( TextureBuffer( image2 ) )
  11.  
  12. LockBuffer()
  13.  
  14. For x = 0 To 255
  15.     For y = 0 To 255
  16.         rgb = ReadPixelFast( x, y )
  17.         r = (rgb And $FF0000)/$10000
  18.         g = (rgb And $FF00)/$100
  19.         b = rgb And $FF
  20.         asdf = ( r + g + b ) / 3
  21.         rgb2 = 256*$1000000 + asdf*$10000 + asdf*$100 + asdf
  22.         WritePixelFast( x, y, rgb2 )
  23.     Next
  24. Next
  25.  
  26. UnlockBuffer()
  27.  
  28.  
  29. timer = CreateTimer( 60 )
  30.  
  31.  
  32. SetBuffer BackBuffer()
  33.  
  34.  
  35. alpha# = 1.0
  36.  
  37. camera = CreateCamera()
  38. PositionEntity camera, 0, 0, -4
  39.  
  40. cube1 = CreateCube()
  41. EntityTexture cube1, image
  42. cube2 = CreateCube()
  43. EntityTexture cube2, image2
  44.  
  45.  
  46.  
  47.  
  48. Repeat
  49.    
  50.     If alpha > 0 Then alpha = alpha - 0.005
  51.    
  52.     EntityAlpha cube1, alpha
  53.    
  54.     RenderWorld
  55.     UpdateWorld
  56.    
  57.     WaitTimer timer
  58.     Flip 0
  59.     Cls
  60.    
  61. Until KeyHit( 1 )
  62.  
  63.  
  64. End
Add Comment
Please, Sign In to add comment