Leaderboard
Popular Content
Showing content with the highest reputation on 09/05/2013 in all areas
-
Hi there again! This 3D Engine is completely written in AutoIt, except for the drawing functions from GDI+. No 3D libraries were used, every calculation is done manually. I seriously dislike GDI+. I wrote this Engine a few months ago in plain AutoIt (using virtually no Includes at all) only utilizing the Graphics Control. It came out that polygon drawing using only GDI is suprisingly fast. For AntiAliasings sake and because of a few people who would like to see how it's done in GDI+, i converted it. Now the smoothing can be used at the cost of FPS. (There is still a FPS drop even with no smoothing at all...). So what features does it have? Own scene file format, quite similar to OBJ. Dynamic face size (3 to ~20 vertices) Light-affected shading (flat shading of course, Gaussian/Phong is going to be implemented later) Effective z-ordering, therefore culling is possible Real perspective drawing (unlike UEZ textured cube which is parallel mapped for example) Translation Rotation Fog emulation Variable shading intensity Zooming The model format is easy to use. 4 models are included (standard geometry). The framerates are acceptable. The plain GDI Version scored about 120 FPS (with buffering). This GDI+ version is a few lines shorter and has fancy smoothing, but runs with max. 80 FPS without AA and max 45 FPS with full AA for me in 800x600. There is a fullscreen mode which if set, ignores the width / height paramter. (Remeber: FPS also heavily depend on resolution). I know the code is a huge mess, but it is the fastest way to do it. Please do not recommend for loops instead of Do's etc. (newer Au3 version show a serious performance drop when using For...). Have fun! 3da.zip1 point
-
Give me 5 I'll try it on my win 8 box. When I've finished my train food1 point
-
Look at the return from StringRegExp when using option flag 3, the returned information is contained in an array, you can not display it in a MsgBox the way you're trying to do it. Using option flag 0 it returns true or false (1 or 0) so you can display that in the msgbox to tell you it found the information you're looking for. If you're unfamiliar with how to handle information in an array, I would look here to read up on them.1 point
-
1 point
-
try this: Global $reT = StringRegExp(FileRead($file), '(?i)Méthode :\s+(.*?)Date/Heure',3)1 point
-
May be a good wave equation in three dimensions, a bit of knowledge of water properties and a complicated algorithm for some water effects ! http://29a.ch/sandbox/2010/water/1 point
-
1 point
-
1 point
-
Here is an ideas... I whipped up quickly ( needs more work ) #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $gui = GUICreate("Jeapordy", 800, 600, -1, -1, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW)) _GuiRoundCorners($gui, 0, 0, 100, 100) GUICtrlCreatePic("JeopardyBoard.jpg", -1, 0, 800, 601) GUICtrlSetState(-1, $GUI_DISABLE) GUIRegisterMsg($WM_LBUTTONDOWN, "_WinMove") ;******************************** Create labels ***** GUICtrlCreateLabel("FOOD", 50, 50, 100, 30) GUICtrlSetFont(-1, 22) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) ;******************************** Create buttons ***** $Button1 = GUICtrlCreateLabel("$100", 55, 130, 100, 30) GUICtrlSetFont( $Button1, 22) GUICtrlSetBkColor($Button1, $GUI_BKCOLOR_TRANSPARENT) GUISetState(@SW_SHOW, $gui) ; Create second GUI $gui2 = GUICreate("Question", 400, 300) $question = GUICtrlCreateLabel("", 10, 10, 380, 250) $click = GUICtrlCreateButton("ANSWER", 150, 270, 120) GUISetState(@SW_HIDE, $gui2) While 1 $Msg = GUIGetMsg() Select Case $Msg = $GUI_EVENT_CLOSE Exit Case $Msg = $Button1 GUICtrlSetData($Button1, "") _Set_Question("the topic of food is all about cooking") EndSelect WEnd Func _Set_Question($text) GUISetState(@SW_HIDE, $gui) GUICtrlSetData($question, $text) GUISetState(@SW_SHOW, $gui2) GUISetState(@SW_SHOWNORMAL, $gui2) While 2 $Msg2 = GUIGetMsg() Select Case $Msg2 = $GUI_EVENT_CLOSE GUISetState(@SW_HIDE, $gui2) GUISetState(@SW_SHOW, $gui) ExitLoop Case $Msg2 = $Click GUICtrlSetData($question, "HERE IS YOUR ANSWER") EndSelect WEnd EndFunc ;==>_Set_Question Func _WinMove($HWnd, $Command, $wParam, $lParam) If BitAND(WinGetState($HWnd), 32) Then Return $GUI_RUNDEFMSG DllCall("user32.dll", "long", "SendMessage", "hwnd", $HWnd, "int", $WM_SYSCOMMAND, "int", 0xF009, "int", 0) EndFunc ;==>_WinMove Func _GuiRoundCorners($h_win, $i_x1, $i_y1, $i_x3, $i_y3) Dim $pos, $ret, $ret2 $pos = WinGetPos($h_win) $ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $i_x1, "long", $i_y1, "long", $pos[2], "long", $pos[3], "long", $i_x3, "long", $i_y3) If $ret[0] Then $ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $ret[0], "int", 1) If $ret2[0] Then Return 1 Else Return 0 EndIf Else Return 0 EndIf EndFunc ;==>_GuiRoundCorners Good Luck 8)1 point
-
The requirement sounds incomplete. I hope there isn't any more possibilities you have left. Here is what you ask ;working - match anything inbetween "<~li~>" , and replace everything with a "</li>" $string = StringRegExpReplace("< / li > < / li > < /li > < / li> < / li > </ li >", "<[^>/]*/[^>]*?li[^>]*>", "</li>") MsgBox( 64, "", $string) Regards1 point
-
GuiRegisterMsg(0x0100,'keydown')
tarretarretarre reacted to dragan for a topic
Did you check help files for function _WinAPI_SetWindowsHookEx() some example (most code taken from help files): #include <WindowsConstants.au3> #include <WinAPI.au3> $Form1 = GUICreate("", 230, 300) GUISetState(@SW_SHOW) OnAutoItExitRegister("_Cleanup") $hStub_KeyProc = DllCallbackRegister("_KeyProc", "long", "int;wparam;lparam") $hmod = _WinAPI_GetModuleHandle(0) $hHook = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($hStub_KeyProc), $hmod) Do Until GUIGetMsg() = -3 Func _KeyProc($nCode, $wParam, $lParam) Local $tKEYHOOKS, $keyCode $tKEYHOOKS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam) If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam) EndIf If WinActive($Form1) then If $wParam = $WM_KEYDOWN then Local $keyCode = DllStructGetData($tKEYHOOKS, "vkCode") Switch $keyCode Case 37 ConsoleWrite('+ Arrow LEFT - pressed' & @CRLF) Case 38 ConsoleWrite('+ Arrow UP - pressed' & @CRLF) Case 39 ConsoleWrite('+ Arrow RIGHT - pressed' & @CRLF) Case 40 ConsoleWrite('+ Arrow DOWN - pressed' & @CRLF) EndSwitch ElseIf $wParam = $WM_KEYUP then Local $keyCode = DllStructGetData($tKEYHOOKS, "vkCode") Switch $keyCode Case 37 ConsoleWrite('! Arrow LEFT - released' & @CRLF) Case 38 ConsoleWrite('! Arrow UP - released' & @CRLF) Case 39 ConsoleWrite('! Arrow RIGHT - released' & @CRLF) Case 40 ConsoleWrite('! Arrow DOWN - released' & @CRLF) EndSwitch EndIf EndIf Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam) EndFunc Func _Cleanup() _WinAPI_UnhookWindowsHookEx($hHook) DllCallbackFree($hStub_KeyProc) EndFunc1 point