Jump to content

Beomagi

Members
  • Posts

    14
  • Joined

  • Last visited

Beomagi's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Minecraft is a game, where the objective is to mine blocks of a voxel based landscape and place them as you wish to construct what you wish within the confines of said voxel based patterns. Minor enemies come out at night, but there's no big boss, no real drive other than mining or building. So what happens if you're constructing something geometrically complex? There's an online flash based tool for this purpose (not by me) - http://www.plotz.co.uk/plotz.php Now, I liked this tool and wanted to make enhancements for my own purposes - what if I wanted intersecting spheres? what if I want spheres to act as erasers to voxels placed by another? Of course the sky is the limit with ideas like this, so I decided to start putting it into action instead of just wondering. Using libraries made by trancexx Same as attached (mirror) http://beomagi.dyndns.org/picture_net/techzamples/voxelEQ.zip The idea is I want to specify multiple spheres, some are inclusion "brushes" some are erasers, and eventually add parameters for skew, compression etc. perhaps other shapes too. Modify the entries in voxelEQ.txt to specify where to draw spheres and how large using simple coordinate system. ;s draw a sphere ;i include voxels from sphere ;e exclude these voxels ;s,i/e, x, y, z, radius s,i,0,0,-4,10 s,i,0,0,4,10 s,i,0,0,0,10 s,i,0,0,-8,8 s,i,0,0,8,8 s,e,0,2,-4,9 s,e,0,2,4,9 s,e,0,2,0,9 s,e,0,2,-8,6.5 s,e,0,2,8,6.5 s,e,0,20,0,23 Run VoxelEQ.exe/au3. This brings up the primary plotting tool, which shows how to build the shape in minecraft from bottom up. Either click plot ot start changing the "Y" level in the up-down box to start plotting. click on the 3d opengl button and it will simple open voxelEQ_GL.exe. Mouse button 1 - rotate about x/y axis Mouse button 2 - rotate about x/z axis Mouse button 1+2 - reset orientation Possible enhancements - Editor for the voxelEQ.txtFile selector for data fileColor option for voxelEQ.txtOther shapes..voxelEQ.zip
  2. I have a process set to run on cpu 1 and 3 (out of 4 virtual 'cores'). When I run the _WinAPI_GetProcessAffinityMask, It returns successful, but mask is 0 for any process. #include <Process.au3> #include <WinAPI.au3> If ProcessExists("vlc.exe") Then $list = ProcessList("vlc.exe") For $i = 1 To $list[0][0] $Priority = _ProcessGetPriority($list[$i][1]) $affiity = _WinAPI_GetProcessAffinityMask($list[$i][1]) MsgBox(0, $list[$i][0]&":"&$list[$i][1], "Priority:" & $Priority & @CRLF & "Success:" & $affiity[0] & @CRLF & "Proc Mask:" & $affiity[1] & @CRLF & "Sys Mask:" & $affiity[2]) Next EndIf Any ideas? I'm using windows 7 pro 32bit.
  3. #include <OpenGLconstants.au3> #include <OpenGLfunctions.au3> Opt("GUIOnEventMode", 1) Global Const $screenWidth = 400 Global Const $screenHeight = 300 Global $shh = $screenHeight/2;computed ahead for speed Global $swh = $screenwidth/2 Global $swi = 1/$swh;no future division Global $shi = 1/$shh Global Const $PFD_TYPE_RGBA = 0 Global Const $PFD_MAIN_PLANE = 0 Global Const $PFD_DOUBLEBUFFER = 1 Global Const $PFD_DRAW_TO_WINDOW = 4 Global Const $PFD_SUPPORT_OPENGL = 32 Global $gui = GUICreate("OpenGLtest4", $screenWidth, $screenHeight) GUISetBkColor(0x000000) Global $dc EnableOpenGL($gui, $dc) glEnable($GL_DEPTH_TEST) glMatrixMode($GL_PROJECTION) glViewport(0, 0, $screenWidth, $screenHeight) GUISetState(@SW_SHOW) GUISetOnEvent(-3, "Quit") Global $m, $r, $timer = TimerInit() $mousex = 0 $mousey = 0 glNewList(1,$GL_COMPILE) ; **future** make loading function glBegin($GL_TRIANGLES) glColor3f(0, 0, 1) glVertex3f(-.866, -.5, 0) glColor3f(1, 0, 0) glVertex3f(0, 1, 0) glColor3f(0, 1, 0) glVertex3f( .866, -.5, 0) glEnd(); glEndList(); While 1 $a = GUIGetCursorInfo() $rv = 1 if IsArray($a) Then $mousex = $a[0] $mousey = $a[1] If $a[2] = 1 Then $rv = -1; EndIf EndIf glClear(BitOR($GL_COLOR_BUFFER_BIT, $GL_DEPTH_BUFFER_BIT)); $m -= 1*$rv ; 0.1 glPushMatrix() glPushMatrix() gltranslatef(($mousex-$swh)*$swi,($shh-$mousey)*$shi,0); glRotated($m, 0, 0, 1) glCallList(1); glPopMatrix() glPushMatrix() gltranslatef(0,0,0) glRotated($m-10, 1, 0, -1) glCallList(1); glPopMatrix() glPopMatrix() SwapBuffers($dc) Sleep(33); **future** subtract timer difference for one pass of loop WEnd Func EnableOpenGL($hwnd, ByRef $hDC) ; **future** move to library Local $pfd = DllStructCreate("short nSize;" & _ "short nVersion;" & _ "dword dwFlags;" & _ "byte iPixelType;" & _ "byte cColorBits;" & _ "byte cRedBits;" & _ "byte cRedShift;" & _ "byte cGreenBits;" & _ "byte cGreenShift;" & _ "byte cBlueBits;" & _ "byte cBlueShift;" & _ "byte cAlphaBits;" & _ "byte cAlphaShift;" & _ "byte cAccumBits;" & _ "byte cAccumRedBits;" & _ "byte cAccumGreenBits;" & _ "byte cAccumBlueBits;" & _ "byte cAccumAlphaBits;" & _ "byte cDepthBits;" & _ "byte cStencilBits;" & _ "byte cAuxBuffers;" & _ "byte iLayerType;" & _ "byte bReserved;" & _ "dword dwLayerMask;" & _ "dword dwVisibleMask;" & _ "dword dwDamageMask;") Local $h_dc = DllCall("user32.dll", "hwnd", "GetDC", "hwnd", $hwnd) DllStructSetData($pfd, "nSize", DllStructGetSize($pfd)) DllStructSetData($pfd, "nVersion", $GL_VERSION_1_1) DllStructSetData($pfd, "dwFlags", BitOR($PFD_DRAW_TO_WINDOW, $PFD_SUPPORT_OPENGL, $PFD_DOUBLEBUFFER)) DllStructSetData($pfd, "iPixelType", $PFD_TYPE_RGBA) DllStructSetData($pfd, "cColorBits", 24) DllStructSetData($pfd, "cDepthBits", 32) DllStructSetData($pfd, "iLayerType", $PFD_MAIN_PLANE) DllOpen("gdi32.dll") DllOpen("opengl32.dll") Local $iFormat = DllCall("gdi32.dll", "int", "ChoosePixelFormat", "hwnd", $h_dc[0], "ptr", DllStructGetPtr($pfd)) Local $iSetFormat = DllCall("gdi32.dll", "int", "SetPixelFormat", "hwnd", $h_dc[0], "int", $iFormat[0], "ptr", DllStructGetPtr($pfd)) Local $h_cont = DllCall("opengl32.dll", "hwnd", "wglCreateContext", "hwnd", $h_dc[0]) Local $iRet = DllCall("opengl32.dll", "int", "wglMakeCurrent", "int", $h_dc[0], "int", $h_cont[0]) $hDC = $h_dc[0] Return 1 EndFunc ;==>EnableOpenGL Func SwapBuffers($hDC) ; **future** move to library DllCall("gdi32.dll", "int", "SwapBuffers", "hwnd", $hDC) EndFunc ;==>SwapBuffers Func Quit() Exit EndFunc yay figured it out >_< glEnable($GL_DEPTH_TEST) ... glClear(BitOR($GL_COLOR_BUFFER_BIT, $GL_DEPTH_BUFFER_BIT)); ... Used wrong constant last time I tried "glEnable" trancexx, thanks for the library and other code. Never realized autoit was this capable. I'll check through your other examples and msdn as recommended to see if there's any changes I should make. Merci! Beomagi
  4. I've been using this for so long, but I'm impressed whenever I see stuff like this. Yeah - I limited myself to automating general stuff and some log parsing - but some of these udfs (like this) are just incredible and so simple to use. Really should have lingered on the forums more.
  5. Well here's what I'm playing around with. It's based off your triangle example and of course those neat libraries you made. first model triangle will follow the mouse, rotation flips on holding down mouse button one. For convenience, all three files can be snagged here http://beomagi.ath.cx/random/ogltest4.zip Or if you prefer, here's the code, just the main file. #include <OpenGLconstants.au3> #include <OpenGLfunctions.au3> Opt("GUIOnEventMode", 1) Global Const $screenWidth = 400 Global Const $screenHeight = 300 Global $shh = $screenHeight/2;computed ahead for speed Global $swh = $screenwidth/2 Global $swi = 1/$swh;no future division Global $shi = 1/$shh Global Const $PFD_TYPE_RGBA = 0 Global Const $PFD_MAIN_PLANE = 0 Global Const $PFD_DOUBLEBUFFER = 1 Global Const $PFD_DRAW_TO_WINDOW = 4 Global Const $PFD_SUPPORT_OPENGL = 32 Global $gui = GUICreate("OpenGLtest4", $screenWidth, $screenHeight) GUISetBkColor(0x000000) Global $dc EnableOpenGL($gui, $dc) glMatrixMode($GL_PROJECTION) glViewport(0, 0, $screenWidth, $screenHeight) GUISetState(@SW_SHOW) GUISetOnEvent(-3, "Quit") Global $m, $r, $timer = TimerInit() $mousex = 0 $mousey = 0 glNewList(1,$GL_COMPILE) ; **future** make loading function glBegin($GL_TRIANGLES) glColor3f(0, 0, 1) glVertex3f(-.866, -.5, 0) glColor3f(1, 0, 0) glVertex3f(0, 1, 0) glColor3f(0, 1, 0) glVertex3f( .866, -.5, 0) glEnd(); glEndList(); While 1 $a = GUIGetCursorInfo() $rv = 1 if IsArray($a) Then $mousex = $a[0] $mousey = $a[1] If $a[2] = 1 Then $rv = -1; EndIf EndIf glClear(BitOR($GL_COLOR_BUFFER_BIT, $GL_DEPTH_BUFFER_BIT)); $m -= 1*$rv ; 0.1 glPushMatrix() glPushMatrix() gltranslatef(($mousex-$swh)*$swi,($shh-$mousey)*$shi,0); glRotated($m, 0, 0, 1) glCallList(1); glPopMatrix() glPushMatrix() gltranslatef(0,0,1) glRotated($m-10, 0, 0, -1) glCallList(1); glPopMatrix() glPopMatrix() SwapBuffers($dc) Sleep(33); **future** subtract timer difference for one pass of loop WEnd Func EnableOpenGL($hwnd, ByRef $hDC) ; **future** move to library Local $pfd = DllStructCreate("short nSize;" & _ "short nVersion;" & _ "dword dwFlags;" & _ "byte iPixelType;" & _ "byte cColorBits;" & _ "byte cRedBits;" & _ "byte cRedShift;" & _ "byte cGreenBits;" & _ "byte cGreenShift;" & _ "byte cBlueBits;" & _ "byte cBlueShift;" & _ "byte cAlphaBits;" & _ "byte cAlphaShift;" & _ "byte cAccumBits;" & _ "byte cAccumRedBits;" & _ "byte cAccumGreenBits;" & _ "byte cAccumBlueBits;" & _ "byte cAccumAlphaBits;" & _ "byte cDepthBits;" & _ "byte cStencilBits;" & _ "byte cAuxBuffers;" & _ "byte iLayerType;" & _ "byte bReserved;" & _ "dword dwLayerMask;" & _ "dword dwVisibleMask;" & _ "dword dwDamageMask;") Local $h_dc = DllCall("user32.dll", "hwnd", "GetDC", "hwnd", $hwnd) DllStructSetData($pfd, "nSize", DllStructGetSize($pfd)) DllStructSetData($pfd, "nVersion", $GL_VERSION_1_1) DllStructSetData($pfd, "dwFlags", BitOR($PFD_DRAW_TO_WINDOW, $PFD_SUPPORT_OPENGL, $PFD_DOUBLEBUFFER)) DllStructSetData($pfd, "iPixelType", $PFD_TYPE_RGBA) DllStructSetData($pfd, "cColorBits", 24) DllStructSetData($pfd, "cDepthBits", 32) DllStructSetData($pfd, "iLayerType", $PFD_MAIN_PLANE) DllOpen("gdi32.dll") DllOpen("opengl32.dll") Local $iFormat = DllCall("gdi32.dll", "int", "ChoosePixelFormat", "hwnd", $h_dc[0], "ptr", DllStructGetPtr($pfd)) Local $iSetFormat = DllCall("gdi32.dll", "int", "SetPixelFormat", "hwnd", $h_dc[0], "int", $iFormat[0], "ptr", DllStructGetPtr($pfd)) Local $h_cont = DllCall("opengl32.dll", "hwnd", "wglCreateContext", "hwnd", $h_dc[0]) Local $iRet = DllCall("opengl32.dll", "int", "wglMakeCurrent", "int", $h_dc[0], "int", $h_cont[0]) $hDC = $h_dc[0] Return 1 EndFunc ;==>EnableOpenGL Func SwapBuffers($hDC) ; **future** move to library DllCall("gdi32.dll", "int", "SwapBuffers", "hwnd", $hDC) EndFunc ;==>SwapBuffers Func Quit() Exit EndFunc Sidenote : Holy crap firefox is slow on these forums on a netbook - though chrome flies! Took several minutes to respond on just a login >_< Xie xie! Beomagi
  6. Eh, most of the examples I used or found way back were old c - though, for some reason, your autoit library is just that much easier to follow. I really like this language. NVM about the gdi bit - turns out my nas backup of autoit3 was rather old and errored out with a bunch of examples around here. Did have an idea, using an off screen buffer to write text gdiplus style, and figuring out if that can be used as an open gl texture. Do have ideas, just wondering about efficiency. Worst case, I define models and call them. Guess that would be useful anyway. One thing bugging me in my tinkering, is when calling lists to display models, it doesn't appear that the z axis has much bearing on which model is above what. - I know this is more an opengl question than an autoit question... e.g. glPushMatrix(); glTranslate(0,0,z1); glCallList(model); glPopMatrix(); glPushMatrix(); glTranslate(0,0,z2); glCallList(model); glPopMatrix(); Regardless of what I use for z1/z2, the second model drawing is always on top the first model. Is there something that has to be turned on for depth to work? Arigato! Beomagi
  7. Trancexx, I think this is pretty awesome work. Sure there's enough c code, but autoit's ease/speed to code has it beat by a mile making this just what I need to at minimum, prototype something. Thanks a ton >_< Toying around with your first couple examples - second one with the colored triangle reminds me of the one that came with bloodshed c++. Getting mouse interaction isn't bad - just needs a little translation. On later examples i'm seeing use of gdi32.dll - is this standard with opengl? I've noticed several "gdi" discussions here, but they seem to be using an autoit library I can't find anywhere. How did you figure out the dll calls? Any ideas on fonts/text in general? Maybe freetype? Danke! Beomagi
  8. I use something like this to backup my data from my "library" drive, to a backup drive. xcopy source dest e.g. - xcopy g:\library f:\bkup /E /C /F /H /R /Y > f:\bkup\xcopy.log all directories, ignore errors, display full filename, do hidden+system files, overwrite RO files, no prompt and output details to xcopy.log. More complex tasks can be done - e.g. exclusion lists - do a dir /s > your_file if you want to exclude all files under a certain directory, then pass "your_file" as an exclusion list. Date is also useful - if your backups are weekly, then you only need to copy everything in the last week etc. You should have gotten that G:\ F:\ can be networked drives if you like. You can script adding those, but it's better to just leave em up on startup. Try help xcopy for more info. Hope that helps, Beomagi
  9. came accross this http://www.autoitscript.com/forum/index.ph...eaded&pid=69606 I've tried stdinwrite, stroutread, but they are not in the current version, which is newer than that beta, and i get an error on running it. is it in the current beta?
  10. added a "lite" edition version for slower computers. working the bugs of general window management out on this, then will add back transparency.
  11. thanks sometimes the program seens to accept when gui msg=0, which is weird since that's no event, so that stopped some bugs. i removed the winwaitactive - so in case of a handle change, or window closing, the script wont pause there. For $i = 1 To $num; loop to iterate over windows If ($msg = $cidl[$i]) and ($msg <> 0) Then; if clicked WinWait($winh[$i], "") $temp = WinGetState($winh[$i]) If BitAnd($temp, 16) Then WinSetState($temp, "", @SW_RESTORE) EndIf If Not WinActive($winh[$i], "") Then WinActivate($winh[$i], "") $chosen = $i ;WinWaitActive($winh[$i], "") $leaveit = 1 EndIf;end of if clicked Next;end of window iterate loop If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $leaveit Then ExitLoop also added a "flush" on msgs sent to the gui at start. dim $msg[5] $msg[0] = 0 $msg[1] = 0 $msg[2] = 0 $msg[3] = 0 $msg[4] = 0 $msg = GUIGetMsg($mainwin) while Not $msg;flush gui msg buffer $msg = GUIGetMsg($mainwin) WEnd and that new variable in the first block, just before the commented winwaitactive, is used again to activate at the end of the function. If Not WinActive($winh[$chosen], "") Then WinActivate($winh[$chosen], "") EndFunc ;==>winpickermain testing this at work - and making a winpicker-lite version, without transparency, but using sw_hide and sw_show.
  12. thanks for the function name You're suppossed to click on a label of the window in the popup, not the window itself. closing the popup would also reset the transparency/ onautoit exit doesn't have a similar function in the regular version does it?
  13. <{POST_SNAPBACK}> cant get it to error out Do you have any "special" windows open? see anything wrong with the code? $mxy[0] shold be nothing more than the x coordinate. how about if it's declared before setting mxy?
  14. Dunno how many of you tried expose clones in windows, but they're buggy - some windows get a black image instead of actual windows image - the fault is in the os though. What this does When you press win+'x' all windows fade to transparency, and a "win picker" window pops up, listing all open windows. mouse over a title, fades from transparent to opaque, letting you see what it is, clicking on it activates, and resets the transparency of all windows to normal. edit - reset trans to 255 instead of 254 edit - doesnt flash black windows anymore edit - added winpickerLE for really slow systems that dont like transparency (computer at work is a p3 600) WinPicker.au3 WinPickerLE.au3
×
×
  • Create New...