JRowe Posted November 8, 2008 Share Posted November 8, 2008 Here's a demo script. You'll need the latest Au3Irrlicht package.Save this script into the same directory as the examples.Use Esc to exit.And, here's a video preview. CODE#include <GUIConstants.au3>#include <Constants.au3>#include <WindowsConstants.au3>#include <WINAPI.au3>#include "IrrlichtPluginUtils.au3"HotKeySet("{ESC}", "Terminate")#Region - GUI Create$gui = GUICreate("trans", 300, 400, -1, -1, -1, $WS_EX_LAYERED)GUICtrlCreateLabel("This is text on a transparent Layered GUI", 10, 10, 200, 20, -1, $GUI_WS_EX_PARENTDRAG)GUICtrlSetTip(-1, "Click label to drag layered window")$layButt = GUICtrlCreateButton("Button", 10, 40, 40)GUISetBkColor(0xABCDEF)_WinAPI_SetLayeredWindowAttributes($gui, 0x010101)CreateDeviceOnWindow( $gui, $EDT_BURNINGSVIDEO, 10, 10, 320, 240, 32, 0, 0 )GUISetState()$Camera = AddCameraSceneNode( 0, 0, 25, -40, 0, 0, 0 )$Node = AddCubeSceneNode( 20 )$Au3Texture = GetTexture( "data\au3.bmp" )SetMaterialTexture( $Node, 0, $Au3Texture )SetMaterialFlag( $Node, $EMF_LIGHTING, 0 )$Y = 0$Direction = 2#Region - GUI SelectLoopGUISetStyle($WS_POPUP, -1, $gui)_WinAPI_SetLayeredWindowAttributes($gui, 0xABCDEF, 255)While IrrRun( ) SetRotation( $Node, 0, $Y, 0 ) BeginScene( true, true, 0, 171, 205, 239 ) SceneDraw( ) GuiDraw( ) EndScene( ) sleep( 20 ) $Y += $Direction If $Y > 360 Then $Y -= 360 If $Y < 0 Then $Y += 360WEndFunc _WinAPI_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $dwFlages = 0x03, $isColorRef = False)If $dwFlages = Default Or $dwFlages = "" Or $dwFlages < 0 Then $dwFlages = 0x03If Not $isColorRef Then$i_transcolor = Hex(String($i_transcolor), 6)$i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))EndIfLocal $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $dwFlages)SelectCase @errorReturn SetError(@error, 0, 0)Case $Ret[0] = 0Return SetError(4, _WinAPI_GetLastError(), 0)Case ElseReturn 1EndSelectEndFunc ;==>_WinAPI_SetLayeredWindowAttributesFunc Terminate() Exit 0EndFunc [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center] Link to comment Share on other sites More sharing options...
Pain Posted November 8, 2008 Share Posted November 8, 2008 Nice, cool to see 3D in AutoIt. This really got some potential in the future. Great job. Link to comment Share on other sites More sharing options...
ludocus Posted November 9, 2008 Share Posted November 9, 2008 cool.. looks sweet! Link to comment Share on other sites More sharing options...
Andreik Posted November 9, 2008 Share Posted November 9, 2008 Very nice. How can I make to rotate more fast? When the words fail... music speaks. Link to comment Share on other sites More sharing options...
jvanegmond Posted November 9, 2008 Share Posted November 9, 2008 Very nice.How can I make to rotate more fast?Set $Direction to a higher number. github.com/jvanegmond Link to comment Share on other sites More sharing options...
JRowe Posted November 9, 2008 Author Share Posted November 9, 2008 Yup. I'm still working on how to interact with it, probably a transparent gif overlay in a child gui. Not entirely practical at this point, but there's a lot of potential for 3D interfaces. I'm working on a talking head, atm. Modeling is fun [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center] Link to comment Share on other sites More sharing options...
Andreik Posted November 9, 2008 Share Posted November 9, 2008 Set $Direction to a higher number.Thanks.I have not used yet IrrlichtPlugin but seems interesting. I'll try to learn. When the words fail... music speaks. Link to comment Share on other sites More sharing options...
jvanegmond Posted November 9, 2008 Share Posted November 9, 2008 Thanks. I have not used yet IrrlichtPlugin but seems interesting. I'll try to learn. Since it rotates, the following code had to have something to do with the rotation. That's why I thought putting $Direction to a higher number would alter the speed. $Y += $Direction If $Y > 360 Then $Y -= 360 If $Y < 0 Then $Y += 360 github.com/jvanegmond Link to comment Share on other sites More sharing options...
JRowe Posted November 9, 2008 Author Share Posted November 9, 2008 SetRotation( $Node, 0, $Y, 0 ) sets the rotation of $Node to $Y on every pass through the main While loop. [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center] Link to comment Share on other sites More sharing options...
A. Percy Posted November 10, 2008 Share Posted November 10, 2008 Yesterday I played a little with your example and I put a red triplane crossing my desktop Só o que posso lhe dizer, bom é quando faz mal!My work:Au3Irrlicht - Irrlicht for AutoItMsAgentLib - An UDF for MSAgentAu3GlPlugin T2 - A 3D plugin for AutoIt...OpenGl Plugin - The old version of Au3GlPlugin.MAC Address Changer - Changes the MAC AddressItCopter - A dragonfly R/C helicopter simulator VW Bug user Pinheiral (Pinewood) city: http://pt.wikipedia.org/wiki/Pinheiral Link to comment Share on other sites More sharing options...
thomaatje Posted November 11, 2008 Share Posted November 11, 2008 This is very nice! good job! Is it possible to create a cube with 6 difrent textures with 1 texture on each side? Link to comment Share on other sites More sharing options...
BrettF Posted November 11, 2008 Share Posted November 11, 2008 Yesterday I played a little with your example and I put a red triplane crossing my desktop The same as your avatar... and where's the post of your example! Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
A. Percy Posted November 11, 2008 Share Posted November 11, 2008 The same as your avatar... and where's the post of your example!In my pen-drive After work, I'll go to home of a friend to upload it. Só o que posso lhe dizer, bom é quando faz mal!My work:Au3Irrlicht - Irrlicht for AutoItMsAgentLib - An UDF for MSAgentAu3GlPlugin T2 - A 3D plugin for AutoIt...OpenGl Plugin - The old version of Au3GlPlugin.MAC Address Changer - Changes the MAC AddressItCopter - A dragonfly R/C helicopter simulator VW Bug user Pinheiral (Pinewood) city: http://pt.wikipedia.org/wiki/Pinheiral Link to comment Share on other sites More sharing options...
A. Percy Posted November 11, 2008 Share Posted November 11, 2008 As I promissed... Dreidecker.zip PS: pk3 file = zip file Só o que posso lhe dizer, bom é quando faz mal!My work:Au3Irrlicht - Irrlicht for AutoItMsAgentLib - An UDF for MSAgentAu3GlPlugin T2 - A 3D plugin for AutoIt...OpenGl Plugin - The old version of Au3GlPlugin.MAC Address Changer - Changes the MAC AddressItCopter - A dragonfly R/C helicopter simulator VW Bug user Pinheiral (Pinewood) city: http://pt.wikipedia.org/wiki/Pinheiral Link to comment Share on other sites More sharing options...
JRowe Posted November 11, 2008 Author Share Posted November 11, 2008 Ha, I like it nice one A.Percy [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center] Link to comment Share on other sites More sharing options...
JRowe Posted November 12, 2008 Author Share Posted November 12, 2008 I've had it running with onTop, no taskbar, and no tray icon for about 5 hours now, with the time offscreen set to about 1 second, and it's slowly gaining memory. It started at 8k, and now it's at 11k Only 4% CPU usage. Also, it runs on top of the screensaver, and when I my little brother ran it on his computer, something borked and turned everything the screen rendered a dark shade of blue (he was alt-tabbing in and out of warcraft.) After reboot, everything was fine, so if this happens to you, I'm sorry. Just reboot and everything should be fine. [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center] Link to comment Share on other sites More sharing options...
A. Percy Posted November 12, 2008 Share Posted November 12, 2008 I was thinking yesterday about transparency and decided to try support it natively in plugin... Só o que posso lhe dizer, bom é quando faz mal!My work:Au3Irrlicht - Irrlicht for AutoItMsAgentLib - An UDF for MSAgentAu3GlPlugin T2 - A 3D plugin for AutoIt...OpenGl Plugin - The old version of Au3GlPlugin.MAC Address Changer - Changes the MAC AddressItCopter - A dragonfly R/C helicopter simulator VW Bug user Pinheiral (Pinewood) city: http://pt.wikipedia.org/wiki/Pinheiral Link to comment Share on other sites More sharing options...
youknowwho4eva Posted November 12, 2008 Share Posted November 12, 2008 I made a few modifications to the original. Looks like an entrance for AutoIt. I made it sleep for 5 seconds at 0,0,0 when it got close but for some reason that didn't look the box head on so I took that out expandcollapse popup#include <GUIConstants.au3> #include <Constants.au3> #include <WindowsConstants.au3> #include <WINAPI.au3> #include "IrrlichtPluginUtils.au3" HotKeySet("{ESC}", "Terminate") #Region - GUI Create $gui = GUICreate("trans", 300, 400, -1, -1, -1, $WS_EX_LAYERED) GUICtrlCreateLabel("This is text on a transparent Layered GUI", 10, 10, 200, 20, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlSetTip(-1, "Click label to drag layered window") $layButt = GUICtrlCreateButton("Button", 10, 40, 40) GUISetBkColor(0xABCDEF) _WinAPI_SetLayeredWindowAttributes($gui, 0x010101) CreateDeviceOnWindow( $gui, $EDT_BURNINGSVIDEO, 10, 10, 320, 240, 32, 0, 0 ) GUISetState() $Camera = AddCameraSceneNode( 0, 0, 25, -40, 0, 0, 0 ) $Node = AddCubeSceneNode( 10 ) $Au3Texture = GetTexture( "data\au3.bmp" ) SetMaterialTexture( $Node, 0, $Au3Texture ) SetMaterialFlag( $Node, $EMF_LIGHTING, 0 ) $Y = 0 $x = 0 $z = 0 $Ys = 0 $xs = 0 $zs = 0 $start = 0 $directionz = 3 $Directiony = 3 $directionx = 3 $directionzs = 1/64 $Directionys = 1/64 $directionxs = 1/64 #Region - GUI SelectLoop GUISetStyle($WS_POPUP, -1, $gui) _WinAPI_SetLayeredWindowAttributes($gui, 0xABCDEF, 255) While IrrRun( ) setscale($node,$xs,$ys,$zs) SetRotation( $Node, $x, $Y, $z ) BeginScene( true, true, 0, 171, 205, 239 ) SceneDraw( ) GuiDraw( ) EndScene( ) sleep( 20 ) $ys += $directionys $xs += $directionxs $zs += $directionzs If $ys = 3 Then $directionys = 0 $directionxs = 0 $directionzs = 0 ElseIf $ys = 0 Then Exit EndIf $Y += $Directiony If $Y > 360 Then $Y -= 363 If $Y < 0 Then $Y += 360 $x += $Directionx If $x > 360 Then $x -= 363 If $x < 0 Then $x += 360 $z += $Directionz If $z > 360 Then $z -= 363 If $z < 0 Then $z += 360 If $x = 3 and $y = 3 and $z = 3 Then If $start < 3 Then $start += 1 ElseIf $start = 3 Then $directiony = -10 $directionx = -10 $directionz = -10 $directionys = -1/16 $directionxs = -1/16 $directionzs = -1/16 EndIf EndIf WEnd Func _WinAPI_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $dwFlages = 0x03, $isColorRef = False) If $dwFlages = Default Or $dwFlages = "" Or $dwFlages < 0 Then $dwFlages = 0x03 If Not $isColorRef Then $i_transcolor = Hex(String($i_transcolor), 6) $i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2)) EndIf Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $dwFlages) Select Case @error Return SetError(@error, 0, 0) Case $Ret[0] = 0 Return SetError(4, _WinAPI_GetLastError(), 0) Case Else Return 1 EndSelect EndFunc;==>_WinAPI_SetLayeredWindowAttributes Func Terminate() Exit 0 EndFunc Giggity Link to comment Share on other sites More sharing options...
youknowwho4eva Posted November 12, 2008 Share Posted November 12, 2008 (edited) Does this only work in 3ds? I would have to go 3 ways to make my files 3ds, but if it accepted dwg or ckd or a few others then I could really do something with this. Of course I could always convert to 3ds, but the others would be quicker. Edit: sorry for double post, thought I hit edit, but hit reply instead. Edited November 12, 2008 by youknowwho4eva Giggity Link to comment Share on other sites More sharing options...
A. Percy Posted November 12, 2008 Share Posted November 12, 2008 Does this only work in 3ds? I would have to go 3 ways to make my files 3ds, but if it accepted dwg or ckd or a few others then I could really do something with this. Of course I could always convert to 3ds, but the others would be quicker. Edit: sorry for double post, thought I hit edit, but hit reply instead. I did some edit in your code, test it expandcollapse popup#include <GUIConstants.au3> #include <Constants.au3> #include <WindowsConstants.au3> #include <WINAPI.au3> #include "IrrlichtPluginUtils.au3" HotKeySet("{ESC}", "Terminate") #Region - GUI Create $gui = GUICreate("trans", 320, 300, -1, -1, 0x9C800000, $WS_EX_LAYERED) GUISetBkColor(0xABCDEF) GUISetStyle( $WS_POPUP, -1, $gui ) _WinAPI_SetLayeredWindowAttributes($gui, 0xABCDEF, 255) GUICtrlCreateLabel("This is text on a transparent Layered GUI", 10, 10, 200, 20, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlSetTip(-1, "Click label to drag layered window") CreateDeviceOnWindow( $gui, $EDT_BURNINGSVIDEO, 0, 30, 320, 240, 32, 0, 0 ) GUISetState() $Camera = AddCameraSceneNode( 0, 0, 25, -40, 0, 0, 0 ) $Node = AddCubeSceneNode( 10 ) $Au3Texture = GetTexture( "data\au3.bmp" ) SetMaterialTexture( $Node, 0, $Au3Texture ) SetMaterialFlag( $Node, $EMF_LIGHTING, 0 ) $Y = 0 $x = 0 $z = 0 $Ys = 0 $xs = 0 $zs = 0 $start = 0 $directionz = 3 $Directiony = 3 $directionx = 3 $directionzs = 1/64 $Directionys = 1/64 $directionxs = 1/64 While IrrRun( ) setscale($node,$xs,$ys,$zs) SetRotation( $Node, $x, $Y, $z ) BeginScene( true, true, 0, 171, 205, 239 ) SceneDraw( ) GuiDraw( ) EndScene( ) sleep( 20 ) $ys += $directionys $xs += $directionxs $zs += $directionzs If $ys = 3 Then $directionys = 0 $directionxs = 0 $directionzs = 0 ElseIf $ys = 0 Then Exit EndIf $Y += $Directiony If $Y > 360 Then $Y -= 363 If $Y < 0 Then $Y += 360 $x += $Directionx If $x > 360 Then $x -= 363 If $x < 0 Then $x += 360 $z += $Directionz If $z > 360 Then $z -= 363 If $z < 0 Then $z += 360 If $x = 3 and $y = 3 and $z = 3 Then If $start < 3 Then $start += 1 ElseIf $start = 3 Then $directiony = -10 $directionx = -10 $directionz = -10 $directionys = -1/16 $directionxs = -1/16 $directionzs = -1/16 EndIf EndIf WEnd Func _WinAPI_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $dwFlages = 0x03, $isColorRef = False) If $dwFlages = Default Or $dwFlages = "" Or $dwFlages < 0 Then $dwFlages = 0x03 If Not $isColorRef Then $i_transcolor = Hex(String($i_transcolor), 6) $i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2)) EndIf Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $dwFlages) Select Case @error Return SetError(@error, 0, 0) Case $Ret[0] = 0 Return SetError(4, _WinAPI_GetLastError(), 0) Case Else Return 1 EndSelect EndFunc;==>_WinAPI_SetLayeredWindowAttributes Func Terminate() Exit 0 EndFunc About another 3d format, it supports .obj(Alias Wavefront Maya), .ms3d(Milkshape3D), .bsp(Quake3 Level), .md2(Quake2 Model), .3ds(3D Studio), .x(Microsoft DirectX). Só o que posso lhe dizer, bom é quando faz mal!My work:Au3Irrlicht - Irrlicht for AutoItMsAgentLib - An UDF for MSAgentAu3GlPlugin T2 - A 3D plugin for AutoIt...OpenGl Plugin - The old version of Au3GlPlugin.MAC Address Changer - Changes the MAC AddressItCopter - A dragonfly R/C helicopter simulator VW Bug user Pinheiral (Pinewood) city: http://pt.wikipedia.org/wiki/Pinheiral Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now