Alles Gute zum Geburtstag Kanonenfutter.
Gruß,
UEZ
Alles Gute zum Geburtstag Kanonenfutter.
Gruß,
UEZ
Glückwunsch an den alten = neuen Gewinner!
War meine Prophezeiung...
Gruß,
UEZ
Wenn du noch die Unterstützung für transparente TGA's einbauen könntest, wäre die Funktion perfekt.
Vielleicht könntest du dazu Bitmap v5 benutzen oder du kopierst gleich die TGA Pixel in ein GDI+ Bitmap.
Gruß,
UEZ
Ich bin teilweise dagegen, da sich einige hier (viel) Mühe mit der Erstellung des Logos gegeben haben (außer meine Wenigkeit) und man sollte deswegen abstimmen, obwohl sehr wahrscheinlich der Gewinner bereits feststeht.
Gruß,
UEZ
Eine Möglichkeit:
[autoit]
#include <Array.au3>
Global $2DArray[3][3] = [[1,2,3],[4,5,6],[7,8,9]]
_ArrayDisplay($2DArray, "Original 2D Array")
Global $1DArray = Array2Dto1D($2DArray)
_ArrayDisplay($1DArray, "Converted to 1D Array")
Func Array2Dto1D($Array)
If UBound($Array, 2) < 2 Then Return SetError(1, 0, 0)
Local $1DA[UBound($Array) * UBound($Array, 2)], $x, $y, $z = 0
For $y = 0 To UBound($Array) - 1
For $x = 0 To UBound($Array, 2) - 1
$1DA[$z] = $Array[$y][$x]
$z += 1
Next
Next
Return $1DA
EndFunc
Gruß,
UEZ
Hab mir schon gedacht, dass du dazu einen Generator benutzt hast
Auch dazu brauchst du ein gewisse Kreativität, die ich auch nicht sonderlich habe...
In original Größe sehen die Logos ein bissl besser aus.
Gruß,
UEZ
minx: kein Problem - ist eben Geschmacksache. Das aktuelle Logo ist auch als Maßstab ziemlich hoch. Das zu toppen wird richtig schwer!
Btw, die Logos habe ich auf http://cooltext.com/ erstellt.
Gruß,
UEZ
Hier ein paar Versuche.
#1
#2
#3
#4
#5
Ich konnte mich nicht entscheiden, welche drei die Besten sind, wobei ich minx recht gebe, das keines richtig was taugt.
Gruß,
UEZ
Probiere es mal damit:
[autoit]
#include <Array.au3>
#include <Constants.au3>
$aResult = ParseIPConfig("Wireless Network Connection") ;hier den Namen des Netzwerkadapters eintragen
_ArrayDisplay($aResult)
Func ParseIPConfig($sAdaptername, $bAll = True) ;coded by UEZ 2013
Local $sLines, $sAll = "/all"
If Not $bAll Then $sAll = ""
Local $iPID = Run(@ComSpec & " /c ipconfig.exe " & $sAll, @SystemDir, @SW_HIDE, $STDERR_MERGED)
While True
$sLines &= StdoutRead($iPID)
If @error Then ExitLoop
WEnd
If Not $sLines Then Return SetError(1, 0, 0)
Local $i = 1, $a, $aa, $aResult[100][2]
$a = StringRegExp($sLines, "(?m)" & $sAdaptername & ":\s*(\v.*){0}", 3)
If @error Then Return SetError(2, 0, 0)
$aResult[0][0] = StringStripWS($a[0], 7)
Do
$a = StringRegExp($sLines, "(?m)" & $sAdaptername & ":\s*(\v.*){" & $i & "}", 3)
$aa = StringRegExp($a[0], "(?i)\s*(.*\w).*\s*:\s(.*)", 3)
If @error then ExitLoop
$aResult[$i][0] = StringStripWS($aa[0], 7)
$aResult[$i][1] = StringStripWS($aa[1], 7)
$i += 1
Until False
ReDim $aResult[$i][2]
Return $aResult
EndFunc
Getested auf WinXP Ger und Win7 US.
Gruß,
UEZ
Probiere es mal mit Subclassing:
[autoit]
#include <Constants.au3>
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
Opt("GUIOnEventMode", 1)
[/autoit][autoit][/autoit][autoit]$GUI = GUICreate("GUI", 960, 540, Default, Default)
GUISetState(@SW_SHOW)
$hCallback = DllCallbackRegister("_KeyProc", "long", "int;wparam;lparam")
$hHook = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($hCallback), _WinAPI_GetModuleHandle(0))
GUISetOnEvent($GUI_EVENT_CLOSE, "Event_Close")
[/autoit][autoit][/autoit][autoit]While 1
Sleep(100)
WEnd
Func _KeyProc($nCode, $wParam, $lParam) ;subclassing
If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)
Local $tKEYHOOKS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam)
Switch $wparam
Case $WM_KEYUP
If DllStructGetData($tKEYHOOKS, "vkCode") = 0x0D Then ConsoleWrite("Enter wurde losgelassen." & @CRLF)
Case $WM_KEYDOWN
If DllStructGetData($tKEYHOOKS, "vkCode") = 0x0D Then ConsoleWrite("Enter wurde gedrückt." & @CRLF)
EndSwitch
Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)
EndFunc
Func Event_Close()
_WinAPI_UnhookWindowsHookEx($hHook)
DllCallbackFree($hCallback)
GUIDelete()
Exit
EndFunc
Gruß,
UEZ
Hi eukalyptus,
warum hast du in der _BM_Struct() Funktion noch eine For/Next Schleife vor der Struct Schleife eingebaut?
Ich habe noch Do/Until, If/Then/Else und Switch/Case hinzugefügt:
Benchmark.au3
If $CmdLine[0] <> 1 Or $CmdLine[1] <> "1" Then Exit
Global $sPath_Ini = @ScriptDir & "\Benchmark.ini"
[/autoit] [autoit][/autoit] [autoit]Global $iLoop = Number(IniRead($sPath_Ini, "Loop", "Cnt", "0"))
[/autoit] [autoit][/autoit] [autoit]_BM_IfThenElse($iLoop)
_BM_SwitchCase($iLoop)
_BM_For($iLoop)
_BM_While($iLoop)
_BM_Do($iLoop)
_BM_Array($iLoop)
_BM_Struct($iLoop)
_BM_Add($iLoop)
_BM_Sqrt($iLoop)
Func _BM_SwitchCase($iLoop)
Local $iTimer, $fTime, $iI, $a = 10, $b = 20, $r
$iI = 1
$iTimer = TimerInit()
Do
Switch $a * $b
Case 1 To 10
$r = True
Case 11 to 100
$r = False
Case Else
$r = -1
EndSwitch
$iI += 1
Until $iI > $iLoop
$fTime = TimerDiff($iTimer)
IniWrite($sPath_Ini, "SwitchCase", @AutoItVersion, $fTime)
EndFunc ;==>_BM_SwitchCase
Func _BM_IfThenElse($iLoop)
Local $iTimer, $fTime, $iI, $a = 1, $b = 2, $c = -3, $r
$iI = 1
$iTimer = TimerInit()
Do
If $a > $b Then
$r = True
ElseIf $a > $c Then
$r = False
Else
$r = -1
EndIf
$iI += 1
Until $iI > $iLoop
$fTime = TimerDiff($iTimer)
IniWrite($sPath_Ini, "IfThenElse", @AutoItVersion, $fTime)
EndFunc ;==>_BM_IfThenElse
Func _BM_For($iLoop)
Local $iTimer, $fTime
$iTimer = TimerInit()
For $i = 1 To $iLoop
Next
$fTime = TimerDiff($iTimer)
IniWrite($sPath_Ini, "For", @AutoItVersion, $fTime)
EndFunc ;==>_BM_For
Func _BM_While($iLoop)
Local $iTimer, $fTime, $iI
$iI = 1
$iTimer = TimerInit()
While $iI <= $iLoop
$iI += 1
WEnd
$fTime = TimerDiff($iTimer)
IniWrite($sPath_Ini, "While", @AutoItVersion, $fTime)
EndFunc ;==>_BM_While
Func _BM_Do($iLoop)
Local $iTimer, $fTime, $iI
$iI = 1
$iTimer = TimerInit()
Do
$iI += 1
Until $iI > $iLoop
$fTime = TimerDiff($iTimer)
IniWrite($sPath_Ini, "Do", @AutoItVersion, $fTime)
EndFunc ;==>_BM_Do
Func _BM_Struct($iLoop)
Local $iTimer, $fTime, $fTime_Loop
Local $tStruct = DllStructCreate("float[" & $iLoop & "]; float[" & $iLoop & "];")
Local $fVal = 12345.6789
$iTimer = TimerInit()
For $i = 1 To $iLoop
DllStructSetData($tStruct, 1, 123.45, $i)
DllStructSetData($tStruct, 2, $fVal, $i)
$fVal = DllStructGetData($tStruct, 1, $i)
$fVal = DllStructGetData($tStruct, 2, $i)
Next
$fTime = TimerDiff($iTimer)
IniWrite($sPath_Ini, "Struct", @AutoItVersion, $fTime)
EndFunc ;==>_BM_Struct
Func _BM_Array($iCnt)
Local $iTimer, $fTime, $fTime_Loop
Local $aArray[$iCnt + 1][2]
Local $iVal = 123456
$iTimer = TimerInit()
For $i = 1 To $iCnt
Next
$fTime_Loop = TimerDiff($iTimer)
$iTimer = TimerInit()
For $i = 1 To $iCnt
$aArray[$i][0] = 1234
$aArray[$i][1] = $iVal
$iVal = $aArray[$i][0]
$iVal = $aArray[$i][1]
Next
$fTime = TimerDiff($iTimer) - $fTime_Loop
IniWrite($sPath_Ini, "Array", @AutoItVersion, $fTime)
EndFunc ;==>_BM_Array
Func _BM_Add($iCnt)
Local $iTimer, $fTime, $fTime_Loop
Local $iVal = 1
$iTimer = TimerInit()
For $i = 1 To $iCnt
Next
$fTime_Loop = TimerDiff($iTimer)
$iTimer = TimerInit()
For $i = 1 To $iCnt
$iVal += 1
Next
$fTime = TimerDiff($iTimer) - $fTime_Loop
IniWrite($sPath_Ini, "Add", @AutoItVersion, $fTime)
EndFunc ;==>_BM_Add
Func _BM_Sqrt($iCnt)
Local $iTimer, $fTime, $fTime_Loop
Local $iVal = 1
$iTimer = TimerInit()
For $i = 1 To $iCnt
Next
$fTime_Loop = TimerDiff($iTimer)
$iTimer = TimerInit()
For $i = 1 To $iCnt
$iVal = Sqrt($i)
Next
$fTime = TimerDiff($iTimer) - $fTime_Loop
IniWrite($sPath_Ini, "Sqrt", @AutoItVersion, $fTime)
EndFunc ;==>_BM_Sqrt
Stable_vs_Beta.au3
Global $sRegKey = "HKEY_LOCAL_MACHINE64\SOFTWARE\"
If @OSArch <> "X86" Then $sRegKey &= "Wow6432Node\"
Global $sPath_Stable = RegRead($sRegKey & "AutoIt v3\AutoIt", "InstallDir")
Global $sVersion_Stable = StringTrimLeft(RegRead($sRegKey & "AutoIt v3\AutoIt", "Version"), 1)
Global $sPath_Beta = RegRead($sRegKey & "AutoIt v3\AutoIt", "betaInstallDir")
Global $sVersion_Beta = StringTrimLeft(RegRead($sRegKey & "AutoIt v3\AutoIt", "betaVersion"), 1)
Global $sPath_Ini = @ScriptDir & "\Benchmark.ini"
If FileExists($sPath_Ini) Then FileDelete($sPath_Ini)
IniWrite($sPath_Ini, "Version", "Stable", $sVersion_Stable)
IniWrite($sPath_Ini, "Version", "Beta", $sVersion_Beta)
IniWrite($sPath_Ini, "Loop", "Cnt", 300000)
[/autoit] [autoit][/autoit] [autoit]RunWait($sPath_Stable & '\AutoIt3.exe "' & @ScriptDir & '\Benchmark.au3" "1"')
RunWait($sPath_Beta & '\AutoIt3.exe "' & @ScriptDir & '\Benchmark.au3" "1"')
_Compare("IfThenElse")
_Compare("SwitchCase")
_Compare("For")
_Compare("While")
_Compare("Do")
_Compare("Array")
_Compare("Struct")
_Compare("Add")
_Compare("Sqrt")
Func _Compare($sBM = "Array")
Local $fTime_Stable = IniRead($sPath_Ini, $sBM, $sVersion_Stable, "0")
Local $fTime_Beta = IniRead($sPath_Ini, $sBM, $sVersion_Beta, "0")
ConsoleWrite("! " & StringFormat("%-10s: %.2f%% (%.2fms : %.2fms)\n", $sBM, $fTime_Beta * 100 / $fTime_Stable, $fTime_Stable, $fTime_Beta))
EndFunc ;==>_Compare
Meine Ergebnisse:
3.3.8.1
! IfThenElse: 103.34% (611.97ms : 632.43ms)
! SwitchCase: 106.36% (651.39ms : 692.79ms)
! For : 170.99% (14.12ms : 24.15ms)
! While : 107.04% (184.22ms : 197.20ms)
! Do : 111.15% (185.96ms : 206.68ms)
! Array : 124.89% (933.42ms : 1165.77ms)
! Struct : 107.02% (2071.65ms : 2217.10ms)
! Add : 115.99% (53.15ms : 61.65ms)
! Sqrt : 111.28% (171.91ms : 191.29ms)
3.3.9.13:
! IfThenElse: 100.18% (621.49ms : 622.60ms)
! SwitchCase: 107.36% (644.95ms : 692.42ms)
! For : 180.21% (13.54ms : 24.39ms)
! While : 106.94% (182.92ms : 195.62ms)
! Do : 103.35% (186.43ms : 192.67ms)
! Array : 131.40% (887.30ms : 1165.89ms)
! Struct : 146.73% (2065.47ms : 3030.73ms)
! Add : 109.88% (55.39ms : 60.86ms)
! Sqrt : 175.79% (175.75ms : 308.95ms)
Gruß,
UEZ
Good catch eukalyptus!
Ich habe den Benchmark oben in do/until umgewandelt und es sieht so aus, als ob dann die Beta auch "gleich" schnell läuft.
[autoit]
$j = 0
$iMax = 50000000
$t = TimerInit()
For $i = 0 To $iMax
$j += 1
Next
$fEnd = TimerDiff($t) / 1000
ConsoleWrite(StringFormat("%.2f seconds.", $fEnd) & @LF)
3.3.8.1: 10.85 seconds.
3.3.9.13: 13.17 seconds.
Gruß,
UEZ
Ich war so frei und habe deine AutoIt-only 3D Engine genommen und ein Benchmark Mode hinzugefügt.
Es werden 3000 Frames gerendert.
#AutoIt3Wrapper_Compile_Both=y
#AutoIt3Wrapper_UseUpx=n
#include <Date.au3>
#include <File.au3>
Opt("GUIOnEventMode", 1)
HotKeySet("{ESC}", "quit")
StartUp(800, 600, False, 0, 0, 0, 0, 0, 0, 900, 999, 0.5, 1)
[/autoit] [autoit][/autoit] [autoit]$sModel = "Cylinder.3DA"
LoadModel()
CalculateShadingFactors()
AdlibRegister("FPS", 1000)
$bBenchmark = True
$ZoomAnimator = 0.1
#forcedef $hGraphics, $Width, $Height, $RotX, $RotY, $RotZ, $TransX, $TransY, $TransZ, $Zm, $iFPS, $VerNum, $LineNum
$iFramesRendered = 0
$iMaxFrames = 2999
$iTimer = TimerInit()
While 1
$hBuffer = $hGraphics
$hGraphics = GUICtrlCreateGraphic(0, 0, $Width, $Height)
$RotX += 1
$RotY += 1
$RotZ += 1
$Zm += $ZoomAnimator
If $RotX > 360 Then $RotX = -355
If $RotY > 360 Then $RotY = -355
If $RotZ > 360 Then $RotZ = -355
If $Zm > 960 Or $Zm < 900 Then $ZoomAnimator *= -1
CreateVertexArray() ; Create a safe-to-edit copy of all vertices
Translate($TransX, $TransY, $TransZ) ; Change the postion of all vertices
Rotate($RotX, $RotY, $RotZ) ; Rotate all vertices
Zoom($Zm) ; Zoom!
ApplyPerpective() ; Well...
BackfaceCulling() ; Leave behind what is behind!
DrawToBuffer() ; Display it
$iFPS += 1
GUICtrlDelete($hBuffer)
$iFramesRendered += 1
If $iFramesRendered > $iMaxFrames And $bBenchmark Then
$sResult = Round($iFramesRendered / (TimerDiff($iTimer) / 1000), 2) & " fps in ø. Rendered frames: " & $iFramesRendered & ". Render time: " & Round((TimerDiff($iTimer) / 1000), 2) & " seconds"
$sAU3Arch = "X86"
$bAU3Arch = @AutoItX64
$aMemStats = MemGetStats()
If $bAU3Arch Then $sAU3Arch = "X64"
$tChkAero = DllStructCreate("int;")
DllCall("dwmapi.dll", "int", "DwmIsCompositionEnabled", "struct*", $tChkAero)
$bAero = DllStructGetData($tChkAero, 1)
$sFile = @ScriptDir & "\Benchmark_Results.txt"
$hFile = FileOpen($sFile, 1)
FileWrite($hFile, "Date:" & @TAB & @TAB & @TAB & _Now() & @CRLF & _
"AutoIt Version:" & @TAB & @TAB & @AutoItVersion & @CRLF & _
"AutoIt Exe Arch.:" & @TAB & $sAU3Arch & @CRLF & _
"OS Version:" & @TAB & @TAB & @OSVersion & @CRLF & _
"OS Arch.:" & @TAB & @TAB & @OSArch & @CRLF & _
"Aero enabled:" & @TAB & @TAB & $bAero & @CRLF & _
"CPU Model:" & @TAB & @TAB & WMI_GetCPUModel() & @CRLF & _
"Video Model:" & @TAB & @TAB & WMI_GetVideoModel() & @CRLF & _
"Physical Mem:" & @TAB & @TAB & Ceiling($aMemStats[1] / 1024^2) & " GB" & @CRLF & _
"3D Model used:" & @TAB & @TAB & StringRegExpReplace($sModel, "\.\\(.*)", "$1") & " -> Contains: " & $VerNum + 1 & " vertices and " & $LineNum + 1 & " faces" & @CRLF & _
"Result:" & @TAB & @TAB & @TAB & $sResult & @CRLF & @CRLF & @CRLF)
FileClose($hFile)
ShellExecute($sFile)
Exit
EndIf
WEnd
Func StartUp($wi = 800, $he = 600, $Fs = False, $x = 0, $y = 0, $z = 0, $rx = 0, $ry = 0, $rz = 0, $zoom = 900, $dis = 1000, $shade = 0.5, $borders = True)
If $Fs Then
Global $Width = @DesktopWidth, $Height = @DesktopHeight
$Style = 0x80000000
$ExStyle = 34078736
Else
Global $Width = $wi, $Height = $he
$Style = -1
$ExStyle = 34078728
EndIf
Global $hGUI = GUICreate("", $Width, $Height, -1, -1, $Style, $ExStyle)
GUISetOnEvent(-3, "quit")
Global $hGraphics = GUICtrlCreateGraphic(0, 0, $Width, $Height)
GUISetBkColor(0x404040)
GUISetState()
Global $PIover180 = ((ATan(1) * 4) / 180), $Ver[5000][3], $TempV[5000][3], $TempZ[5000], $TempLin[5000], $Lin[5000][24], $Zcol[5000]
Global $Zcent1, $Zcent2, $TempNum, $LineNum, $VerNum, $Xa, $Ya, $Za, $iFPS, $Sa = $shade, $TransX = $x, $TransY = $y, $TransZ = $z, $RotX = $rx, $RotY = $ry, $RotZ = $rz, $Zm = $zoom, $ViewDis = $dis, $XOrigin = $Width / 2, $YOrigin = $Height / 2, $bLines = $borders
EndFunc ;==>StartUp
Func DrawToBuffer()
For $a = 0 To $TempNum
$Zmin = $TempV[$Lin[$TempLin[$a]][1]][2]
$Zmax = $TempV[$Lin[$TempLin[$a]][1]][2]
For $t = 1 To $Lin[$TempLin[$a]][0]
If $Zmin > $TempV[$Lin[$TempLin[$a]][$t]][2] Then $Zmin = $TempV[$Lin[$TempLin[$a]][$t]][2]
If $Zmax < $TempV[$Lin[$TempLin[$a]][$t]][2] Then $Zmax = $TempV[$Lin[$TempLin[$a]][$t]][2]
Next
$z = $Zmax - $Zmin
If $z > $Zcol[$a] Then $z = $Zcol[$a]
$Col = ("0x" & Hex(Int($Lin[$TempLin[$a]][21] - ((($Lin[$TempLin[$a]][21] * $Sa) / $Zcol[$a]) * $z)), 2) & Hex(Int($Lin[$TempLin[$a]][22] - ((($Lin[$TempLin[$a]][22] * $Sa) / $Zcol[$a]) * $z)), 2) & Hex(Int($Lin[$TempLin[$a]][23] - ((($Lin[$TempLin[$a]][23] * $Sa) / $Zcol[$a]) * $z)), 2))
If $bLines Then
GUICtrlSetGraphic($hGraphics, 8, 0x000040, $Col)
Else
GUICtrlSetGraphic($hGraphics, 8, $Col, $Col)
EndIf
For $t = 1 To $Lin[$TempLin[$a]][0]
If $t = 1 Then
GUICtrlSetGraphic($hGraphics, 6, $TempV[$Lin[$TempLin[$a]][$t]][0], $TempV[$Lin[$TempLin[$a]][$t]][1])
Else
GUICtrlSetGraphic($hGraphics, 2, $TempV[$Lin[$TempLin[$a]][$t]][0], $TempV[$Lin[$TempLin[$a]][$t]][1])
EndIf
Next
Next
EndFunc ;==>DrawToBuffer
Func BackfaceCulling()
If $LineNum = 0 Then Return 0
$TempNum = -1
For $a = 0 To $LineNum
$Xmin1 = $TempV[$Lin[$a][1]][0]
$Xmax1 = $Xmin1
$Ymin1 = $TempV[$Lin[$a][1]][1]
$Ymax1 = $Ymin1
$Zmin1 = $TempV[$Lin[$a][1]][2]
$Zmax1 = $Zmin1
For $b = 1 To $Lin[$a][0]
If $Xmin1 > $TempV[$Lin[$a][$b]][0] Then $Xmin1 = $TempV[$Lin[$a][$b]][0]
If $Xmax1 < $TempV[$Lin[$a][$b]][0] Then $Xmax1 = $TempV[$Lin[$a][$b]][0]
If $Ymin1 > $TempV[$Lin[$a][$b]][1] Then $Ymin1 = $TempV[$Lin[$a][$b]][1]
If $Ymax1 < $TempV[$Lin[$a][$b]][1] Then $Ymax1 = $TempV[$Lin[$a][$b]][1]
If $Zmin1 > $TempV[$Lin[$a][$b]][2] Then $Zmin1 = $TempV[$Lin[$a][$b]][2]
If $Zmax1 < $TempV[$Lin[$a][$b]][2] Then $Zmax1 = $TempV[$Lin[$a][$b]][2]
Next
Local $b = 0, $DotProduct = ($TempV[$Lin[$a][3]][0] * (($TempV[$Lin[$a][1]][2] * $TempV[$Lin[$a][2]][1]) - ($TempV[$Lin[$a][1]][1] * $TempV[$Lin[$a][2]][2]))) + ($TempV[$Lin[$a][3]][1] * (($TempV[$Lin[$a][1]][0] * $TempV[$Lin[$a][2]][2]) - ($TempV[$Lin[$a][1]][2] * $TempV[$Lin[$a][2]][0]))) + ($TempV[$Lin[$a][3]][2] * (($TempV[$Lin[$a][1]][1] * $TempV[$Lin[$a][2]][0]) - ($TempV[$Lin[$a][1]][0] * $TempV[$Lin[$a][2]][1])))
If $Xmin1 < 0 And $Xmax1 < 0 Then $b += 1
If $Xmin1 > $Width And $Xmax1 > $Width Then $b += 1
If $Ymin1 < 0 And $Ymax1 < 0 Then $b += 1
If $Ymin1 > $Height And $Ymax1 > $Height Then $b += 1
If $Zmin1 > $ViewDis Then $b += 1
If $b <> 0 Then ContinueLoop
If $DotProduct > 0 Then
$TempNum = $TempNum + 1
$TempLin[$TempNum] = $a
$TempZ[$a] = ($Zmax1 - $Zmin1) / 2 + $Zmin1
EndIf
Next
If $TempNum = 0 Then Return 0
Do
$Sw = False
For $a = 0 To $TempNum - 1
If $TempZ[$TempLin[$a]] <= $TempZ[$TempLin[$a + 1]] Then ContinueLoop
$Dummy = $TempLin[$a]
$TempLin[$a] = $TempLin[$a + 1]
$TempLin[$a + 1] = $Dummy
$Sw = True
Next
Until $Sw = False
EndFunc ;==>BackfaceCulling
Func ApplyPerpective()
For $a = 0 To $VerNum
$Xx = $TempV[$a][0]
$Yy = $TempV[$a][1]
$z = $TempV[$a][2]
If $z < -999 Then $z = -999
If $z > 999 Then $z = 999
$TempV[$a][0] = $XOrigin + ($Xx / (1000 - $z)) * 1000
$TempV[$a][1] = $YOrigin + ($Yy / (1000 - $z)) * 1000
Next
EndFunc ;==>ApplyPerpective
Func Zoom($z)
For $a = 0 To $VerNum
$TempV[$a][2] += $z
Next
EndFunc ;==>Zoom
Func Rotate($Xx, $Yy, $z)
Local $Xn = $Xx * $PIover180, $Yn = $Yy * $PIover180, $Zn = $z * $PIover180
For $a = 0 To $VerNum
$Xx = $TempV[$a][0]
$Yy = $TempV[$a][1]
$z = $TempV[$a][2]
Local $X1 = $Xx * Cos($Zn) - $Yy * Sin($Zn), $Y1 = $Yy * Cos($Zn) + $Xx * Sin($Zn), $Z1 = $z
$TempV[$a][0] = $X1
$TempV[$a][1] = $Y1
$TempV[$a][2] = $Z1
$Xx = $TempV[$a][0]
$Yy = $TempV[$a][1]
$z = $TempV[$a][2]
Local $Z1 = $z * Cos($Yn) - $Xx * Sin($Yn), $X1 = $z * Sin($Yn) + $Xx * Cos($Yn), $Y1 = $Yy
$TempV[$a][0] = $X1
$TempV[$a][1] = $Y1
$TempV[$a][2] = $Z1
$Xx = $TempV[$a][0]
$Yy = $TempV[$a][1]
$z = $TempV[$a][2]
Local $Y1 = $Yy * Cos($Xn) - $z * Sin($Xn), $Z1 = $Yy * Sin($Xn) + $z * Cos($Xn), $X1 = $Xx
$TempV[$a][0] = $X1
$TempV[$a][1] = $Y1
$TempV[$a][2] = $Z1
Next
EndFunc ;==>Rotate
Func Translate($x, $y, $z)
For $a = 0 To $VerNum
$TempV[$a][0] += $x
$TempV[$a][1] += $y
$TempV[$a][2] += $z
Next
EndFunc ;==>Translate
Func Sca($S)
For $a = 0 To $VerNum
For $b = 0 To 2
$TempV[$a][$b] *= $S
Next
Next
EndFunc ;==>Sca
Func CreateVertexArray()
For $a = 0 To $VerNum
For $b = 0 To 2
$TempV[$a][$b] = $Ver[$a][$b]
Next
Next
EndFunc ;==>CreateVertexArray
Func CalculateShadingFactors()
For $a = 0 To $LineNum
$Xmin1 = $Ver[$Lin[$a][1]][0]
$Xmax1 = $Xmin1
$Ymin1 = $Ver[$Lin[$a][1]][1]
$Ymax1 = $Ymin1
$Zmin1 = $Ver[$Lin[$a][1]][2]
$Zmax1 = $Zmin1
For $b = 1 To $Lin[$a][0]
$Xmin2 = $Ver[$Lin[$a][$b]][0]
$Ymin2 = $Ver[$Lin[$a][$b]][1]
$Zmin2 = $Ver[$Lin[$a][$b]][2]
If $Xmin1 > $Xmin2 Then $Xmin1 = $Xmin2
If $Xmax1 < $Xmin2 Then $Xmax1 = $Xmin2
If $Ymin1 > $Ymin2 Then $Ymin1 = $Ymin2
If $Ymax1 < $Ymin2 Then $Ymax1 = $Ymin2
If $Zmin1 > $Zmin2 Then $Zmin1 = $Zmin2
If $Zmax1 < $Zmin2 Then $Zmax1 = $Zmin2
Next
$X1 = Abs($Xmax1 - $Xmin1)
$Y1 = Abs($Ymax1 - $Ymin1)
$Z1 = Abs($Zmax1 - $Zmin1)
If $X1 >= $Y1 And $X1 >= $Z1 Then $Zcol[$a] = $X1
If $Y1 >= $X1 And $Y1 >= $Z1 Then $Zcol[$a] = $Y1
If $Z1 >= $X1 And $Z1 >= $Y1 Then $Zcol[$a] = $Z1
Next
EndFunc ;==>CalculateShadingFactors
Func LoadModel()
Local $aLines[41] = [ "Cylinder.3DA", _
"23", _
"v -2.5 -4.33012701892219 -10", _
"v 0 -5 -10", _
"v 2.5 -4.33012701892219 -10", _
"v 4.33012701892219 -2.5 -10", _
"v 5 -3.06151588455594e-016 -10", _
"v 4.33012701892219 2.5 -10", _
"v 2.5 4.33012701892219 -10", _
"v 6.12303176911189e-016 5 -10", _
"v -2.5 4.33012701892219 -10", _
"v -4.33012701892219 2.5 -10", _
"v -5 9.18454765366783e-016 -10", _
"v -4.33012701892219 -2.5 -10", _
"v -2.5 -4.33012701892219 10", _
"v 0 -5 10", _
"v 2.5 -4.33012701892219 10", _
"v 4.33012701892219 -2.5 10", _
"v 5 -3.06151588455594e-016 10", _
"v 4.33012701892219 2.5 10", _
"v 2.5 4.33012701892219 10", _
"v 6.12303176911189e-016 5 10", _
"v -2.5 4.33012701892219 10", _
"v -4.33012701892219 2.5 10", _
"v -5 9.18454765366783e-016 10", _
"v -4.33012701892219 -2.5 10", _
"13", _
"f 4 1 0 12 13 0 100 200", _
"f 4 2 1 13 14 0 100 200", _
"f 4 3 2 14 15 0 100 200", _
"f 4 4 3 15 16 0 100 200", _
"f 4 5 4 16 17 0 100 200", _
"f 4 6 5 17 18 0 100 200", _
"f 4 7 6 18 19 0 100 200", _
"f 4 8 7 19 20 0 100 200", _
"f 4 9 8 20 21 0 100 200", _
"f 4 10 9 21 22 0 100 200", _
"f 4 11 10 22 23 0 100 200", _
"f 4 0 11 23 12 0 100 200", _
"f 12 0 1 2 3 4 5 6 7 8 9 10 11 0 100 200", _
"f 12 23 22 21 20 19 18 17 16 15 14 13 12 0 100 200"]
$Lines = UBound($aLines)
$VerNum = $aLines[1]
For $i = 2 To $VerNum + 2
$sRead = $aLines[$i]
$aTemp = StringSplit(StringTrimLeft($sRead, 2), " ", 3)
For $n = 0 To 2
$Ver[$i - 2][$n] = $aTemp[$n]
Next
Next
$LineN = $VerNum + 3
$LineNum = $aLines[$LineN]
For $i = $VerNum + 4 To $VerNum + 4 + $LineNum
$sRead = $aLines[$i]
$PCount = StringMid($sRead, 3, 1)
If StringMid($sRead, 4, 1) <> " " Then $PCount = StringMid($sRead, 3, 2)
$Cut = 4
If StringMid($sRead, 4, 1) <> " " Then $Cut = 5
$aTemp = StringSplit(StringTrimLeft($sRead, $Cut), " ", 3)
$Lin[$i - ($VerNum + 4)][0] = $PCount
For $n = 1 To $PCount
$Lin[$i - ($VerNum + 4)][$n] = $aTemp[$n - 1]
Next
For $n = 21 To 23
If Number($aTemp[$PCount + ($n - 21)]) <> 0 Then $Lin[$i - ($VerNum + 4)][$n] = Number($aTemp[$PCount + ($n - 21)])
Next
Next
EndFunc ;==>LoadModel
Func FPS()
WinSetTitle("", "", "minx' AutoIt-only 3D Engine | Flat Shading Mode | FPS: " & $iFPS & " (ø fps " & StringFormat("%.2f", $iFramesRendered / (TimerDiff($iTimer) / 1000)) & ", # frames: " & $iFramesRendered & ")")
$iFPS = 0
EndFunc ;==>FPS
Func quit()
Exit
EndFunc ;==>quit
Func WMI_GetCPUModel($sHost = @ComputerName)
Local $objItem
Local $objWMIService = ObjGet("winmgmts:{impersonationLevel = impersonate}!\\" & $sHost & "\root\cimv2")
Local $oColItems = $objWMIService.ExecQuery("SELECT Name FROM Win32_Processor", "WQL", 0x30)
If IsObj($oColItems) Then
For $objItem In $oColItems
Return StringStripWS($objItem.Name, 7)
Next
EndIf
EndFunc
Func WMI_GetVideoModel($sHost = @ComputerName)
Local $objItem
Local $objWMIService = ObjGet("winmgmts:{impersonationLevel = impersonate}!\\" & $sHost & "\root\cimv2")
Local $oColItems = $objWMIService.ExecQuery("SELECT AdapterRAM, CurrentRefreshRate, Description, VideoProcessor FROM Win32_VideoController", "WQL", 0x30)
If IsObj($oColItems) Then
For $objItem In $oColItems
Return $objItem.Description & ", " & $objItem.VideoProcessor & ", " & StringFormat("%.2f", ("0x" & Hex($objItem.AdapterRAM)) / 1024^2) & " MB RAM, @" & $objItem.CurrentRefreshRate & " Hz"
Next
EndIf
EndFunc
Das Resultat wird in der Datei @ScriptDir & "\Benchmark_Results.txt" gespeichert.
Wenn es bereits eine modifizierte Version gibt, dann gibt es jetzt eine weitere. ![]()
Gruß,
UEZ
minx: Basiert nicht dein CityMark Benchmark auf OpenGL?
Br,
UEZ
Etwas in der Art hat Mars doch gemacht, wenn ich mich nicht irre? Und bei Mars, Andy und mir sind die Betas mehr als schlecht abgeschnitten... Bei einigen Tests brauchen die doppelt so lange wie die Stable.
Die meisten finden es wohl "enttäuschend" nach so langer Zeit ohne offiziellen Fortschritt..
Ich habe mir nicht im Detail die anderen Bms angesehen. Wenn dem so ist, dann vergesst meine Aussage.
Es gibt leider keinen aktiven Entwickler mehr, um AutoIt weiter innovativ voranzutreiben. Jon musste ständig das Jammern der Leute anhören, bis es sich entschloss neue "Bugfixed" Versionen herauszubringen. Der größte Teil ist von Valik und trancexx.
Gruß,
UEZ
Nach meiner Meinung sind die Benchmarks hier inkl. meinem und deren Ergebnisse nicht repräsentativ genug, um die Geschwindigkeit von AutoIt zu messen.
Imho wäre es korrekt nur AutoIt Funktionen zu messen ohne irgend welche DLLs aufzurufen, wie z.B. Arrays, Binärstrings, etc. erstellen, sortieren, hoch zähen, runter zählen, und und und...
Wer Zeit und Lust hat, kann sich ja was überlegen.
Gruß,
UEZ
Ja, einfach
[autoit]
If $bW > $bH Then
_SetPaperSize("CUSTOM", 841.890, 595.276) ; A4 landscape
_SetOrientation($PDF_ORIENTATION_LANDSCAPE)
Else
_SetPaperSize("CUSTOM", 595.276, 841.890) ; A4 portrait
_SetOrientation($PDF_ORIENTATION_PORTRAIT)
EndIf
Werde auch den Screenshooter bei Gelegenheit anpassen, so dass Bilder im Querformat auch als Querformat im PDF Format gespeichert werden.
Gruß,
UEZ