GDI+ Rotating Cubes

  • Ja alles perfekt, nur 1 KLEINER Kritikpunkt:
    Die Würfel sehen so aus als würden sie hinten breiter werden, ansonsten alles super

  • _GDIPlus_DrawImagePoints kann nur Parallelogramme erstellen und keine Trapeze, daher geht eine richtige 3D-Darstellung wohl nicht. Eventuel funktioniert es mit Matrizen besser.

    Einmal editiert, zuletzt von progandy (27. März 2010 um 22:07)

  • _GDIPlus_DrawImagePoints kann nur Parallelogramme erstellen und keine Trapeze, daher geht eine richtige 3D-Darstellung wohl nicht. Eventuel funktioniert es mit Matrizen besser.

    Ich weiß und genau dort liegt der Hase begraben! Ob und wie das mit Matrizen funktionert, weiß ich noch nicht.

    Mal schauen...

    Gruß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯

  • Eine Lösung hätte ich eventuell: http://danbystrom.se/2009/01/12/thu…lection-in-gdi/ (Punkt 3)

    Der macht leider auch nichts anderes, als jede Spalte des Bildes mit einer neuen Höhe zu zeichnen:

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>

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

    _GDIPlus_Startup()
    $hImage = _GDIPlus_ImageLoadFromFile('Test.jpg')
    $iH = _GDIPlus_ImageGetHeight($hImage)
    $iW = _GDIPlus_ImageGetWidth($hImage)

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

    $hGui = GUICreate("Test", $iW, $iH)
    GUISetState()

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

    $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui)

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

    $Skew = $iH * 0.1
    For $i = 0 To $iW - 1
    $nH = $iH - $Skew * ($iW - $i) / $iW
    _GDIPlus_GraphicsDrawImageRectRect($hGraphics, $hImage, $i, 0, 1, $iH, $i, 0, 1, $nH)
    Next

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

    While GUIGetMsg() <> -3
    Sleep(10)
    WEnd

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

    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()

    [/autoit]

    Das ist definitiv zu langsam!