GDI+ PunkteDieVonWändenAbprallenScript

  • Hier ein kleines GDI+ Script mit Punkten die von den Wänden abprallen :D
    Kollisionen unter den Punkten zu überwachen war mir leider noch zu kompliziert. Ich glaube kaum das das irgendjemand wirklich gebrauchen kann. Und ich weiß auch nicht, ob es das hier schon gibt. Und dennoch musste ich das einfach mal loswerden...

    Spoiler anzeigen
    [autoit]


    #include <GDIPlus.au3>
    #include <GUIConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Global $GUIWidth = 400 ;Breite GUI
    Global $GUIHeight = 400 ;Höhe GUI
    Global $BallWidth = 20 ;Breite Punkte
    Global $BallHeight = 20 ;Höhe Punkte
    Global $BallCount = 10 ;Anzahl Punkte
    Global $GUIColorBG = 0xFF000000 ;Farbe GUI
    Global $BallColor = 0xFFFFFFFF ;Farbe Punkte

    [/autoit] [autoit][/autoit] [autoit]

    Global $Title = 1
    Global $iX[$BallCount]
    Global $iY[$BallCount]
    Global $StepX[$BallCount]
    Global $StepY[$BallCount]

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To $BallCount - 1
    $iX[$i] = Random($BallWidth + 10, $GUIWidth - $BallWidth - 10)
    $iY[$i] = Random($BallHeight + 10, $GUIHeight - $BallHeight - 10)
    Do
    $StepX[$i] = Random(-5, 5, 1)
    $StepY[$i] = Random(-5, 5, 1)
    Until Not ($StepX[$i] = 0 And $StepY[$i] = 0)
    Next

    [/autoit] [autoit][/autoit] [autoit]

    $hWnd = GUICreate("Punkteanzahl: " & $BallCount, $GUIWidth, $GUIHeight)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_Startup()

    [/autoit] [autoit][/autoit] [autoit]

    Global $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
    Global $hBitmap = _GDIPlus_BitmapCreateFromGraphics($GUIWidth, $GUIHeight, $hGraphic)
    Global $Buffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsSetSmoothingMode($Buffer, 2)
    _GDIPlus_GraphicsClear($Buffer, $GUIColorBG)
    Global $hBrush = _GDIPlus_BrushCreateSolid($BallColor)

    [/autoit] [autoit][/autoit] [autoit]

    AdlibRegister("_Draw", 20)
    AdlibRegister("_ChangeTitle", 4000)

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    AdlibUnRegister()
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_GraphicsDispose($Buffer)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
    Exit
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Draw()
    _GDIPlus_GraphicsClear($Buffer, $GUIColorBG)
    For $i = 0 To $BallCount - 1
    _GDIPlus_GraphicsFillEllipse($Buffer, $iX[$i], $iY[$i], $BallWidth, $BallHeight, $hBrush)
    $iX[$i] += $StepX[$i]
    $iY[$i] += $StepY[$i]
    If $iX[$i] >= $GUIWidth - $BallWidth Then $StepX[$i] = $StepX[$i] * - 1
    If $iY[$i] >= $GUIWidth - $BallHeight Then $StepY[$i] = $StepY[$i] * - 1
    If $iX[$i] <= 0 Then $StepX[$i] = $StepX[$i] * - 1
    If $iY[$i] <= 0 Then $StepY[$i] = $StepY[$i] * - 1
    Next
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $GUIWidth, $GUIHeight)
    EndFunc ;==>_Draw

    [/autoit] [autoit][/autoit] [autoit]

    Func _ChangeTitle()
    If $Title = 1 Then
    WinSetTitle($hWnd,"", "Punkteanzahl: " & $BallCount)
    $Title += 1
    ElseIf $Title = 2 Then
    WinSetTitle($hWnd, "", "Punktefarbe: 0x" & Hex($BallColor, 8))
    $Title += 1
    Else
    WinSetTitle($hWnd, "", "GUI Hintergrundfarbe: 0x" & Hex($GUIColorBG, 8))
    $Title = 1
    EndIf
    EndFunc

    [/autoit]
  • Hallo name22
    Dadraus könntest du auch ein Ping Pong für Experten oder Irre bauen.
    Aber gutes Script.
    Jetzt muss ich nur noch lernen, die Collisionen in XNA zu übersetzen :D
    Falls sich jemand mit XNA auskennt, bitte PN an mich ;)
    B2T: Trotzdem gutes Script.
    MfG. PrideRage

    Meine Projekte:
    ClipBoard Manager (beendet)
    Gutes ClipBoard Verwaltungs Programm mit nützlichen Funktionen.

    HTML Creator (beendet)
    Nützliches Tool um schnell ein eigenes HTML Dokument zu erstellen.

  • tolles script. gefällt mir.

    mit Global $BallCount = 500;Anzahl Punkte siehts mal richtig heftig aus :D


    kann bestimmt mal jemand gebrauchen, der nicht weiß wie er nen ball von der wand abprallen lassen soll ;)

  • Hi,
    Ich habe mir mal erlaubt etwas mit deinem Script rum zu spielen (hoffe ist in ordung) und habe mich an kollisionen der punkte gewagt. läuft allerdings manchmal noch etwas buggy.

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>
    #include <GUIConstants.au3>
    #include <Array.au3>
    #Include <Misc.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Global $GUIWidth = 400 ;Breite GUI
    Global $GUIHeight = 400 ;Höhe GUI
    Global $BallWidth = 20 ;Breite Punkte
    Global $BallHeight = 20 ;Höhe Punkte
    Global $BallCount = 10 ;Anzahl Punkte
    Global $GUIColorBG = 0xFF000000 ;Farbe GUI
    Global $BallColor = 0xFFFFFFFF ;Farbe Punkte

    [/autoit] [autoit][/autoit] [autoit]

    Global $Title = 1
    Global $iX[$BallCount]
    Global $iY[$BallCount]
    Global $StepX[$BallCount]
    Global $StepY[$BallCount]
    Global $dll = DllOpen("user32.dll")

    [/autoit] [autoit][/autoit] [autoit]

    HotKeySet("{F10}","Stop")

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To $BallCount - 1
    $iX[$i] = Random($BallWidth + 10, $GUIWidth - $BallWidth - 10)
    $iY[$i] = Random($BallHeight + 10, $GUIHeight - $BallHeight - 10)
    Do
    $StepX[$i] = Random(-3, 3, 1)
    $StepY[$i] = Random(-3, 3, 1)
    Until Not ($StepX[$i] = 0 And $StepY[$i] = 0)
    Next

    [/autoit] [autoit][/autoit] [autoit]

    $hWnd = GUICreate("Punkteanzahl: " & $BallCount, $GUIWidth, $GUIHeight)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_Startup()

    [/autoit] [autoit][/autoit] [autoit]

    ;Macht das GUI zum Bild
    Global $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd);Erstellt ein Grafik-Objekt von einem Fenster-handle
    Global $hBitmap = _GDIPlus_BitmapCreateFromGraphics($GUIWidth, $GUIHeight, $hGraphic);Erstellt ein Bitmap-Objekt aus einem Grafik-Objekt, einer Breite und einer Höhe
    Global $Buffer = _GDIPlus_ImageGetGraphicsContext($hBitmap) ;Ermittelt den Grafikkontext des Bildes
    _GDIPlus_GraphicsSetSmoothingMode($Buffer, 2);Legt die Renderqualität des Grafik-Objekts fest.
    _GDIPlus_GraphicsClear($Buffer, $GUIColorBG) ;Färbt ein Grafik-Objekt in einer festgelegten Farbe
    Global $hBrush = _GDIPlus_BrushCreateSolid($BallColor) ;Erstellt ein vollfarbiges Füllmuster-Objekt

    [/autoit] [autoit][/autoit] [autoit]

    AdlibRegister("_Draw", 10)
    AdlibRegister("_ChangeTitle", 4000)

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    ;Beenden der Adlib Funktion
    AdlibUnRegister()
    ;Löschen der Bitmaps etc. und beenden vom GDI+ Mode
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_GraphicsDispose($Buffer)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
    ;Programm beenden
    Exit
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Draw()
    _GDIPlus_GraphicsClear($Buffer, $GUIColorBG) ; Färbt ein Grafik-Objekt in einer festgelegten Farbe
    For $i = 0 To $BallCount - 1
    _GDIPlus_GraphicsFillEllipse($Buffer, $iX[$i], $iY[$i], $BallWidth, $BallHeight, $hBrush) ;Füllt eine Ellipse
    $iX[$i] += $StepX[$i]
    $iY[$i] += $StepY[$i]

    [/autoit] [autoit][/autoit] [autoit]

    ;Kollisionen mit Wand
    If $iX[$i] >= $GUIWidth - $BallWidth Then $StepX[$i] = $StepX[$i] * - 1
    If $iY[$i] >= $GUIWidth - $BallHeight Then $StepY[$i] = $StepY[$i] * - 1
    If $iX[$i] <= 0 Then $StepX[$i] = $StepX[$i] * - 1
    If $iY[$i] <= 0 Then $StepY[$i] = $StepY[$i] * - 1

    [/autoit] [autoit][/autoit] [autoit]

    ;Kollisionen mit Ball
    For $n = 0 To $BallCount - 1
    If $n = $i Then ContinueLoop
    If $iX[$i] >= $iX[$n] - $BallWidth And $iX[$i] < $iX[$n] + $BallWidth Then
    If $iY[$i]+$BallHeight > $iY[$n] And $iY[$i] < $iY[$n] +$BallHeight Then
    $StepX[$i] = $StepX[$i] * - 1
    $StepX[$n] = $StepX[$n] * - 1
    EndIf
    EndIf
    If $iY[$i]+$BallHeight > $iY[$n] And $iY[$i] < $iY[$n] +$BallHeight Then
    If $iX[$i] >= $iX[$n] - $BallWidth And $iX[$i] < $iX[$n] + $BallWidth Then
    $StepY[$i] = $StepY[$i] * - 1
    $StepY[$n] = $StepY[$n] * - 1
    EndIf
    EndIf
    Next

    [/autoit] [autoit][/autoit] [autoit]

    Next
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $GUIWidth, $GUIHeight) ;Zeichnet ein Bild an einer festgelegten Stelle
    EndFunc ;==>_Draw

    [/autoit] [autoit][/autoit] [autoit]

    Func _ChangeTitle()
    If $Title = 1 Then
    WinSetTitle($hWnd,"", "Punkteanzahl: " & $BallCount)
    $Title += 1
    ElseIf $Title = 2 Then
    WinSetTitle($hWnd, "", "Punktefarbe: 0x" & Hex($BallColor, 8))
    $Title += 1
    Else
    WinSetTitle($hWnd, "", "GUI Hintergrundfarbe: 0x" & Hex($GUIColorBG, 8))
    $Title = 1
    EndIf
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func stop()
    AdlibUnRegister()
    While 1
    Sleep(10)
    If _IsPressed("7A",$dll) = 1 Then ExitLoop ;F11
    WEnd
    AdlibRegister("_Draw", 10)
    AdlibRegister("_ChangeTitle", 4000)
    EndFunc

    [/autoit]

    LG Jakolo

  • Ist doch schon ein guter Ansatz, aber eigentlich meinte ich etwas in der Art das den exakten Abprallwinkel berechnet, da das ja Kugeln sind und keine Rechtecke. Sieht noch ein wenig unrealistisch aus, aber es funktioniert mehr oder weniger.... :thumbup:
    Und hier eine Sensation: GDI+ in 3D. Naja zumindest fast :D . Die Berechnung der Koordinaten für die Polygone hab ich mir bei UEZ abgeschaut (Ich hoffe er hat nichts dagegen).

    Spoiler anzeigen
    [autoit]


    #include <GDIPlus.au3>
    #include <GUIConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Global $GUIWidth = 400
    Global $GUIHeight = 400
    Global $Width1 = 100
    Global $Height1 = 20
    Global $Width2 = 20
    Global $Height2 = 100
    Global $Degree1 = 0
    Global $Degree2 = 0
    Global $Step1 = 1
    Global $Step2 = 3

    [/autoit] [autoit][/autoit] [autoit]

    Global Const $Pi_Div_180 = 4 * ATan(1) / 180
    Global $j = 1
    Global $VectorX, $VectorY
    Global $Points1[5][2]
    $Points1[0][0] = 4
    Global $Points2[5][2]
    $Points2[0][0] = 4

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To 270 Step 90
    $VectorX1 = Cos(($Degree1 - 90 + $i) * $Pi_Div_180) * $Width1 + $GUIWidth / 2
    $VectorY1 = Sin(($Degree1 - 90 + $i) * $Pi_Div_180) * $Height1 + $GUIWidth / 2
    $Points1[$j][0] = $VectorX1
    $Points1[$j][1] = $VectorY1
    $j += 1
    Next
    $j = 1
    For $i = 0 To 270 Step 90
    $VectorX2 = Cos(($Degree2 - 90 + $i) * $Pi_Div_180) * $Width2 + $GUIWidth / 2
    $VectorY2 = Sin(($Degree2 - 90 + $i) * $Pi_Div_180) * $Height2 + $GUIWidth / 2
    $Points2[$j][0] = $VectorX2
    $Points2[$j][1] = $VectorY2
    $j += 1
    Next

    [/autoit] [autoit][/autoit] [autoit]

    $hWnd = GUICreate("GDI+", $GUIWidth, $GUIHeight)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_Startup()

    [/autoit] [autoit][/autoit] [autoit]

    Global $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
    Global $hBitmap = _GDIPlus_BitmapCreateFromGraphics($GUIWidth, $GUIHeight, $hGraphic)
    Global $Buffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsSetSmoothingMode($Buffer, 2)
    _GDIPlus_GraphicsClear($Buffer)
    Global $hPen = _GDIPlus_PenCreate(0xFFFFFFFF, 3)

    [/autoit] [autoit][/autoit] [autoit]

    AdlibRegister("_Draw", 10)

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    _GDIPlus_PenDispose($hPen)
    _GDIPlus_GraphicsDispose($Buffer)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
    Exit
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Draw()
    _GDIPlus_GraphicsClear($Buffer)
    _GDIPlus_GraphicsDrawPolygon($Buffer, $Points1, $hPen)
    _GDIPlus_GraphicsDrawPolygon($Buffer, $Points2, $hPen)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $GUIWidth, $GUIHeight)
    $Degree1 += $Step1
    $Degree2 += $Step2
    $j = 1
    For $i = 0 To 270 Step 90
    $VectorX1 = Cos(($Degree1 - 90 + $i) * $Pi_Div_180) * $Width1 + $GUIWidth / 2
    $VectorY1 = Sin(($Degree1 - 90 + $i) * $Pi_Div_180) * $Height1 + $GUIWidth / 2
    $Points1[$j][0] = $VectorX1
    $Points1[$j][1] = $VectorY1
    $j += 1
    Next
    $j = 1
    For $i = 0 To 270 Step 90
    $VectorX2 = Cos(($Degree2 - 90 + $i) * $Pi_Div_180) * $Width2 + $GUIWidth / 2
    $VectorY2 = Sin(($Degree2 - 90 + $i) * $Pi_Div_180) * $Height2 + $GUIWidth / 2
    $Points2[$j][0] = $VectorX2
    $Points2[$j][1] = $VectorY2
    $j += 1
    Next
    EndFunc ;==>_Draw

    [/autoit]

    Und als sich drehender 3D Würfel:

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>
    #include <GUIConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Global $GUIWidth = 400
    Global $GUIHeight = 400
    Global $Width1 = 100
    Global $Height1 = 20
    Global $Width2 = 100
    Global $Height2 = 20
    Global $Degree1 = 0
    Global $Degree2 = 0
    Global $Step1 = 1
    Global $Step2 = 1

    [/autoit] [autoit][/autoit] [autoit]

    Global Const $Pi_Div_180 = 4 * ATan(1) / 180
    Global $j = 1
    Global $VectorX, $VectorY
    Global $Points1[5][2]
    $Points1[0][0] = 4
    Global $Points2[5][2]
    $Points2[0][0] = 4

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To 270 Step 90
    $VectorX1 = Cos(($Degree1 - 90 + $i) * $Pi_Div_180) * $Width1 + $GUIWidth / 2
    $VectorY1 = Sin(($Degree1 - 90 + $i) * $Pi_Div_180) * $Height1 + $GUIHeight / 2 + 125
    $Points1[$j][0] = $VectorX1
    $Points1[$j][1] = $VectorY1
    $j += 1
    Next
    $j = 1
    For $i = 0 To 270 Step 90
    $VectorX2 = Cos(($Degree2 - 90 + $i) * $Pi_Div_180) * $Width2 + $GUIWidth / 2
    $VectorY2 = Sin(($Degree2 - 90 + $i) * $Pi_Div_180) * $Height2 + $GUIHeight / 2
    $Points2[$j][0] = $VectorX2
    $Points2[$j][1] = $VectorY2
    $j += 1
    Next

    [/autoit] [autoit][/autoit] [autoit]

    $Line1X1 = $Points1[1][0]
    $Line1Y1 = $Points1[1][1]
    $Line1X2 = $Points2[1][0]
    $Line1Y2 = $Points2[1][1]
    $Line2X1 = $Points1[2][0]
    $Line2Y1 = $Points1[2][1]
    $Line2X2 = $Points2[2][0]
    $Line2Y2 = $Points2[2][1]
    $Line3X1 = $Points1[3][0]
    $Line3Y1 = $Points1[3][1]
    $Line3X2 = $Points2[3][0]
    $Line3Y2 = $Points2[3][1]
    $Line4X1 = $Points1[4][0]
    $Line4Y1 = $Points1[4][1]
    $Line4X2 = $Points2[4][0]
    $Line4Y2 = $Points2[4][1]

    [/autoit] [autoit][/autoit] [autoit]

    $hWnd = GUICreate("GDI+", $GUIWidth, $GUIHeight)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_Startup()

    [/autoit] [autoit][/autoit] [autoit]

    Global $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
    Global $hBitmap = _GDIPlus_BitmapCreateFromGraphics($GUIWidth, $GUIHeight, $hGraphic)
    Global $Buffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsSetSmoothingMode($Buffer, 2)
    _GDIPlus_GraphicsClear($Buffer)
    Global $hPen = _GDIPlus_PenCreate(0xFFFFFFFF, 3)

    [/autoit] [autoit][/autoit] [autoit]

    AdlibRegister("_Draw", 10)

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    _GDIPlus_PenDispose($hPen)
    _GDIPlus_GraphicsDispose($Buffer)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
    Exit
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Draw()
    _GDIPlus_GraphicsClear($Buffer)
    _GDIPlus_GraphicsDrawPolygon($Buffer, $Points1, $hPen)
    _GDIPlus_GraphicsDrawPolygon($Buffer, $Points2, $hPen)
    _GDIPlus_GraphicsDrawLine($Buffer, $Line1X1, $Line1Y1, $Line1X2, $Line1Y2, $hPen)
    _GDIPlus_GraphicsDrawLine($Buffer, $Line2X1, $Line2Y1, $Line2X2, $Line2Y2, $hPen)
    _GDIPlus_GraphicsDrawLine($Buffer, $Line3X1, $Line3Y1, $Line3X2, $Line3Y2, $hPen)
    _GDIPlus_GraphicsDrawLine($Buffer, $Line4X1, $Line4Y1, $Line4X2, $Line4Y2, $hPen)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $GUIWidth, $GUIHeight)
    $Degree1 += $Step1
    $Degree2 += $Step2
    $j = 1
    For $i = 0 To 270 Step 90
    $VectorX1 = Cos(($Degree1 - 90 + $i) * $Pi_Div_180) * $Width1 + $GUIWidth / 2
    $VectorY1 = Sin(($Degree1 - 90 + $i) * $Pi_Div_180) * $Height1 + $GUIHeight / 2 + 125
    $Points1[$j][0] = $VectorX1
    $Points1[$j][1] = $VectorY1
    $j += 1
    Next
    $j = 1
    For $i = 0 To 270 Step 90
    $VectorX2 = Cos(($Degree2 - 90 + $i) * $Pi_Div_180) * $Width2 + $GUIWidth / 2
    $VectorY2 = Sin(($Degree2 - 90 + $i) * $Pi_Div_180) * $Height2 + $GUIHeight / 2
    $Points2[$j][0] = $VectorX2
    $Points2[$j][1] = $VectorY2
    $j += 1
    Next
    $Line1X1 = $Points1[1][0]
    $Line1Y1 = $Points1[1][1]
    $Line1X2 = $Points2[1][0]
    $Line1Y2 = $Points2[1][1]
    $Line2X1 = $Points1[2][0]
    $Line2Y1 = $Points1[2][1]
    $Line2X2 = $Points2[2][0]
    $Line2Y2 = $Points2[2][1]
    $Line3X1 = $Points1[3][0]
    $Line3Y1 = $Points1[3][1]
    $Line3X2 = $Points2[3][0]
    $Line3Y2 = $Points2[3][1]
    $Line4X1 = $Points1[4][0]
    $Line4Y1 = $Points1[4][1]
    $Line4X2 = $Points2[4][0]
    $Line4Y2 = $Points2[4][1]
    EndFunc ;==>_Draw

    [/autoit]
  • Das 3D DIng sieht ja gut aus.

    Die genaue Berechnung des Abprallwinkels ist natürlich noch besser, da hast du recht...
    LG jakolo