1. Куча / Говнокод #15879

    +117

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    92. 92
    93. 93
    94. 94
    95. 95
    96. 96
    97. 97
    98. 98
    DataSection
      Data.f 0.0025,0.0026,0.00235
    EndDataSection
    
    Global SCREENWIDTH,SCREENHEIGHT
    
    Define .f:bitplanes.b=32
    
    SCREENWIDTH=GetSystemMetrics_(#SM_CXSCREEN)
    SCREENHEIGHT=GetSystemMetrics_(#SM_CYSCREEN)
    
    If InitSprite()=0 Or InitSprite3D()=0 Or InitKeyboard()=0
      MessageRequester("Error","Can't access DirectX",0)
      End
    EndIf
    
    desktop.l = CreateImage(0,DesktopWidth(0),DesktopHeight(0))
    hdc.l = StartDrawing(ImageOutput(0))
    SelectObject_(hdc,desktop)
    BitBlt_(hdc,0,0,DesktopWidth(0),DesktopHeight(0),GetDC_(GetDesktopWindow_()),0,0,#SRCCOPY)
    StopDrawing()
    DeleteDC_(hdc)
    
    While OpenScreen(SCREENWIDTH,SCREENHEIGHT,bitplanes.b,"FullScreen")=0
      If bitplanes.b>16
        bitplanes.b-8
      ElseIf SCREENHEIGHT>600
        SCREENWIDTH=800
        SCREENHEIGHT=600
      ElseIf SCREENHEIGHT>480
        SCREENWIDTH=640
        SCREENHEIGHT=480
      ElseIf SCREENHEIGHT>400
        SCREENWIDTH=640
        SCREENHEIGHT=400
      ElseIf SCREENHEIGHT>240
        SCREENWIDTH=320
        SCREENHEIGHT=240
      ElseIf SCREENHEIGHT>200
        SCREENWIDTH=320
        SCREENHEIGHT=200
      Else
        MessageRequester("Listen:","Can't open Screen!",0)
        End
      EndIf
    Wend
    w=DesktopWidth(0)
    h=DesktopHeight(0)
    z=1000/Sqr(3)
    perspw=w
    PerspectiveAngle.d=#PI/16
    CreateSprite(0,w,h,#PB_Sprite_Texture)
    StartDrawing(SpriteOutput(0))
    DrawImage(ImageID(0),0,0)
    StopDrawing()
    DisplaySprite(0,0,0)
    FlipBuffers()
    DisplaySprite(0,0,0)
    CreateSprite3D(0,0)
    x3=w-1
    x4=0
    y3=h
    y4=h
    z3=z
    z4=z
    For t.b=1 To 3
      omega=-omega
      Read alfa
      Repeat
        ExamineKeyboard()
        ClearScreen(0)
        Incrz=h*Sin(Angle)
        x1=Incrz*Tan(PerspectiveAngle)
        x2=x3-x1
        y1=h-h*Cos(Angle)
        y2=y1
        z1=z+Incrz/4.75
        z2=z1:Start3D()
        TransformSprite3D(0,x1,y1,z1,x2,y2,z2,x3,y3,z3,x4,y4,z4)
        DisplaySprite3D(0,0,0,255)
        Stop3D()
        omega+alfa
        If omega<0
          Angle-Pow(omega,2)
        Else
          Angle+Pow(omega,2)
        EndIf
        If Angle<0 Or Angle>4/5*#PI
          Break
        EndIf
        FlipBuffers()
        Delay(10)
      Until KeyboardPushed(#PB_Key_Escape)
    Next
    DisplaySprite(0,0,0)
    FlipBuffers()
    Delay(10)
    DisplaySprite(0,0,0)

    Очень интересный эффект - экран "отшатывается" от юзера :)
    Для компиляции понадобится PureBasic не ниже 4.50

    Запостил: brutushafens, 01 Мая 2014

    Комментарии (7) RSS

    Добавить комментарий