Search the Community
Showing results for tags '3d'.
-
Hello, It's now working quite nice. See this post in the UDF forum Regards, Rudi. ------------ no need to read all the other lines ----------- this is a first script, to get NASA solar pictures to my local disk. Works quite okay, but it is very slow. 1.) Possibly there is a chance to speed it up? #include <Inet.au3> #include <Date.au3> $url = "http://sdo.gsfc.nasa.gov/assets/img/browse/" $Start = "2016/01/01" $NextDate = $Start $RegExJpgName = '(.*?<a href=")([\d_]+?_1024_0193\.jpg)(">.*)' ; $2 returns the JPG file name. Size 1024x1024, Picture colouring type 0193 (whatsoever that exactly means ;-) $SolarFolder = @TempDir & "\SolarJPGs\" DirCreate($SolarFolder) ShellExecute($SolarFolder) HttpSetProxy(1) ; direct access While (_DateDiff("D", $NextDate, _NowCalcDate()) > -1) $NextFolder = $url & $NextDate & "/" ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $NextFolder = ' & $NextFolder & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console GetJPGs($NextFolder) $NextDate = _DateAdd("D", 1, $NextDate) WEnd Func GetJPGs($_URL) $page = _INetGetSource($_URL) $aPage = StringSplit($page, "<tr>", 1) For $a = 1 To $aPage[0] If StringRegExp($aPage[$a], $RegExJpgName) Then $_JPG = StringStripWS(StringRegExpReplace($aPage[$a], $RegExJpgName, "$2"), 1 + 2) $_NextURL = $_URL & $_JPG $_NextJPG = $SolarFolder & $_JPG If FileExists($_NextJPG) Then ContinueLoop ; that file has been downloaded before ALREADY ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $_NextJPG = ' & $_NextJPG & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console $result = InetGet($_NextURL, $_NextJPG, 1 + 2, 1) EndIf Next EndFunc ;==>GetJPGs 2.) When I open the first picture with Irfan View, I can use the "right" arrow to "movie" through that series of JPG files. What is the easiest way to "merge" those pics to a movie? (format doesn't matter, one that's good for androids would be nice. No experience with all that so far. I found how to split movies to one pic per frame using Irfan, but not how to merge JPGs to a movie) Any suggestions appreciated, propably there are ready-to-use tools out there I just missed, because I didn't know what to search for exactly. Or there is an easy solution to "play" the images as a movie within an Autoit GUI? Comment: Interesting points of time I've found so far are e.g.: 2016-01-06@12:41:30 the focus on the sun was almost lost 2016-01-13@13:55:18 it's obviously a satelite cam, starting a 360° rotation at this point of time Regards, Rudi.
-
hello sirs, please help me i tried to create a function that read a folder files to 3d array e.g $array[n][0][0] = ctName $array[n][0][1] = ctFilePath $array[n][0][2] = crtsections number $array[n][m][0] = KeyName $array[n][m][1] = KeyVal $array[n][m][2] = keySectionName that the array when i put one file into the folder all things work fine but when i put more than one file the last file worked fine but the others only the first key is showing please can you help me to correct this problem here is the example with the folder please accept my greetings and thanks in advance array3d.zip
-
- 3 comments
- 3 reviews
-
- gdi+
- useless scripts
-
(and 3 more)
Tagged with:
-
As requested by @Lakes here: GDI and GDI+ versions of 3D Sinus Wave. GDI ≠ GDI+! GDI: ;coded by UEZ build 2017-01-18 #pragma compile(Icon, "c:\Program Files (x86)\AutoIt3\Icons\au3.ico") #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so /pe /rm #AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%\%scriptfile%_stripped.au3" #include <GuiConstantsEx.au3> #include <WinAPIGdi.au3> #include <WindowsConstants.au3> Global $__f1, $__f2, $__f3, $__fY0, $__fZ0, $__fX1, $__fY1 Global $hGUI, $iFPS = 0, $iShowFPS = 0, $bExit, $fZoom = 5.0 Global Const $iW = @DesktopWidth * 0.75, $iH = @DesktopHeight * 0.75, $iWh = $iW / 2, $iHh = $iH / 2, $sTitle = "GDI+ 3D Sinus Wave v1.1 coded by UEZ / FPS: " Global Const $fPi = ACos(-1), $fRad = $fPi / 180, $fDeg = 180 / $fPi, $fPi2 = ACos(-1) * 2 AutoItSetOption("GUIOnEventMode", 1) GDIPlus_3DSinusWave() AutoItSetOption("GUIOnEventMode", 0) Func GDIPlus_3DSinusWave() $bExit = False $hGUI = GUICreate($sTitle, $iW, $iH) ;, 0, 0, $WS_POPUP) GUISetState(@SW_SHOW, $hGUI) ;~ GUISetCursor(16, 1) ;create canvas elements Local Const $hDC = _WinAPI_GetDC($hGUI) Local Const $hBitmapGDI = _WinAPI_CreateCompatibleBitmap($hDC, $iW, $iH) Local Const $hGfxDC = _WinAPI_CreateCompatibleDC($hDC) Local Const $hObjOld = _WinAPI_SelectObject($hGfxDC, $hBitmapGDI) Local Const $hPen = _WinAPI_GetStockObject($DC_PEN) Local Const $hPen_Old = _WinAPI_SelectObject($hGfxDC, $hPen) _WinAPI_SetStretchBltMode($hDC, $HALFTONE) $iFPS = 0 Local Const $fEuler = 2.7182818284 Local $fSpace = 6, $iPoints = 16, $fSpace2 = $fSpace / 2, $iPoints2 = $iPoints / 2 Local $fRotX = Random(-360, 360), $fRotY = Random(-360, 360), $fRotZ = Random(-360, 360), $fPower = 20.0 Local $fRx = Random(-1.5, 1,5), $fRy = Random(-1.5, 1,5), $fRz = Random(-1.5, 1,5) Local $c = 0, $t = 0, $aCoords[$iPoints ^ 2][3] Local $i, $j, $x, $y, $z, $x1, $y1, $z1, $x2, $y2, $z2, $x3, $y3, $z3, $fDistance, $r, $g, $b Local $hDLL_gdi32 = DllOpen("gdi32.dll") Local $tLOGBRUSH = DllStructCreate($tagLOGBRUSH) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit_About") GUIRegisterMsg($WM_MOUSEWHEEL, "WM_MOUSEWHEEL") AdlibRegister("CalcFPS", 1000) Do _WinAPI_BitBlt($hGfxDC, 0, 0, $iW, $iH, $hGfxDC, 0, 0, $WHITENESS) ;erase canvas background $c = 0 For $i = 0 To $iPoints - 1 For $j = 0 To $iPoints - 1 $aCoords[$c][0] = $fSpace * $i + $fSpace2 - $fSpace * $iPoints2 $aCoords[$c][1] = $fSpace * $j + $fSpace2 - $fSpace * $iPoints2 $fDistance = Dist(0, 0, $aCoords[$c][0], $aCoords[$c][1]) $aCoords[$c][2] = $fEuler ^ (-$fDistance / 50) * Sin(($fDistance / 10) - $t) * $fPower $c += 1 $t += 0.00075 Next Next For $i = 0 To $iPoints - 2 For $j = 0 To $iPoints - 2 $r = Int(0x80 + $aCoords[$j + $iPoints * $i][0] * 2) $g = Int(0x80 + $aCoords[$j + $iPoints * $i][1] * 2) $b = Int(0x80 + $aCoords[$j + $iPoints * $i][2] * 2) DllCall($hDLL_gdi32, "dword", "SetDCPenColor", "handle", $hGfxDC, "dword", BitShift($b, -16) + BitShift($g, -8) + $r) _3Dto2D($aCoords[$j + $iPoints * $i][0], $aCoords[$j + $iPoints * $i][1], $aCoords[$j + $iPoints * $i][2], $fRotX, $fRotY, $fRotZ, $x1, $y1, $z1) _3Dto2D($aCoords[$j + $iPoints * ($i + 1)][0], $aCoords[$j + $iPoints * ($i + 1)][1], $aCoords[$j + $iPoints * ($i + 1)][2], $fRotX, $fRotY, $fRotZ, $x2, $y2, $z2) DllCall($hDLL_gdi32, "bool", "MoveToEx", "handle", $hGfxDC, "int", $iWh + $x1 * $fZoom, "int", $iHh + $y1 * $fZoom, "ptr", 0) DllCall($hDLL_gdi32, "bool", "LineTo", "handle", $hGfxDC, "int", $iWh + $x2 * $fZoom, "int", $iHh + $y2 * $fZoom) _3Dto2D($aCoords[($j + 1) + $iPoints * $i][0], $aCoords[($j + 1) + $iPoints * $i][1], $aCoords[($j + 1) + $iPoints * $i][2], $fRotX, $fRotY, $fRotZ, $x2, $y2, $z2) DllCall($hDLL_gdi32, "bool", "MoveToEx", "handle", $hGfxDC, "int", $iWh + $x1 * $fZoom, "int", $iHh + $y1 * $fZoom, "ptr", 0) DllCall($hDLL_gdi32, "bool", "LineTo", "handle", $hGfxDC, "int", $iWh + $x2 * $fZoom, "int", $iHh + $y2 * $fZoom) Next Next For $i = 0 To $iPoints - 2 $r = Int(0x80 + $aCoords[$j + $iPoints * $i][0] * 2) $g = Int(0x80 + $aCoords[$j + $iPoints * $i][1] * 2) $b = Int(0x80 + $aCoords[$j + $iPoints * $i][2] * 2) DllCall($hDLL_gdi32, "dword", "SetDCPenColor", "handle", $hGfxDC, "dword", BitShift($b, -16) + BitShift($g, -8) + $r) _3Dto2D($aCoords[$j + $iPoints * $i][0], $aCoords[$j + $iPoints * $i][1], $aCoords[$j + $iPoints * $i][2], $fRotX, $fRotY, $fRotZ, $x1, $y1, $z1) _3Dto2D($aCoords[$j + $iPoints * ($i + 1)][0], $aCoords[$j + $iPoints * ($i + 1)][1], $aCoords[$j + $iPoints * ($i + 1)][2], $fRotX, $fRotY, $fRotZ, $x2, $y2, $z2) DllCall($hDLL_gdi32, "bool", "MoveToEx", "handle", $hGfxDC, "int", $iWh + $x1 * $fZoom, "int", $iHh + $y1 * $fZoom, "ptr", 0) DllCall($hDLL_gdi32, "bool", "LineTo", "handle", $hGfxDC, "int", $iWh + $x2 * $fZoom, "int", $iHh + $y2 * $fZoom) Next For $j = 0 To $iPoints - 2 $r = Int(0x80 + $aCoords[$j + $iPoints * $i][0] * 2) $g = Int(0x80 + $aCoords[$j + $iPoints * $i][1] * 2) $b = Int(0x80 + $aCoords[$j + $iPoints * $i][2] * 2) DllCall($hDLL_gdi32, "dword", "SetDCPenColor", "handle", $hGfxDC, "dword", BitShift($b, -16) + BitShift($g, -8) + $r) _3Dto2D($aCoords[$j + $iPoints * $i][0], $aCoords[$j + $iPoints * $i][1], $aCoords[$j + $iPoints * $i][2], $fRotX, $fRotY, $fRotZ, $x1, $y1, $z1) _3Dto2D($aCoords[($j + 1) + $iPoints * $i][0], $aCoords[($j + 1) + $iPoints * $i][1], $aCoords[($j + 1) + $iPoints * $i][2], $fRotX, $fRotY, $fRotZ, $x2, $y2, $z2) DllCall($hDLL_gdi32, "bool", "MoveToEx", "handle", $hGfxDC, "int", $iWh + $x1 * $fZoom, "int", $iHh + $y1 * $fZoom, "ptr", 0) DllCall($hDLL_gdi32, "bool", "LineTo", "handle", $hGfxDC, "int", $iWh + $x2 * $fZoom, "int", $iHh + $y2 * $fZoom) Next $fRotX += $fRx $fRotY += $fRy $fRotZ += $fRz _WinAPI_BitBlt($hDC, 0, 0, $iW, $iH, $hGfxDC, 0, 0, $SRCCOPY) ;blit drawn bitmap to GUI $iFPS += 1 If $bExit Then ExitLoop Until Not Sleep(10) GUIRegisterMsg($WM_MOUSEWHEEL, "") AdlibUnRegister("CalcFPS") ;release resources _WinAPI_SelectObject($hGfxDC, $hPen_Old) _WinAPI_DeleteObject($hPen) _WinAPI_SelectObject($hGfxDC, $hObjOld) _WinAPI_ReleaseDC($hGUI, $hDC) _WinAPI_DeleteDC($hGfxDC) _WinAPI_DeleteObject($hBitmapGDI) GUIDelete($hGUI) DllClose($hDLL_gdi32) EndFunc ;==>GDIPlus_3DSinusWave Func WM_MOUSEWHEEL($hGUI, $iMsg, $wParam, $lParam) Local $wheel_Dir = _WinAPI_HiWord($wParam) If $wheel_Dir > 0 Then $fZoom += 0.25 $fZoom = $fZoom > 20 ? 20 : $fZoom Else $fZoom -= 0.25 $fZoom = $fZoom < 0.25 ? 0.25 : $fZoom EndIf Return "GUI_RUNDEFMSG" EndFunc ;==>WM_MOUSEWHEEL Func Dist($x1, $y1, $x2, $y2) Return Sqrt(($x1 - $x2) * ($x1 - $x2) + ($y1 - $y2) * ($y1 - $y2)) EndFunc ;==>Dist Func _3Dto2D($fX, $fY, $fZ, $fRotX, $fRotY, $fRotZ, ByRef $__fXPos, ByRef $__fYPos, ByRef $__fZPos) ;apply the x-axis rotation to transform coordinates ($fX, $fY, $fZ) into coordinates ($fX0, $fY0, $fZ0) $__f1 = $fRotX * $fRad $__f2 = Cos($__f1) $__f3 = Sin($__f1) $__fY0 = $fY * $__f2 + $fZ * $__f3 $__fZ0 = $fZ * $__f2 - $fY * $__f3 ;apply the y-axis rotation to ($fX0, $__fY0, $fZ0) to obtain ($__fX1, $__fY1, $fZ1) $__f1 = $fRotY * $fRad $__f2 = Cos($__f1) $__f3 = Sin($__f1) $__fX1 = $fX * $__f2 - $__fZ0 * $__f3 $__fY1 = $__fY0 ;~ $__fZ1 = $__fZ0 * $__f2 + $fX * $__f2 ;finally, apply the z-axis rotation to obtain the point ($fXPos, $fYPos) $__f1 = $fRotZ * $fRad $__f2 = Cos($__f1) $__f3 = Sin($__f1) $__fXPos = $__fX1 * $__f2 + $__fY1 * $__f3 $__fYPos = $__fY1 * $__f2 - $__fX1 * $__f3 $__fZPos = $__fZ0 EndFunc ;==>_3Dto2D Func _Exit_About() $bExit = True EndFunc ;==>_Exit_About Func CalcFPS() ;display FPS $iShowFPS = $iFPS $iFPS = 0 WinSetTitle($hGUI, "", $sTitle & $iShowFPS) EndFunc ;==>CalcFPS GDI+ ;coded by UEZ build 2017-01-17 #pragma compile(Icon, "c:\Program Files (x86)\AutoIt3\Icons\au3.ico") #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so /pe /rm #AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%\%scriptfile%_stripped.au3" #include <GDIPlus.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> _GDIPlus_Startup() Global $__f1, $__f2, $__f3, $__fY0, $__fZ0, $__fX1, $__fY1 Global $hGUI, $iFPS = 0, $iShowFPS = 0, $bExit Global Const $iW = @DesktopWidth * 0.75, $iH = @DesktopHeight * 0.75, $iWh = $iW / 2, $iHh = $iH / 2, $sTitle = "GDI+ 3D Sinus Wave v1.0 coded by UEZ" Global Const $fPi = ACos(-1), $fRad = $fPi / 180, $fDeg = 180 / $fPi, $fPi2 = ACos(-1) * 2 AutoItSetOption("GUIOnEventMode", 1) GDIPlus_3DSinusWave() AutoItSetOption("GUIOnEventMode", 0) _GDIPlus_Shutdown() Func GDIPlus_3DSinusWave() $bExit = False $hGUI = GUICreate($sTitle, $iW, $iH) ;, 0, 0, $WS_POPUP) GUISetState(@SW_SHOW, $hGUI) ;~ GUISetCursor(16, 1) ;create canvas elements Local Const $hDC = _WinAPI_GetDC($hGUI) Local Const $hHBitmap = _WinAPI_CreateCompatibleBitmap($hDC, $iW, $iH) Local Const $hDC_backbuffer = _WinAPI_CreateCompatibleDC($hDC) Local Const $DC_obj = _WinAPI_SelectObject($hDC_backbuffer, $hHBitmap) Local Const $hCanvas = _GDIPlus_GraphicsCreateFromHDC($hDC_backbuffer) _GDIPlus_GraphicsSetSmoothingMode($hCanvas, $GDIP_SMOOTHINGMODE_HIGHQUALITY) _GDIPlus_GraphicsSetPixelOffsetMode($hCanvas, $GDIP_PIXELOFFSETMODE_HIGHQUALITY) Local Const $hBrush_Clr = _GDIPlus_BrushCreateSolid(0xFFFFFFFF), _ $hBrush_FPS = _GDIPlus_BrushCreateSolid(0xF0808080), _ $hFormat_FPS = _GDIPlus_StringFormatCreate(), _ $hFamily_FPS = _GDIPlus_FontFamilyCreate("Arial"), _ $hFont_FPS = _GDIPlus_FontCreate($hFamily_FPS, 8), _ $tLayout_FPS = _GDIPlus_RectFCreate(0, 0, 60, 16), _ $hPath = _GDIPlus_PathCreate(), _ $hPen = _GDIPlus_PenCreate(0xCF101010, 1.25) _GDIPlus_PenSetLineJoin($hPen, 2) ;~ _GDIPlus_PenSetDashCap($hPen, $GDIP_DASHCAPROUND) ;~ _GDIPlus_PenSetLineCap($hPen, 0x12, 0x12, 2) $iFPS = 0 Local $fEuler = 2.7182818284 Local $fSpace = 6, $iPoints = 16, $fSpace2 = $fSpace / 2, $iPoints2 = $iPoints / 2 Local $fRotX = Random(-360, 360), $fRotY = Random(-360, 360), $fRotZ = Random(-360, 360), $fZoom = 5.0, $fPower = 20.0 Local $fRx = Random(-1.5, 1,5), $fRy = Random(-1.5, 1,5), $fRz = Random(-1.5, 1,5) Local $c = 0, $t = 0, $aCoords[$iPoints ^ 2][3] Local $i, $j, $x, $y, $z, $x1, $y1, $z1, $x2, $y2, $z2, $x3, $y3, $z3, $fDistance, $r, $g, $b GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit_About") AdlibRegister("CalcFPS", 1000) Do ;~ DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hCanvas, "handle", $hBrush_Clr, "float", 0, "float", 0, _ ;~ "float", $iW, "float", $iH) ;erase canvas background _WinAPI_BitBlt($hDC_backbuffer, 0, 0, $iW, $iH, $hDC_backbuffer, 0, 0, $WHITENESS) $c = 0 For $i = 0 To $iPoints - 1 For $j = 0 To $iPoints - 1 $aCoords[$c][0] = ($fSpace * $i + $fSpace2 - $fSpace * $iPoints2) $aCoords[$c][1] = ($fSpace * $j + $fSpace2 - $fSpace * $iPoints2) $fDistance = Dist(0, 0, $aCoords[$c][0], $aCoords[$c][1]) $aCoords[$c][2] = $fEuler ^ (-$fDistance / 50) * Sin(($fDistance / 10) - $t) * $fPower $c += 1 $t += 0.00075 Next Next For $i = 0 To $iPoints - 2 For $j = 0 To $iPoints - 2 _3Dto2D($aCoords[$j + $iPoints * $i][0], $aCoords[$j + $iPoints * $i][1], $aCoords[$j + $iPoints * $i][2], $fRotX, $fRotY, $fRotZ, $x1, $y1, $z1) _3Dto2D($aCoords[$j + $iPoints * ($i + 1)][0], $aCoords[$j + $iPoints * ($i + 1)][1], $aCoords[$j + $iPoints * ($i + 1)][2], $fRotX, $fRotY, $fRotZ, $x2, $y2, $z2) DllCall($__g_hGDIPDll, "int", "GdipDrawLine", "handle", $hCanvas, "handle", $hPen, _ "float", $iWh + $x1 * $fZoom, "float", $iHh + $y1 * $fZoom, "float", $iWh + $x2 * $fZoom, "float", $iHh + $y2 * $fZoom) _3Dto2D($aCoords[($j + 1) + $iPoints * $i][0], $aCoords[($j + 1) + $iPoints * $i][1], $aCoords[($j + 1) + $iPoints * $i][2], $fRotX, $fRotY, $fRotZ, $x2, $y2, $z2) DllCall($__g_hGDIPDll, "int", "GdipDrawLine", "handle", $hCanvas, "handle", $hPen, _ "float", $iWh + $x1 * $fZoom, "float", $iHh + $y1 * $fZoom, "float", $iWh + $x2 * $fZoom, "float", $iHh + $y2 * $fZoom) Next Next For $i = 0 To $iPoints - 2 _3Dto2D($aCoords[$j + $iPoints * $i][0], $aCoords[$j + $iPoints * $i][1], $aCoords[$j + $iPoints * $i][2], $fRotX, $fRotY, $fRotZ, $x1, $y1, $z1) _3Dto2D($aCoords[$j + $iPoints * ($i + 1)][0], $aCoords[$j + $iPoints * ($i + 1)][1], $aCoords[$j + $iPoints * ($i + 1)][2], $fRotX, $fRotY, $fRotZ, $x2, $y2, $z2) DllCall($__g_hGDIPDll, "int", "GdipDrawLine", "handle", $hCanvas, "handle", $hPen, _ "float", $iWh + $x1 * $fZoom, "float", $iHh + $y1 * $fZoom, "float", $iWh + $x2 * $fZoom, "float", $iHh + $y2 * $fZoom) Next For $j = 0 To $iPoints - 2 _3Dto2D($aCoords[$j + $iPoints * $i][0], $aCoords[$j + $iPoints * $i][1], $aCoords[$j + $iPoints * $i][2], $fRotX, $fRotY, $fRotZ, $x1, $y1, $z1) _3Dto2D($aCoords[($j + 1) + $iPoints * $i][0], $aCoords[($j + 1) + $iPoints * $i][1], $aCoords[($j + 1) + $iPoints * $i][2], $fRotX, $fRotY, $fRotZ, $x2, $y2, $z2) DllCall($__g_hGDIPDll, "int", "GdipDrawLine", "handle", $hCanvas, "handle", $hPen, _ "float", $iWh + $x1 * $fZoom, "float", $iHh + $y1 * $fZoom, "float", $iWh + $x2 * $fZoom, "float", $iHh + $y2 * $fZoom) Next $fRotX += $fRx $fRotY += $fRy $fRotZ += $fRz _GDIPlus_GraphicsDrawStringEx($hCanvas, "FPS: " & $iShowFPS, $hFont_FPS, $tLayout_FPS, $hFormat_FPS, $hBrush_FPS) ;draw background message text _WinAPI_BitBlt($hDC, 0, 0, $iW, $iH, $hDC_backbuffer, 0, 0, $SRCCOPY) ;blit drawn bitmap to GUI $iFPS += 1 If $bExit Then ExitLoop Until Not Sleep(10) AdlibUnRegister("CalcFPS") ;release resources _GDIPlus_PenDispose($hPen) _GDIPlus_PathDispose($hPath) _GDIPlus_FontDispose($hFont_FPS) _GDIPlus_FontFamilyDispose($hFamily_FPS) _GDIPlus_StringFormatDispose($hFormat_FPS) _GDIPlus_BrushDispose($hBrush_Clr) _GDIPlus_BrushDispose($hBrush_FPS) _GDIPlus_GraphicsDispose($hCanvas) _WinAPI_SelectObject($hDC_backbuffer, $DC_obj) _WinAPI_DeleteDC($hDC_backbuffer) _WinAPI_DeleteObject($hHBitmap) _WinAPI_ReleaseDC($hGUI, $hDC) GUIDelete($hGUI) EndFunc ;==>GDIPlus_3DSinusWave Func Dist($x1, $y1, $x2, $y2) Return Sqrt(($x1 - $x2) * ($x1 - $x2) + ($y1 - $y2) * ($y1 - $y2)) EndFunc ;==>Dist Func _3Dto2D($fX, $fY, $fZ, $fRotX, $fRotY, $fRotZ, ByRef $__fXPos, ByRef $__fYPos, ByRef $__fZPos) ;apply the x-axis rotation to transform coordinates ($fX, $fY, $fZ) into coordinates ($fX0, $fY0, $fZ0) $__f1 = $fRotX * $fRad $__f2 = Cos($__f1) $__f3 = Sin($__f1) $__fY0 = $fY * $__f2 + $fZ * $__f3 $__fZ0 = $fZ * $__f2 - $fY * $__f3 ;apply the y-axis rotation to ($fX0, $__fY0, $fZ0) to obtain ($__fX1, $__fY1, $fZ1) $__f1 = $fRotY * $fRad $__f2 = Cos($__f1) $__f3 = Sin($__f1) $__fX1 = $fX * $__f2 - $__fZ0 * $__f3 $__fY1 = $__fY0 ;~ $__fZ1 = $__fZ0 * $__f2 + $fX * $__f2 ;finally, apply the z-axis rotation to obtain the point ($fXPos, $fYPos) $__f1 = $fRotZ * $fRad $__f2 = Cos($__f1) $__f3 = Sin($__f1) $__fXPos = $__fX1 * $__f2 + $__fY1 * $__f3 $__fYPos = $__fY1 * $__f2 - $__fX1 * $__f3 $__fZPos = $__fZ0 EndFunc ;==>_3Dto2D Func _Exit_About() $bExit = True EndFunc ;==>_Exit_About Func CalcFPS() ;display FPS $iShowFPS = $iFPS $iFPS = 0 EndFunc ;==>CalcFPS In the attached 7-Zip file you can find the compiled and also a FreeBasic version. -> DL: 3D Sinus Wave.7z Have fun.
-
Here some useless graphical examples using GDI+, made for fun (my 1st GDI+ codes ): !Some examples may run slowly on WinXP machines (workaround in this thread)! Some examples using Hex() function need adjustment when running on AutoIt version 3.3.8.0+ otherwise colors are flashing (fixed versions in AiO package below)!!! #01 Flying Pearl Necklaces: Source code here (577 downloads previously)! Flying Pearl Necklaces.au3 #02 Flying Squares: Source code here (265 downloads previously)! Flying Squares.au3 #03 Rotating Squares: Source code here! Rotating_Squares.au3 #04 Plasma & Plasma Variant: Source codes here! Plasma: Plasma.au3 Plasma Variant: Plasma Variante.au3 #05 L-System Fractals: Source code here (382 downloads previously)! L-System Fractals.7z #06 Sinus Scroller: Source code here (218 downloads previously)! Sinus Scroller.au3 #07 Visualization: Analog Meter: download here (including source, needed files and compiled exe): Source code + needed files here (473 downloads previously)! Visualizer_Analog Meter.7z More GDI+ visualizations here by monoceres or by Eukalyptus Audio Visualization Collection (German site) #08 Particle Catapult: Source code here (70 downloads previously)! Particle_Catapult.au3 #09 Rotating Cube: Source code here (79 downloads previously)! Rotating_Cube.au3 #10 Simple Ball Collision Simulation: Source code here (35 downloads previously)! Simple_Ball_Collision_Simulation.au3 (it is not finished yet! look from time to time into this thread for an update! Nice tutorial here) #11 Particle Explosions: Source code here: Explosions__from_AutoIteroids_.au3 #12 Rotating Letters: Source codes here: Rotating Letters.au3 Transparent version (87 downloads previously): Rotating Letters Transparent.au3 #13 Rotating Cube 2: Source code here (53 downloads previously): Rotating Cube 2.au3 #14 Rotating Cube 2 with Textures: Source code here (68 downloads previously): Rotating Cube 2 + Textures.7z #15 Rotating Cube 2 with some examples from above on each surface: Source code here (55 downloads previously): Rotating Cube 2 + animated surfaces.7z #16 Rotating Cube 2 simple: Source code here: Rotating Cube 2 - Simple.au3 Or with background pic or Rotating Cube 2 simple + Background #17 Tramp of Particles: Source code here: Tramp of Particles.au3 #18 Twister: Source code here: Twister.au3 WinAPI version is 2.5x faster (look in AiO archive)! #19 Star Burst: Source code here: Star Burst.au3 #20 Warp Starfield: Source code here: Warp Starfield.au3 #21 Plasma 2: Source code here: Plasma 2.au3 #22 Isometric Level-3 Cube: Source code here: Isometric Level-3 Cube.au3 #23 Zoomer: Source code here (7 downloads previously): Zoomer.au3 GDIP.au3 needed for Zoomer! #24 Suspended Cloth Simulation: Source code here: Suspended Cloth Simulation.au3 #25 Visualizer: Oscilloscope Farbrausch: Source code here (30 downloads previously): Visualizer Oscilloscope Farbrausch.au3 To run Visualizer Oscilloscope Farbrausch.au3 properly you need following files: Bass.au3, BassExt.au3, Bass.dll and BassExt.dll. These files can be found in AiO package or on German AutoIt site! #26 Im- Exploding Particle Logo: Source code here: Im- Exploding Particle Logo.7z #27 Pixel Text Effect: Source code here (12 downloads previously): Pixel Text Effect.7z or with ♬chip sound♫ aka demo style (download from German AutoIt site or from AiO archive). #27 works best on Vista+ machines! #28 Star Wars Scroller: Source code here: Star Wars Scroller.au3 For a complete Star Wars Intro have a look to eukalyptus' Star-Wars Intro (see below!) #29 Rotated Letters Simple: Source code here: Rotated Letters Simple.au3 #30 Ballet of Letters: Source code here: Ballet of Letters.au3 #31 Perfect Illusion: Source code here: Perfect Illusion Variant 1.au3 Perfect Illusion Variant 2.au3 Perfect Illusion Variant 3.au3 Mesmerizing Squares Screensaver (previous downloads approx. 100): Mesmerizing_Squares_Screensaver.au3 (compiled version here): Don't stare too long on it or you will be mesmerized One more: Rotating triangle + vertical scroller + music (modification of monoceres' code): Magic Lines Screesaver (110 downloads previously): Magic Lines Screensaver.7z Another screensaver - 3D Star Scrolling Screensaver (83 downloads previously): GDI+ 3D Star Scrolling Screensaver.au3 !Some examples may run slowly on WinXP machines (workaround in this thread)! Some examples using Hex() function need adjustment when running on AutoIt version 3.3.8.0+ otherwise colors are flashing (fixed versions in AiO package below)!!! AiO download link ☞ AiO1 or AiO2 ☜ (all examples above compiled + source codes packed with 7-Zip) Have a look also to the game I made using GDI+: Link: AUTOITEROIDS v1.018 Build 2011-06-09 (Final) (a clone of the game Asteroids made by Atari 1979) I hope you like it! Any kind of comment is welcome!!! My examples are all done with AutoIt v3.3.0.0 on Vista x32! Kudos to: monoceres, smashly, malkey, Eukalyptus and Authenticity! Check out Some Graphical Examples using GDI+ Vol. II build 2016-01-25 More examples made by other members in this thread (thanks you very much!): Spinning Flying Pearl Necklaces by smashly: Spinning Flying Squares by smashly and ProgAndy LMP Visualization by youknowwho4eva: SineWorm by monoceres: Enterprise Warp by youknowwho4eva: Confused ASCII by monoceres: Lissajous Curve by monoceres: Butterfly Curve by monoceres: ParticleCollisionFun2 by crashdemons: Extreme nice physic engine by moritz1243 (German site): Lingering Line by MvGulik: Scroller Sine Blobs by Lakes: Cube surface and 3D axis and by Lakes: by eukalyptus: by eukalyptus: Two more examples by eukalyptus: and FEEL FREE TO POST YOUR GDI+ EXAMPLES HERE,TOO!!! Have fun and regards, UEZ ✌ PS: more modified examples also here in this topic History of my useless scripts above:
-
just for further fun Here is a Javascript version of the nice 3D sine wave posted from @UEZ This version uses this nice javascript library:(http://visjs.org/graph3d_examples.html). (All the 'dirty' work is done by the javascript library, so the whole credit goes of course to that library and not to me...) I've simply injected all the html/javascript stuff into a BrowserControl embedded into an AutoIt GUI. Have fun #include <GUIConstantsEx.au3> Example() Exit Func Example() Local $oIE = ObjCreate("Shell.Explorer.2") ; Create a BrowserControl Local $hGUI = GUICreate("3D Sinus wave animation demo", 660, 650, 30, 30) GUICtrlCreateObj($oIE, 0, 0, 660, 650) ; Place BrowserControl on the GUI GUISetState() ;Show GUI $oIE.navigate('about:blank') While Not String($oIE.readyState) = 'complete' ; wait for about:blank Sleep(100) WEnd ; this waits till the document is ready to be used (portion of code from IE.au3) While Not (String($oIE.readyState) = "complete" Or $oIE.readyState = 4) Sleep(100) WEnd While Not (String($oIE.document.readyState) = "complete" Or $oIE.document.readyState = 4) Sleep(100) WEnd $oIE.document.Write(_GetHTML()) ; inject lising directly to the HTML document: $oIE.document.close() ; close the write stream $oIE.document.execCommand("Refresh") ; ----------------------------- ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; the end $oIE = 0 ; Remove IE from memory. GUIDelete($hGUI) ; Remove GUI EndFunc ;==>Example Func _GetHTML() Local $sHTML = _ "<!doctype html>" & @CRLF & _ "<html>" & @CRLF & _ "<head>" & @CRLF & _ " <meta http-equiv=""X-UA-Compatible"" content=""IE=edge"" />" & @CRLF & _ " <title></title>" & @CRLF & _ "" & @CRLF & _ " <style type=""text/css"">" & @CRLF & _ " body {" & @CRLF & _ " font: 10pt arial;" & @CRLF & _ " }" & @CRLF & _ " </style>" & @CRLF & _ "" & @CRLF & _ " <script type=""text/javascript"" src=""https://cdnjs.cloudflare.com/ajax/libs/vis/4.18.0/vis.min.js""></script>" & @CRLF & _ "" & @CRLF & _ " <script type=""text/javascript"">" & @CRLF & _ " var data = null;" & @CRLF & _ " var graph = null;" & @CRLF & _ " var x0, x1, x2" & @CRLF & _ " function custom(x, y, t) {" & @CRLF & _ " // change this function to change the graph" & @CRLF & _ " x0 = 20 - t/180;" & @CRLF & _ " x1 = (x/x0)*(x/x0) + t/10;" & @CRLF & _ " y1 = (y/x0)*(y/x0) + t/10;" & @CRLF & _ " return Math.sin(Math.sqrt(x1+y1));" & @CRLF & _ " }" & @CRLF & _ " // Called when the Visualization API is loaded." & @CRLF & _ " function drawVisualization() {" & @CRLF & _ " // Create and populate a data table." & @CRLF & _ " data = new vis.DataSet();" & @CRLF & _ " // create some nice looking data with sin/cos" & @CRLF & _ " var steps = 25;" & @CRLF & _ " var axisMax = 314;" & @CRLF & _ " var tMax = 800;" & @CRLF & _ " var axisStep = axisMax / steps;" & @CRLF & _ " for (var t = 300; t <= tMax; t = t + 50) {" & @CRLF & _ " for (var x = -axisMax; x < axisMax; x+=axisStep) {" & @CRLF & _ " for (var y = -axisMax; y < axisMax; y+=axisStep) {" & @CRLF & _ " var value = custom(x, y, t);" & @CRLF & _ " data.add([" & @CRLF & _ " {x:x,y:y,z:value,filter:t,style:value}" & @CRLF & _ " ]);" & @CRLF & _ " }" & @CRLF & _ " }" & @CRLF & _ " }" & @CRLF & _ "" & @CRLF & _ " // specify options" & @CRLF & _ " var options = {" & @CRLF & _ " width: '600px'," & @CRLF & _ " height: '600px'," & @CRLF & _ " style: 'surface'," & @CRLF & _ " showPerspective: true," & @CRLF & _ " showGrid: false," & @CRLF & _ " showShadow: false," & @CRLF & _ " // showAnimationControls: false," & @CRLF & _ " keepAspectRatio: true," & @CRLF & _ " verticalRatio: 0.085, // 0.5," & @CRLF & _ " animationInterval: 100, // milliseconds" & @CRLF & _ " animationPreload: true," & @CRLF & _ " animationAutoStart: true," & @CRLF & _ " filterValue: 'time'" & @CRLF & _ " };" & @CRLF & _ "" & @CRLF & _ " // create our graph" & @CRLF & _ " var container = document.getElementById('mygraph');" & @CRLF & _ " graph = new vis.Graph3d(container, data, options);" & @CRLF & _ " }" & @CRLF & _ " </script>" & @CRLF & _ "</head>" & @CRLF & _ "" & @CRLF & _ "<body onload=""drawVisualization();"">" & @CRLF & _ "<div id=""mygraph""></div>" & @CRLF & _ "" & @CRLF & _ "<div id=""info""></div>" & @CRLF & _ "</body>" & @CRLF & _ "</html>" Return $sHTML EndFunc ;==>_GetHTML
- 1 reply
-
- javascript
- 3d
-
(and 1 more)
Tagged with:
-
Hello, I need help with perspective graphics, I made orthographic 3D renderer, now I want to make it perspective: I have made functions that might help: - _3DGetPos($PosX,$PosY,$PosZ) (To get 3D position, output is array with X and Y positions) - _3DGetDistance($PosX,$PosY,$PosZ, [$CameraPosX, $CameraPosY, $CameraPosZ] ) (Gets distance between positions) - _DrawCubeSolidColor( $Color, $PosX, $PosY, $PosZ, $SizeX, $SizeY, $SizeZ ) (I rendered 4 cubes if you see in the picture) I tried to make things smaller if they are far with this in _3DGetPos(...): $Output[0] = ($Output[0]*(1/_3DGetDistance($PosX,$PosY,$PosZ)(Gets distance between camera and position)) + $PosXReal(This makes everything shown in center of GUI) $Output[1] = ($Output[1]*(1/_3DGetDistance($PosX,$PosY,$PosZ))) + $PosXReal What I get: Weird... What to do? Thanks (Sorry for my bad English.)
- 10 replies
-
- perspective
- 3d
-
(and 1 more)
Tagged with:
-
Solar Enthusiasts: Scripts to enjoy a "3D solar movie"
rudi posted a topic in AutoIt Example Scripts
Hi. You are a solar enthusiast? for my personal fun I wrote these two scripts. The first one is downloading all the JPG solar pictures, starting at a given date. the 2nd one will display them in an Autoit GUI, with an adjustable image difference for your right and left eye: "Stare through" your monitor, so that your left eye will focus the left image, your right eye the right image, then you will recognize the 3D effect. If you have difficulties to "match" the left / right image to your left / right eye, then ... decrease the GUI's size (PAGE-DN), until the "image-middle-distance" is a bit BELOW your eye's distance (depends on your monitor's size and your physiognomy) put your face very close to your monitor, then slowly fade back, until you will recognize to see virtually THREE images Wait a moment to recognize the 3D effect of the "middle image" Concentrate on this "middle image" and it's 3D effect AVOID rotating or moving your head in any direction, except forward/backward! This propably will kill down the focus, if you've had difficulties to get it in the beginning! Try to SLOWLY fade back with your face even more, until you have reached a comfortable distance. Now use PAGE-UP, do increase the GUI's (the images) size: Once you've caught the 3D "match", you can usually increase the size to values, you would have never ever been able to "match" at the first time. (The downloaded images are 1024 x 1024 pixels) #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_Description=Display NASA JPG solar pics as a 3D movie #AutoIt3Wrapper_Res_Fileversion=1.0.0.7 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y #AutoIt3Wrapper_Res_LegalCopyright=Rudi Thilo #AutoIt3Wrapper_Res_SaveSource=y #AutoIt3Wrapper_Res_Field=phone|+49 171 685 9 685 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs autoit v3.3.12.0 author: Rudi Thilo +49 171 685 9 685 Download the solar JPG pictures of NASA from the subfolders of the URL specified as first variable declaration 1.) download the JPGs using this script 2.) Use "Solar-GUI-2.au3 to display them as a movie inside an Autoit3 GUI as a "poor-man's-3D-cinema" Both scripts have to be in the same folder. have fun! :D #ce #include <Inet.au3> #include <Date.au3> $url = "http://sdo.gsfc.nasa.gov/assets/img/browse/" $Start = "2015/01/01" $NextDate = $Start $RegExJpgName = '(.*?<a href=")([\d_]+?_1024_0193\.jpg)(">.*)' ; $2 returns the JPG file name. Size 1024x1024, Picture colouring type 0193 (whatsoever that exactly means ;-) $SolarFolder = @ScriptDir & "\SolarJPGs\" DirCreate($SolarFolder) ShellExecute($SolarFolder) HttpSetProxy(1) ; direct access While (_DateDiff("D", $NextDate, _NowCalcDate()) > -1) $NextFolder = $url & $NextDate & "/" ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $NextFolder = ' & $NextFolder & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console GetJPGs($NextFolder) $NextDate = _DateAdd("D", 1, $NextDate) WEnd Func GetJPGs($_URL) $page = _INetGetSource($_URL) $aPage = StringSplit($page, "<tr>", 1) if @error then Exit For $a = 1 To $aPage[0] If StringRegExp($aPage[$a], $RegExJpgName) Then $_JPG = StringStripWS(StringRegExpReplace($aPage[$a], $RegExJpgName, "$2"), 1 + 2) $_NextURL = $_URL & $_JPG $_NextJPG = $SolarFolder & $_JPG If FileExists($_NextJPG) Then ContinueLoop ; that file has been downloaded before ALREADY ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $_NextJPG = ' & $_NextJPG & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console $result = InetGet($_NextURL, $_NextJPG, 1 + 2, 1) EndIf Next EndFunc ;==>GetJPGs #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_Description=Display NASA JPG solar pics as a 3D movie #AutoIt3Wrapper_Res_Fileversion=2.0.0.17 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y #AutoIt3Wrapper_Res_LegalCopyright=Rudi Thilo #AutoIt3Wrapper_Res_SaveSource=y #AutoIt3Wrapper_Res_Field=phone|+49 171 685 9 685 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs autoit v3.3.12.0 display the previously downloaded solar images as a movie in one Autoit3 GUI, to get some 3D impression use ARROW-UP to increase the GUI's size use ARROW-DOWN to decrease the GUI's size use LEFT-ARROW to run the movie backward use RIGHT-ARROW to run the movie forward use PAGEUP to increase the delta between the two images (more 3D effect) use PAGEDN to decrease the delta between the two images. Negative values will give you a strange effect use ESC to close the program have fun! :D #ce #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <Misc.au3> #include <file.au3> $SolarFolder = @ScriptDir & "\SolarJPGs\" #Region Fill array with all found JPG files $aJPGs = _FileListToArray($SolarFolder, "*.jpg", 1, 1) If @error Then MsgBox(0, "Solar JPGs", "No JGP files found in path" & @CRLF & $SolarFolder) Exit EndIf _ArraySort($aJPGs, 0, 1) #EndRegion Fill array with all found JPG files $Delta = 3 $forward = True $LastDate = StringLeft($aJPGs[1], 4) & "-" & StringMid($aJPGs[1], 5, 2) & "-" & StringMid($aJPGs[1], 7, 2) Local $hDLL = DllOpen("user32.dll") AdlibRegister("ReadKeys") $h = 300 $w = $h * 2 $margin = 2 $GuiTitle = "solar movie, " & $h & " px, " $Gui = GUICreate($GuiTitle & $LastDate, $w + $margin, $h + $margin) $Left = GUICtrlCreatePic($aJPGs[1 + $Delta], $margin, $margin, $w / 2 - $margin * 2, $h - $margin * 2) $Right = GUICtrlCreatePic($aJPGs[1], $w / 2 + $margin, $margin, $w / 2 - $margin * 2, $h - $margin * 2) GUISetState() $pointer = 1 While 1 If ($pointer + $Delta) > (UBound($aJPGs) - 1) Or ($pointer > UBound($aJPGs)) Then MsgBox(0, "", "Last image reached." & @CRLF & @CRLF & "Changing direction to reverse now...", 3) $forward = False $pointer -= 1 ElseIf ($pointer < 1) Or ($pointer + $Delta) < 1 Then MsgBox(0, "", "First image reached." & @CRLF & @CRLF & "Changing direction to forward now...", 3) $forward = True $pointer += 1 EndIf Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ConsoleWrite("close erkannt" & @CRLF) #Region --- CodeWizard generated code Start --- ;MsgBox features: Title=Yes, Text=Yes, Buttons=Yes and No, Default Button=Second, Icon=Question, Timeout=5 ss, Miscellaneous=Top-most attribute If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(262436, "ESC recognized", "Do you want to terminate this program?", 5) Select Case $iMsgBoxAnswer = 6 ;Yes Exit Case $iMsgBoxAnswer = 7 ;No Case $iMsgBoxAnswer = -1 ;Timeout EndSelect #EndRegion --- CodeWizard generated code Start --- EndSwitch $NextName = $aJPGs[$pointer + $Delta] $NextName = StringTrimLeft($NextName, StringInStr($NextName, "\", 0, -1)) $NextDate = StringLeft($NextName, 4) & "-" & StringMid($NextName, 5, 2) & "-" & StringMid($NextName, 7, 2) If $NextDate <> $LastDate Then $LastDate = $NextDate AdjustTitle() EndIf $L = $aJPGs[$pointer + $Delta] $R = $aJPGs[$pointer] GUICtrlSetImage($Left, $L) GUICtrlSetImage($Right, $R) If $forward Then $pointer += 1 Else $pointer -= 1 EndIf WEnd Func ReadKeys() $aPos = WinGetPos($Gui) If _IsPressed("26", $hDLL) Then ; UP arrow key $h += 2 $w = $h * 2 WinMove($Gui, "", $aPos[0] - 1, $aPos[1] - 1, $w + $margin * 4, $h + $margin * 2 + 20) ; symmetrically expand one pixel in each direction AdjustTitle() GUICtrlDelete($Left) GUICtrlDelete($Right) $Left = GUICtrlCreatePic($L, $margin, $margin, $w / 2 - $margin * 2, $h - $margin * 2) $Right = GUICtrlCreatePic($R, $w / 2 + $margin, $margin, $w / 2 - $margin * 2, $h - $margin * 2) ElseIf _IsPressed("28", $hDLL) Then ; DOWN arrow key $h -= 2 $w = $h * 2 WinMove($Gui, "", $aPos[0] + 1, $aPos[1] + 1, $w + $margin * 4, $h + $margin * 2 + 20) ; symmetrically shrink one pixel in each direction AdjustTitle() GUICtrlDelete($Left) GUICtrlDelete($Right) $Left = GUICtrlCreatePic($L, $margin, $margin, $w / 2 - $margin * 2, $h - $margin * 2) $Right = GUICtrlCreatePic($R, $w / 2 + $margin, $margin, $w / 2 - $margin * 2, $h - $margin * 2) ElseIf _IsPressed("21", $hDLL) Then ; PAGE-UP key $Delta += 1 If ($pointer + $Delta) > (UBound($aJPGs) - 1) Then MsgBox(0, "", "The End") Exit EndIf AdjustTitle() ElseIf _IsPressed("22", $hDLL) Then ; PAGE-DOWN key $Delta -= 1 AdjustTitle() ElseIf _IsPressed("25", $hDLL) Then ; LEFT cursor key $forward = False ElseIf _IsPressed("27", $hDLL) Then ; RIGHT cursor key $forward = True EndIf EndFunc ;==>ReadKeys Func AdjustTitle() $GuiTitle = "solar movie, " & $h & " px, D: " & $Delta & " " & $LastDate WinSetTitle($Gui, "", $GuiTitle) EndFunc ;==>AdjustTitle Regards, Rudi. -
Some Graphical Examples using GDI+ Vol. II build 2016-05-07 (33 examples) This is the continuation of "Some Graphical Examples using GDI+ Vol. I" with currently 33 examples in "snippet style". For downloads and screenshots just visit the download section. All examples should properly run on Win7+ operating systems / tested on AutoIt v3.3.14.2! More examples will follow from time to time. Thanks to Eukalyptus! Please report any issues / feel free to post any comment. Have fun.
-
Hi, Is there a way to make within AutoIt a 3D game or at least 3D Images? I think it'll look at the end with an Array Holding masses of Pictures which are being placed at the end. If this won't be possible anywayis there a 2D UDF? -Loves to ask
-
S3d.au3 This UDF enables you to draw simple 3D graphics. Features: Simple and easy to useDoesn't require external libraries. You don't need OpenGL or DirectX. Available Functions: _S3d_SelectGraphic($hGraphic, $iWidth, $iHeight, $iSmooth = 2) _S3d_SelectPen($hPen) _S3d_SelectBrush($hBrush) _S3d_SelectFont($hFont) _S3d_SelectFormat($hFormat) _S3d_SetClipCount($iCount) _S3d_Dist($nPos1X = 0, $nPos1Y = 0, $nPos1Z = 0, $nPos2X = 0, $nPos2Y = 0, $nPos2Z = 0) _S3d_DistFromCamera($nPosX = 0, $nPosY = 0, $nPosZ = 0) _S3d_SetCamera($nCameraX, $nCameraY, $nCameraZ, $nTargetX, $nTargetY, $nTargetZ, $nVAngle = 0, $nFAngle = 0.8, $nFScale = 1000) _S3d_SetCameraEx($nCameraX, $nCameraY, $nCameraZ, $nXYAngle = 0, $nXZAngle = 0, $nVAngle = 0, $nFAngle = 0.8, $nFScale = 1000) _S3d_SetLocalMatrix($n00 = 1, $n01 = 0, $n02 = 0, $n03 = 0, $n10 = 0, $n11 = 1, $n12 = 0, $n13 = 0, $n20 = 0, $n21 = 0, $n22 = 1, $n23 = 0, $n30 = 0, $n31 = 0, $n32 = 0, $n33 = 1) _S3d_MultiplyLocalMatrix($n00 = 1, $n01 = 0, $n02 = 0, $n03 = 0, $n10 = 0, $n11 = 1, $n12 = 0, $n13 = 0, $n20 = 0, $n21 = 0, $n22 = 1, $n23 = 0, $n30 = 0, $n31 = 0, $n32 = 0, $n33 = 1, $fRefresh = True) _S3d_LocalTranslate($nX, $nY, $nZ, $fRefresh = True) _S3d_LocalScale($nX, $nY, $nZ, $fRefresh = True) _S3d_LocalRotateX($nAngle, $fDeg = False, $fRefresh = True) _S3d_LocalRotateY($nAngle, $fDeg = False, $fRefresh = True) _S3d_LocalRotateZ($nAngle, $fDeg = False, $fRefresh = True) _S3d_GetLocalMatrix() _S3d_SetLocalMatrixEx(ByRef $aMatrix) _S3d_GetPos($nX, $nY, $nZ) _S3d_InitCurrentPos() _S3d_MoveTo($nX, $nY, $nZ = Default) _S3d_Clear($nColor = 0xFF000000) _S3d_Line($nX1, $nY1, $nZ1, $nX2, $nY2, $nZ2) _S3d_LineTo($nX, $nY, $nZ) _S3d_Box($nX1, $nY1, $nZ1, $nX2, $nY2, $nZ2) _S3d_Arrow($nX1, $nY1, $nZ1, $nX2, $nY2, $nZ2, $nLen = 30, $nAngle = 0.6) _S3d_Circle($nX, $nY, $nZ, $nRad, $fFill = False) _S3d_Polygon($aPoints, $fFill = False) _S3d_RegPolygon($nX, $nY, $nZ, $nRad, $iNum, $fFill = True) _S3d_Star($nX, $nY, $nZ, $nRad1, $nRad2, $iNum, $fFill = True) _S3d_Square($nX1, $nY1, $nZ1, $nX2, $nY2, $nZ2, $nX3, $nY3, $nZ3, $nX4, $nY4, $nZ4, $fFill = True) _S3d_MoveTo2($nXL, $nYL, $nZL, $nXR, $nYR, $nZR) _S3d_RibbonTo($nXL, $nYL, $nZL, $nXR, $nYR, $nZR) _S3d_String($sString, $nX, $nY, $nZ) New version!S3d.zip v1.3.1 (09/JUN/2014) * Archives S3d.zip v1.3.0 (05/SEP/2013) S3d.zip v1.2.3 (16/AUG/2013) Enjoy!
-
Hello, I originally started writing these functions in autoit, because of how easy it was to debug my code (the algorithms are actually implemented in php, though the same functionality could be used without conversion by using aucgi). My original intended purpose for these functions was to allow my web server to calculate if a player was between two points(inside a "region") in a game(minecraft). Currently my functions can do the following: Calculate the absolute distance between two points Calculate the volume between two points(to the nearest whole number) Calculate all points between two points, including their volume(to the nearest whole numbers) Check is a point is between two points(to the nearest whole number) (Maybe more I haven't though of?) I then expanded on the code to add some additional functionality. This code could be used with little modification to create a voxel style game engine. (It could actually even be further modified to support decimal values, though this would significantly slow it's performance exponentially per decimal place, though this shouldn't be necessary, except in rare cases such precision collision detection[ex: detect if a bullet hit a player or npc]) I encourage everyone to submit your modifications/optimizations to my code so everyone can use them. I know my code isn't perfect, and it's functions could be expanded on with the right knowledge(things like collision detection, world generation, etc). If you use any of my code in your project, please link to this page! And while not required, I would like it if you please linked me to your project, I love to see my code in use! So finally here's the code(including examples of all functions being used): voxel.au3
- 1 reply
-
- coordinate
- calculations
-
(and 3 more)
Tagged with:
-
Since struggling with writing some OpenGL stuff in autoit due to the fact of me being newish to the whole programming game and the fact that I really don't have a clue on how to write or use plugins, I thought I would share some of my code I have made that demonstrates using OpenGL with purely autoit and dll calls directly with opengl32 and glu32. I have made a start writing a GLConstants.au3 and GLFunctions.au3 files that I think should be a standard library by now in the Autoit Include folder. Any feedback would be nice Right clicking on the GUI moves the Camera around (while holding), w and s moves forward/backward and a and d spins left and right. Enjoy GLConstants.au3 GLFunctions.au3 3D Viewport.au3
-
As the title how to detect 3D application? Thanks.