A. Percy Posted August 29, 2007 Share Posted August 29, 2007 (edited) I never owned a "Ferrorama", a popular toy in Brazil some years ago (80's)So I made this:Download: Train.zipEdit: glut32 and glaux can be found here. Edited January 21, 2008 by A. Percy 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...
flip209 Posted August 29, 2007 Share Posted August 29, 2007 I am missing a GLAUX.DDLL " I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln Link to comment Share on other sites More sharing options...
A. Percy Posted August 30, 2007 Author Share Posted August 30, 2007 glaux:http://www.cweom.de/onetwo3do/download.htm 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...
BananaFredSoft Posted August 30, 2007 Share Posted August 30, 2007 glut32.dll missing, DefineGlWindow unknown function name -ColinSite:www.bananafredsoft.comStuff:Simple Text Editor - MediaPlayer - Animator - BananaDB - BananaNotes - Chatta - Filesearch - Excuse GeneratorMy YouTube channel:http://www.youtube.com/user/colipat Link to comment Share on other sites More sharing options...
A. Percy Posted August 30, 2007 Author Share Posted August 30, 2007 glut32 and glaux can be found here 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...
Gif Posted August 30, 2007 Share Posted August 30, 2007 that's FANTASTIC !!!!! well done! Link to comment Share on other sites More sharing options...
A. Percy Posted August 30, 2007 Author Share Posted August 30, 2007 that's FANTASTIC !!!!! well done!Thank you! 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...
Will66 Posted August 30, 2007 Share Posted August 30, 2007 Very nice thanx Link to comment Share on other sites More sharing options...
RazerM Posted August 30, 2007 Share Posted August 30, 2007 Very complicated! Well done I'd never be able to work that out. My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop. Link to comment Share on other sites More sharing options...
WolfWorld Posted August 31, 2007 Share Posted August 31, 2007 This Is Very Nice but I NEVER OPEN IT BECAUSE I CAN'T Main project - Eat Spaghetti - Obfuscate and Optimize your script. The most advance add-on.Website more of GadGets! Link to comment Share on other sites More sharing options...
Xenobiologist Posted August 31, 2007 Share Posted August 31, 2007 Hi, not bad man! So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Alek Posted August 31, 2007 Share Posted August 31, 2007 this is awsome i modifyed it a bit to make you able to turn change camera angle, maybe implant moveable camera?? im not sure if i understod the setcamera function the only problem with the way im doing the camera thing is that if you click it returns to the orignal pos expandcollapse popup;#include "GlPluginUtils.au3" #include "TrainUDF.au3" #Include <Misc.au3> ;hide icon!!!!!! AutoItSetOption( "TrayIconHide", 1 ) $Title = "Demo Train - AutoIt OpenGl Plugin" DefineGlWindow( 800, 600, $Title ) SetClearColor( 0.6, 0.6, 0.9 ) CreateLight( 0, 600, 1000, 600 ) SetLightAmbient( 0, 0.2, 0.2, 0.2 ) SetLightDiffuse( 0, 0.7, 0.7, 0.7 ) SetLightSpecular( 0, 0, 0, 0 ) ;... make some objects... ;Setcamera( ?,?,?,anglex,angley,hight) $anglex = 0 $angley = 50 $hight = 0 $posx = 0 $posy = 50 $posz = 180 ;the dffinitions are proberly wrong :P i didnt look it up SetCamera( $posx, $posy, $posz,$anglex, $angley, $hight) AddObject( "plain" ) AddGlCylinder( "plain", 0, -0.4, 0, 85, 71, 0.00, 180, 180, 0.5, 0.5, 0.5, 1.0 ) AddGlCylinder( "plain", 0, -0.42, 0, 95, 61, 0.00, 180, 180, 0.6, 0.5, 0.3, 1.0 ) AddGlCylinder( "plain", 0, -0.44, 0, 300, 0.00, 0.00, 180, 180, 0.4, 0.7, 0.4, 1.0 ) $Tunel = "tunel" AddObject( $Tunel ) ;AddGlCylinder( Name, X, Y, Z, Radius1, Radius2, Height, Slices, Stacks, Red, Green, Blue, Alpha ) AddGlCylinder( $Tunel, 0, 15, 0, 20, 10, 0, 20, 20, 0.6, 0.5, 0.3, 1.0 ) AddGlCylinder( $Tunel, 0, -15, 0, 10, 10, 30, 20, 20, 0.5, 0.5, 0.5, 1.0 ) AddGlCylinder( $Tunel, 0, -15, 0, 20, 20, 30, 20, 20, 0.4, 0.7, 0.4, 1.0 ) AddGlCylinder( $Tunel, 0, -15, 0, 20, 10, 0, 20, 20, 0.6, 0.5, 0.3, 1.0 ) RotateObject( $Tunel, 90, 0, 0 ) TranslateObject( $Tunel, 78.3, 0, 0 ) $trilhos = "Trilhos" AddObject( $trilhos ) AddGlCylinder( $trilhos, 0, -0.40, 0, 80.0, 80.0, 0.40, 180, 4, 0.7, 0.7, 0.7, 1.0 ) AddGlCylinder( $trilhos, 0, 0.00, 0, 80.0, 80.4, 0.00, 180, 4, 0.7, 0.7, 0.7, 1.0 ) AddGlCylinder( $trilhos, 0, -0.40, 0, 80.4, 80.4, 0.40, 180, 4, 0.7, 0.7, 0.7, 1.0 ) AddGlCylinder( $trilhos, 0, -0.40, 0, 76.6, 76.6, 0.40, 180, 4, 0.7, 0.7, 0.7, 1.0 ) AddGlCylinder( $trilhos, 0, 0.00, 0, 76.2, 76.6, 0.00, 180, 4, 0.7, 0.7, 0.7, 1.0 ) AddGlCylinder( $trilhos, 0, -0.40, 0, 76.2, 76.2, 0.40, 180, 4, 0.7, 0.7, 0.7, 1.0 ) CreateGroup( "Composition" ) _MakeLocomotive( "Train" ) TranslateGroup( "Train", 0, 0, 78.3 ) SetToGroup( "Composition", "Train" ) ;~ SetToGroup( "Train", "Trilhos" ) ;~ RotateGroup( "Train", 0, -120, 0 ) Opt( "WinTitleMatchMode", 3 ) WinWait( $Title ) WinMove( $Title, "", ( @DesktopWidth / 2 ) - 400, ( @DesktopHeight / 2 ) - 300 ) $CheckWindowTimer = TimerInit( ) $Y_Axis = 0 $timer = TimerInit() While 1 if _IsPressed(01) Then $Mousepos =MouseGetPos() Do $Newmousepos = MouseGetPos() $angley = ($Newmousepos[1]-$Mousepos[1])/1.5 $anglex = ($Newmousepos[0]-$Mousepos[0])/1.5 SetCamera( 0,50,180, $anglex,$angley,$hight) SceneDraw() Animation() Until _IsPressed(01)=0 ;Elseif _IsPressed(02) Then ; $Mousepos =MouseGetPos() ; Do ; $Newmousepos = MouseGetPos() ; $hight = $Newmousepos[1]-$Mousepos[1] ; SetCamera( 0,50,180, $anglex,$angley,$hight) ; SceneDraw() ; Animation() ; Until _IsPressed(02)=0 EndIf Animation() Wend Func Animation() if TimerDiff($timer) > 50 then SceneDraw( ) RotateGroup( "Composition", 0, $Y_Axis, 0 ) RotateTrainWheels( "Train", $Y_Axis * 30 ) $Y_Axis = $Y_Axis + 1 If $Y_Axis < 1 Then $Y_Axis += 360 If $Y_Axis > 360 Then $Y_Axis -= 360 $timer = TimerInit() EndIf ;check if window exist... (using a timer to reduce CPU usage by WinExists function) If TimerDiff( $CheckWindowTimer ) > 1000 Then If WinExists( $Title ) = 0 Then Exit $CheckWindowTimer = TimerInit( ) EndIf EndFunc [font="Impact"]Never fear, I is here.[/font] Link to comment Share on other sites More sharing options...
A. Percy Posted August 31, 2007 Author Share Posted August 31, 2007 this is awsome i modifyed it a bit to make you able to turn change camera angle, maybe implant moveable camera?? im not sure if i understod the setcamera function the only problem with the way im doing the camera thing is that if you click it returns to the orignal pos expandcollapse popup;#include "GlPluginUtils.au3" #include "TrainUDF.au3" #Include <Misc.au3> ;hide icon!!!!!! AutoItSetOption( "TrayIconHide", 1 ) $Title = "Demo Train - AutoIt OpenGl Plugin" DefineGlWindow( 800, 600, $Title ) SetClearColor( 0.6, 0.6, 0.9 ) CreateLight( 0, 600, 1000, 600 ) SetLightAmbient( 0, 0.2, 0.2, 0.2 ) SetLightDiffuse( 0, 0.7, 0.7, 0.7 ) SetLightSpecular( 0, 0, 0, 0 ) ;... make some objects... ;Setcamera( ?,?,?,anglex,angley,hight) $anglex = 0 $angley = 50 $hight = 0 $posx = 0 $posy = 50 $posz = 180 ;the dffinitions are proberly wrong :P i didnt look it up SetCamera( $posx, $posy, $posz,$anglex, $angley, $hight) AddObject( "plain" ) AddGlCylinder( "plain", 0, -0.4, 0, 85, 71, 0.00, 180, 180, 0.5, 0.5, 0.5, 1.0 ) AddGlCylinder( "plain", 0, -0.42, 0, 95, 61, 0.00, 180, 180, 0.6, 0.5, 0.3, 1.0 ) AddGlCylinder( "plain", 0, -0.44, 0, 300, 0.00, 0.00, 180, 180, 0.4, 0.7, 0.4, 1.0 ) $Tunel = "tunel" AddObject( $Tunel ) ;AddGlCylinder( Name, X, Y, Z, Radius1, Radius2, Height, Slices, Stacks, Red, Green, Blue, Alpha ) AddGlCylinder( $Tunel, 0, 15, 0, 20, 10, 0, 20, 20, 0.6, 0.5, 0.3, 1.0 ) AddGlCylinder( $Tunel, 0, -15, 0, 10, 10, 30, 20, 20, 0.5, 0.5, 0.5, 1.0 ) AddGlCylinder( $Tunel, 0, -15, 0, 20, 20, 30, 20, 20, 0.4, 0.7, 0.4, 1.0 ) AddGlCylinder( $Tunel, 0, -15, 0, 20, 10, 0, 20, 20, 0.6, 0.5, 0.3, 1.0 ) RotateObject( $Tunel, 90, 0, 0 ) TranslateObject( $Tunel, 78.3, 0, 0 ) $trilhos = "Trilhos" AddObject( $trilhos ) AddGlCylinder( $trilhos, 0, -0.40, 0, 80.0, 80.0, 0.40, 180, 4, 0.7, 0.7, 0.7, 1.0 ) AddGlCylinder( $trilhos, 0, 0.00, 0, 80.0, 80.4, 0.00, 180, 4, 0.7, 0.7, 0.7, 1.0 ) AddGlCylinder( $trilhos, 0, -0.40, 0, 80.4, 80.4, 0.40, 180, 4, 0.7, 0.7, 0.7, 1.0 ) AddGlCylinder( $trilhos, 0, -0.40, 0, 76.6, 76.6, 0.40, 180, 4, 0.7, 0.7, 0.7, 1.0 ) AddGlCylinder( $trilhos, 0, 0.00, 0, 76.2, 76.6, 0.00, 180, 4, 0.7, 0.7, 0.7, 1.0 ) AddGlCylinder( $trilhos, 0, -0.40, 0, 76.2, 76.2, 0.40, 180, 4, 0.7, 0.7, 0.7, 1.0 ) CreateGroup( "Composition" ) _MakeLocomotive( "Train" ) TranslateGroup( "Train", 0, 0, 78.3 ) SetToGroup( "Composition", "Train" ) ;~ SetToGroup( "Train", "Trilhos" ) ;~ RotateGroup( "Train", 0, -120, 0 ) Opt( "WinTitleMatchMode", 3 ) WinWait( $Title ) WinMove( $Title, "", ( @DesktopWidth / 2 ) - 400, ( @DesktopHeight / 2 ) - 300 ) $CheckWindowTimer = TimerInit( ) $Y_Axis = 0 $timer = TimerInit() While 1 if _IsPressed(01) Then $Mousepos =MouseGetPos() Do $Newmousepos = MouseGetPos() $angley = ($Newmousepos[1]-$Mousepos[1])/1.5 $anglex = ($Newmousepos[0]-$Mousepos[0])/1.5 SetCamera( 0,50,180, $anglex,$angley,$hight) SceneDraw() Animation() Until _IsPressed(01)=0 ;Elseif _IsPressed(02) Then ; $Mousepos =MouseGetPos() ; Do ; $Newmousepos = MouseGetPos() ; $hight = $Newmousepos[1]-$Mousepos[1] ; SetCamera( 0,50,180, $anglex,$angley,$hight) ; SceneDraw() ; Animation() ; Until _IsPressed(02)=0 EndIf Animation() Wend Func Animation() if TimerDiff($timer) > 50 then SceneDraw( ) RotateGroup( "Composition", 0, $Y_Axis, 0 ) RotateTrainWheels( "Train", $Y_Axis * 30 ) $Y_Axis = $Y_Axis + 1 If $Y_Axis < 1 Then $Y_Axis += 360 If $Y_Axis > 360 Then $Y_Axis -= 360 $timer = TimerInit() EndIf ;check if window exist... (using a timer to reduce CPU usage by WinExists function) If TimerDiff( $CheckWindowTimer ) > 1000 Then If WinExists( $Title ) = 0 Then Exit $CheckWindowTimer = TimerInit( ) EndIf EndFunc Good! You took the idea. The SetCamera function works like a eye, with a start position and a target point. 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...
Alek Posted August 31, 2007 Share Posted August 31, 2007 Good! You took the idea. The SetCamera function works like a eye, with a start position and a target point. oh, so its like setcamera(viewpointx,viewpointy,viewpointz,viewfromx,viewfromy,viewfromz)?? [font="Impact"]Never fear, I is here.[/font] Link to comment Share on other sites More sharing options...
A. Percy Posted August 31, 2007 Author Share Posted August 31, 2007 oh, so its like setcamera(viewpointx,viewpointy,viewpointz,viewfromx,viewfromy,viewfromz)??Yes I've made a help, placed at OpenGl Plugin topic (link in my signature). 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...
Alek Posted August 31, 2007 Share Posted August 31, 2007 (edited) maybe you could help me a bit i cant get the camera to turn around properly, here is a img to describe what i want and how it is atmthe blue dot is the camera, the green line is where the target moves when i try to make to the camera turn and the red sircel is where i whould like the target point to move.the problem is that the camera can only turn almost 180* and at about 60* each way from the middel it start to slow down the turn movement because the target pointmoves to far away from the camera, how can i make the target point move in a sircel?? Edited August 31, 2007 by Alek [font="Impact"]Never fear, I is here.[/font] Link to comment Share on other sites More sharing options...
A. Percy Posted August 31, 2007 Author Share Posted August 31, 2007 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...
Alek Posted August 31, 2007 Share Posted August 31, 2007 (edited) ok, now the camera can turn around, but not up and down (dont know why the function wont work) expandcollapse popup;#include "GlPluginUtils.au3" #include "TrainUDF.au3" #Include <Misc.au3> #include <GUIConstants.au3> ;hide icon!!!!!! AutoItSetOption( "TrayIconHide", 1 ) $Title = "Demo Train - AutoIt OpenGl Plugin" DefineGlWindow( 800, 600, $Title ) SetClearColor( 0.6, 0.6, 0.9 ) CreateLight( 0, 600, 1000, 600 ) SetLightAmbient( 0, 0.2, 0.2, 0.2 ) SetLightDiffuse( 0, 0.7, 0.7, 0.7 ) SetLightSpecular( 0, 0, 0, 0 ) ;... make some objects... ;Setcamera( ?,?,?,anglex,angley,hight) $camposx = 50 $camposy = 0 $camposz = 150 $posx = 50 $posy = 0 $posz = 180 $Angle = 45 $angleupdown = 180 ;the dffinitions are proberly wrong :P i didnt look it up SetCamera( $posx, $posy, $posz,$camposx, $camposy, $camposz) $New_Pos = Turncamera($Angle,$posx,$posy,$posz,$camposx,$camposy,$camposz) $posx = $New_Pos[0] $posz = $New_Pos[1] AddObject( "plain" ) AddGlCylinder( "plain", 0, -0.4, 0, 85, 71, 0.00, 180, 180, 0.5, 0.5, 0.5, 1.0 ) AddGlCylinder( "plain", 0, -0.42, 0, 95, 61, 0.00, 180, 180, 0.6, 0.5, 0.3, 1.0 ) AddGlCylinder( "plain", 0, -0.44, 0, 300, 0.00, 0.00, 180, 180, 0.4, 0.7, 0.4, 1.0 ) $Tunel = "tunel" AddObject( $Tunel ) ;AddGlCylinder( Name, X, Y, Z, Radius1, Radius2, Height, Slices, Stacks, Red, Green, Blue, Alpha ) AddGlCylinder( $Tunel, 0, 15, 0, 20, 10, 0, 20, 20, 0.6, 0.5, 0.3, 1.0 ) AddGlCylinder( $Tunel, 0, -15, 0, 10, 10, 30, 20, 20, 0.5, 0.5, 0.5, 1.0 ) AddGlCylinder( $Tunel, 0, -15, 0, 20, 20, 30, 20, 20, 0.4, 0.7, 0.4, 1.0 ) AddGlCylinder( $Tunel, 0, -15, 0, 20, 10, 0, 20, 20, 0.6, 0.5, 0.3, 1.0 ) RotateObject( $Tunel, 90, 0, 0 ) TranslateObject( $Tunel, 78.3, 0, 0 ) $trilhos = "Trilhos" AddObject( $trilhos ) AddGlCylinder( $trilhos, 0, -0.40, 0, 80.0, 80.0, 0.40, 180, 4, 0.7, 0.7, 0.7, 1.0 ) AddGlCylinder( $trilhos, 0, 0.00, 0, 80.0, 80.4, 0.00, 180, 4, 0.7, 0.7, 0.7, 1.0 ) AddGlCylinder( $trilhos, 0, -0.40, 0, 80.4, 80.4, 0.40, 180, 4, 0.7, 0.7, 0.7, 1.0 ) AddGlCylinder( $trilhos, 0, -0.40, 0, 76.6, 76.6, 0.40, 180, 4, 0.7, 0.7, 0.7, 1.0 ) AddGlCylinder( $trilhos, 0, 0.00, 0, 76.2, 76.6, 0.00, 180, 4, 0.7, 0.7, 0.7, 1.0 ) AddGlCylinder( $trilhos, 0, -0.40, 0, 76.2, 76.2, 0.40, 180, 4, 0.7, 0.7, 0.7, 1.0 ) CreateGroup( "Composition" ) _MakeLocomotive( "Train" ) TranslateGroup( "Train", 0, 0, 78.3 ) SetToGroup( "Composition", "Train" ) ;~ SetToGroup( "Train", "Trilhos" ) ;~ RotateGroup( "Train", 0, -120, 0 ) Opt( "WinTitleMatchMode", 3 ) WinWait( $Title ) WinMove( $Title, "", ( @DesktopWidth / 2 ) - 400, ( @DesktopHeight / 2 ) - 300 ) $CheckWindowTimer = TimerInit( ) $Y_Axis = 0 $timer = TimerInit() While WinExists( $Title ) if WinActive($Title) then if _IsPressed(41) Then $speedtimer = TimerInit() $speed = 0.5 Do if TimerDiff($speedtimer) > 500 and $speed < 10 Then $speed +=0.1 $speedtimer = TimerInit() EndIf $posx -=$speed $camposx -=$speed SetCamera( $posx,$posy,$posz, $camposx,$camposy,$camposz) SceneDraw() Animation() Sleep(1) Until _IsPressed(41) = 0 elseif _IsPressed(44) Then $speedtimer = TimerInit() $speed = 0.5 Do if TimerDiff($speedtimer) > 500 and $speed < 10 Then $speed +=0.1 $speedtimer = TimerInit() EndIf $posx +=$speed $camposx +=$speed SetCamera( $posx,$posy,$posz, $camposx,$camposy,$camposz) SceneDraw() Animation() Sleep(1) Until _IsPressed(44) = 0 elseif _IsPressed(57) Then $speedtimer = TimerInit() $speed = 0.5 Do if TimerDiff($speedtimer) > 500 and $speed < 10 Then $speed +=0.1 $speedtimer = TimerInit() EndIf $posz -=$speed $camposz -=$speed SetCamera( $posx,$posy,$posz, $camposx,$camposy,$camposz) SceneDraw() Animation() Sleep(1) Until _IsPressed(57) = 0 elseif _IsPressed(53) Then $speedtimer = TimerInit() $speed = 0.5 Do if TimerDiff($speedtimer) > 500 and $speed < 10 Then $speed +=0.1 $speedtimer = TimerInit() EndIf $posz +=$speed $camposz +=$speed SetCamera( $posx,$posy,$posz, $camposx,$camposy,$camposz) SceneDraw() Animation() Sleep(1) Until _IsPressed(53) = 0 elseif _IsPressed(58) Then Do $posy +=1 $camposy +=1 SetCamera( $posx,$posy,$posz, $camposx,$camposy,$camposz) SceneDraw() Animation() Sleep(1) Until _IsPressed(58) = 0 elseif _IsPressed("5a") And $posy > 0 Then Do $posy -=1 $camposy -=1 if $posy < 0 then ExitLoop SetCamera( $posx,$posy,$posz, $camposx,$camposy,$camposz) SceneDraw() Animation() Sleep(1) Until _IsPressed("5a") = 0 or $posy = 0 elseif _IsPressed(25) Then Do $Angle -= 1 if $Angle < 1 then $Angle = 360 $New_pos = Turncamera($Angle,$posx,$posy,$posz, $camposx,$camposy,$camposz) SceneDraw() Animation() Sleep(1) Until _IsPressed(25) = 0 $posx = $New_pos[0] $posz = $New_Pos[1] ;ElseIf _IsPressed(26) Then ; Do ; $angleupdown += 1 ; Turncameraupdown($angleupdown,$posx,$posy,$posz,$camposx,$camposy,$camposz) ; SceneDraw() ; Animation() ; Sleep(1) ; Until _IsPressed(26) = 0 elseif _IsPressed(27) Then Do $Angle += 1 if $Angle > 360 then $Angle = 1 $New_pos = Turncamera($Angle,$posx,$posy,$posz, $camposx,$camposy,$camposz) SceneDraw() Animation() Sleep(10) Until _IsPressed(27) = 0 $posx = $New_pos[0] $posz = $New_Pos[1] ;ElseIf _IsPressed(28) Then ; Do ; $angleupdown -= 1 ; Turncameraupdown($angleupdown,$posx,$posy,$posz,$camposx,$camposy,$camposz) ; SceneDraw() ; Animation() ; Sleep(1) ; Until _IsPressed(27) = 0 EndIf EndIf Animation() Wend Func Animation() if TimerDiff($timer) > 20 then SceneDraw() RotateGroup( "Composition", 0, $Y_Axis, 0 ) RotateTrainWheels( "Train", $Y_Axis * 20 ) $Y_Axis = $Y_Axis + 1 If $Y_Axis < 1 Then $Y_Axis += 360 If $Y_Axis > 360 Then $Y_Axis -= 360 $timer = TimerInit() EndIf EndFunc Func Turncamera($S_Angle,$current_Targetx,$current_Targety,$current_Targetz,$current_posx,$current_posy,$current_posz) Local $Array[2] $r = 40 $S_angle = (6.2/360)*$S_angle $New_posx = $current_posx + $r * Cos($S_angle) $New_Posz = $current_posz + $r * Sin($S_angle) SetCamera($New_posx,$current_Targety,$New_Posz,$current_posx,$current_posy,$current_posz) $Array[0] = $New_posx $Array[1] = $New_Posz Return $Array EndFunc Func Turncameraupdown($S_Angle,$current_Targetx,$current_Targety,$current_Targetz,$current_posx,$current_posy,$current_posz) $r = 40 $S_angle = (6.2/360)*$S_angle $New_posy = $current_posy + $r * Cos($S_angle) SetCamera($current_Targetx,$New_Posy,$current_Targetz,$current_posx,$current_posy,$current_posz) Return $New_Posy EndFunc Problems: -1: if you try to use the truncameraupdown fucntion it jumps around like crazy -2: the movement follows the x,y and z axis, its ok until you turn the camera around, then it still follows the axis, so left may become right and in becomes out needs a better movement system that follows the angle of the camera anyone have any idea how to fix the 2 problems?? Edited August 31, 2007 by Alek [font="Impact"]Never fear, I is here.[/font] Link to comment Share on other sites More sharing options...
Zedna Posted August 31, 2007 Share Posted August 31, 2007 Very nice !! Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
martin Posted August 31, 2007 Share Posted August 31, 2007 ok, now the camera can turn around, but not up and down (dont know why the function wont work) expandcollapse popup;#include "GlPluginUtils.au3" #include "TrainUDF.au3" #Include <Misc.au3> #include <GUIConstants.au3> ;hide icon!!!!!! AutoItSetOption( "TrayIconHide", 1 ) $Title = "Demo Train - AutoIt OpenGl Plugin" DefineGlWindow( 800, 600, $Title ) SetClearColor( 0.6, 0.6, 0.9 ) CreateLight( 0, 600, 1000, 600 ) SetLightAmbient( 0, 0.2, 0.2, 0.2 ) SetLightDiffuse( 0, 0.7, 0.7, 0.7 ) SetLightSpecular( 0, 0, 0, 0 ) ;... make some objects... ;Setcamera( ?,?,?,anglex,angley,hight) $camposx = 50 $camposy = 0 $camposz = 150 $posx = 50 $posy = 0 $posz = 180 $Angle = 45 $angleupdown = 180 ;the dffinitions are proberly wrong :P i didnt look it up SetCamera( $posx, $posy, $posz,$camposx, $camposy, $camposz) $New_Pos = Turncamera($Angle,$posx,$posy,$posz,$camposx,$camposy,$camposz) $posx = $New_Pos[0] $posz = $New_Pos[1] AddObject( "plain" ) AddGlCylinder( "plain", 0, -0.4, 0, 85, 71, 0.00, 180, 180, 0.5, 0.5, 0.5, 1.0 ) AddGlCylinder( "plain", 0, -0.42, 0, 95, 61, 0.00, 180, 180, 0.6, 0.5, 0.3, 1.0 ) AddGlCylinder( "plain", 0, -0.44, 0, 300, 0.00, 0.00, 180, 180, 0.4, 0.7, 0.4, 1.0 ) $Tunel = "tunel" AddObject( $Tunel ) ;AddGlCylinder( Name, X, Y, Z, Radius1, Radius2, Height, Slices, Stacks, Red, Green, Blue, Alpha ) AddGlCylinder( $Tunel, 0, 15, 0, 20, 10, 0, 20, 20, 0.6, 0.5, 0.3, 1.0 ) AddGlCylinder( $Tunel, 0, -15, 0, 10, 10, 30, 20, 20, 0.5, 0.5, 0.5, 1.0 ) AddGlCylinder( $Tunel, 0, -15, 0, 20, 20, 30, 20, 20, 0.4, 0.7, 0.4, 1.0 ) AddGlCylinder( $Tunel, 0, -15, 0, 20, 10, 0, 20, 20, 0.6, 0.5, 0.3, 1.0 ) RotateObject( $Tunel, 90, 0, 0 ) TranslateObject( $Tunel, 78.3, 0, 0 ) $trilhos = "Trilhos" AddObject( $trilhos ) AddGlCylinder( $trilhos, 0, -0.40, 0, 80.0, 80.0, 0.40, 180, 4, 0.7, 0.7, 0.7, 1.0 ) AddGlCylinder( $trilhos, 0, 0.00, 0, 80.0, 80.4, 0.00, 180, 4, 0.7, 0.7, 0.7, 1.0 ) AddGlCylinder( $trilhos, 0, -0.40, 0, 80.4, 80.4, 0.40, 180, 4, 0.7, 0.7, 0.7, 1.0 ) AddGlCylinder( $trilhos, 0, -0.40, 0, 76.6, 76.6, 0.40, 180, 4, 0.7, 0.7, 0.7, 1.0 ) AddGlCylinder( $trilhos, 0, 0.00, 0, 76.2, 76.6, 0.00, 180, 4, 0.7, 0.7, 0.7, 1.0 ) AddGlCylinder( $trilhos, 0, -0.40, 0, 76.2, 76.2, 0.40, 180, 4, 0.7, 0.7, 0.7, 1.0 ) CreateGroup( "Composition" ) _MakeLocomotive( "Train" ) TranslateGroup( "Train", 0, 0, 78.3 ) SetToGroup( "Composition", "Train" ) ;~ SetToGroup( "Train", "Trilhos" ) ;~ RotateGroup( "Train", 0, -120, 0 ) Opt( "WinTitleMatchMode", 3 ) WinWait( $Title ) WinMove( $Title, "", ( @DesktopWidth / 2 ) - 400, ( @DesktopHeight / 2 ) - 300 ) $CheckWindowTimer = TimerInit( ) $Y_Axis = 0 $timer = TimerInit() While WinExists( $Title ) if WinActive($Title) then if _IsPressed(41) Then $speedtimer = TimerInit() $speed = 0.5 Do if TimerDiff($speedtimer) > 500 and $speed < 10 Then $speed +=0.1 $speedtimer = TimerInit() EndIf $posx -=$speed $camposx -=$speed SetCamera( $posx,$posy,$posz, $camposx,$camposy,$camposz) SceneDraw() Animation() Sleep(1) Until _IsPressed(41) = 0 elseif _IsPressed(44) Then $speedtimer = TimerInit() $speed = 0.5 Do if TimerDiff($speedtimer) > 500 and $speed < 10 Then $speed +=0.1 $speedtimer = TimerInit() EndIf $posx +=$speed $camposx +=$speed SetCamera( $posx,$posy,$posz, $camposx,$camposy,$camposz) SceneDraw() Animation() Sleep(1) Until _IsPressed(44) = 0 elseif _IsPressed(57) Then $speedtimer = TimerInit() $speed = 0.5 Do if TimerDiff($speedtimer) > 500 and $speed < 10 Then $speed +=0.1 $speedtimer = TimerInit() EndIf $posz -=$speed $camposz -=$speed SetCamera( $posx,$posy,$posz, $camposx,$camposy,$camposz) SceneDraw() Animation() Sleep(1) Until _IsPressed(57) = 0 elseif _IsPressed(53) Then $speedtimer = TimerInit() $speed = 0.5 Do if TimerDiff($speedtimer) > 500 and $speed < 10 Then $speed +=0.1 $speedtimer = TimerInit() EndIf $posz +=$speed $camposz +=$speed SetCamera( $posx,$posy,$posz, $camposx,$camposy,$camposz) SceneDraw() Animation() Sleep(1) Until _IsPressed(53) = 0 elseif _IsPressed(58) Then Do $posy +=1 $camposy +=1 SetCamera( $posx,$posy,$posz, $camposx,$camposy,$camposz) SceneDraw() Animation() Sleep(1) Until _IsPressed(58) = 0 elseif _IsPressed("5a") And $posy > 0 Then Do $posy -=1 $camposy -=1 if $posy < 0 then ExitLoop SetCamera( $posx,$posy,$posz, $camposx,$camposy,$camposz) SceneDraw() Animation() Sleep(1) Until _IsPressed("5a") = 0 or $posy = 0 elseif _IsPressed(25) Then Do $Angle -= 1 if $Angle < 1 then $Angle = 360 $New_pos = Turncamera($Angle,$posx,$posy,$posz, $camposx,$camposy,$camposz) SceneDraw() Animation() Sleep(1) Until _IsPressed(25) = 0 $posx = $New_pos[0] $posz = $New_Pos[1] ;ElseIf _IsPressed(26) Then ; Do ; $angleupdown += 1 ; Turncameraupdown($angleupdown,$posx,$posy,$posz,$camposx,$camposy,$camposz) ; SceneDraw() ; Animation() ; Sleep(1) ; Until _IsPressed(26) = 0 elseif _IsPressed(27) Then Do $Angle += 1 if $Angle > 360 then $Angle = 1 $New_pos = Turncamera($Angle,$posx,$posy,$posz, $camposx,$camposy,$camposz) SceneDraw() Animation() Sleep(10) Until _IsPressed(27) = 0 $posx = $New_pos[0] $posz = $New_Pos[1] ;ElseIf _IsPressed(28) Then ; Do ; $angleupdown -= 1 ; Turncameraupdown($angleupdown,$posx,$posy,$posz,$camposx,$camposy,$camposz) ; SceneDraw() ; Animation() ; Sleep(1) ; Until _IsPressed(27) = 0 EndIf EndIf Animation() Wend Func Animation() if TimerDiff($timer) > 20 then SceneDraw() RotateGroup( "Composition", 0, $Y_Axis, 0 ) RotateTrainWheels( "Train", $Y_Axis * 20 ) $Y_Axis = $Y_Axis + 1 If $Y_Axis < 1 Then $Y_Axis += 360 If $Y_Axis > 360 Then $Y_Axis -= 360 $timer = TimerInit() EndIf EndFunc Func Turncamera($S_Angle,$current_Targetx,$current_Targety,$current_Targetz,$current_posx,$current_posy,$current_posz) Local $Array[2] $r = 40 $S_angle = (6.2/360)*$S_angle $New_posx = $current_posx + $r * Cos($S_angle) $New_Posz = $current_posz + $r * Sin($S_angle) SetCamera($New_posx,$current_Targety,$New_Posz,$current_posx,$current_posy,$current_posz) $Array[0] = $New_posx $Array[1] = $New_Posz Return $Array EndFunc Func Turncameraupdown($S_Angle,$current_Targetx,$current_Targety,$current_Targetz,$current_posx,$current_posy,$current_posz) $r = 40 $S_angle = (6.2/360)*$S_angle $New_posy = $current_posy + $r * Cos($S_angle) SetCamera($current_Targetx,$New_Posy,$current_Targetz,$current_posx,$current_posy,$current_posz) Return $New_Posy EndFunc Problems: -1: if you try to use the truncameraupdown fucntion it jumps around like crazy -2: the movement follows the x,y and z axis, its ok until you turn the camera around, then it still follows the axis, so left may become right and in becomes out needs a better movement system that follows the angle of the camera anyone have any idea how to fix the 2 problems?? Here is an example of the camera moving in a semicircle over the train, needs the train UDF. expandcollapse popup;#include "GlPluginUtils.au3" #include "TrainUDF.au3" ;hide icon!!!!!! AutoItSetOption( "TrayIconHide", 1 ) $Title = "Demo Train - AutoIt OpenGl Plugin" DefineGlWindow( 800, 600, $Title ) SetClearColor( 0.6, 0.6, 0.9 ) CreateLight( 0, 600, 1000, 600 ) SetLightAmbient( 0, 0.2, 0.2, 0.2 ) SetLightDiffuse( 0, 0.7, 0.7, 0.7 ) SetLightSpecular( 0, 0, 0, 0 ) ;... make some objects... SetCamera( 00, 10, 200, 0, 0, 0 ) AddObject( "plain" ) AddGlCylinder( "plain", 0, -0.4, 0, 85, 71, 0.00, 180, 180, 0.5, 0.5, 0.5, 1.0 ) AddGlCylinder( "plain", 0, -0.42, 0, 95, 61, 0.00, 180, 180, 0.6, 0.5, 0.3, 1.0 ) AddGlCylinder( "plain", 0, -0.44, 0, 300, 0.00, 0.00, 180, 180, 0.4, 0.7, 0.4, 1.0 ) $Tunel = "tunel" AddObject( $Tunel ) ;AddGlCylinder( Name, X, Y, Z, Radius1, Radius2, Height, Slices, Stacks, Red, Green, Blue, Alpha ) AddGlCylinder( $Tunel, 0, 15, 0, 20, 10, 0, 20, 20, 0.6, 0.5, 0.3, 1.0 ) AddGlCylinder( $Tunel, 0, -15, 0, 10, 10, 30, 20, 20, 0.5, 0.5, 0.5, 1.0 ) AddGlCylinder( $Tunel, 0, -15, 0, 20, 20, 30, 20, 20, 0.4, 0.7, 0.4, 1.0 ) AddGlCylinder( $Tunel, 0, -15, 0, 20, 10, 0, 20, 20, 0.6, 0.5, 0.3, 1.0 ) RotateObject( $Tunel, 90, 0, 0 ) TranslateObject( $Tunel, 78.3, 0, 0 ) $trilhos = "Trilhos" AddObject( $trilhos ) AddGlCylinder( $trilhos, 0, -0.40, 0, 80.0, 80.0, 0.40, 180, 4, 0.7, 0.7, 0.7, 1.0 ) AddGlCylinder( $trilhos, 0, 0.00, 0, 80.0, 80.4, 0.00, 180, 4, 0.7, 0.7, 0.7, 1.0 ) AddGlCylinder( $trilhos, 0, -0.40, 0, 80.4, 80.4, 0.40, 180, 4, 0.7, 0.7, 0.7, 1.0 ) AddGlCylinder( $trilhos, 0, -0.40, 0, 76.6, 76.6, 0.40, 180, 4, 0.7, 0.7, 0.7, 1.0 ) AddGlCylinder( $trilhos, 0, 0.00, 0, 76.2, 76.6, 0.00, 180, 4, 0.7, 0.7, 0.7, 1.0 ) AddGlCylinder( $trilhos, 0, -0.40, 0, 76.2, 76.2, 0.40, 180, 4, 0.7, 0.7, 0.7, 1.0 ) CreateGroup( "Composition" ) _MakeLocomotive( "Train" ) TranslateGroup( "Train", 0, 0, 78.3 ) SetToGroup( "Composition", "Train" ) ;~ SetToGroup( "Train", "Trilhos" ) ;~ RotateGroup( "Train", 0, -120, 0 ) Opt( "WinTitleMatchMode", 3 ) WinWait( $Title ) WinMove( $Title, "", ( @DesktopWidth / 2 ) - 400, ( @DesktopHeight / 2 ) - 300 ) $CheckWindowTimer = TimerInit( ) $Y_Axis = 0 $dx = 0 $dy = 0 While 1 SceneDraw( ) sleep( 50 ) RotateGroup( "Composition", 0, $Y_Axis, 0 ) RotateTrainWheels( "Train", $Y_Axis * 30 ) $Y_Axis = $Y_Axis + 1 If $Y_Axis < 1 Then $Y_Axis += 360 If $Y_Axis > 360 Then $Y_Axis -= 360 ;check if window exist... (using a timer to reduce CPU usage by WinExists function) If TimerDiff( $CheckWindowTimer ) > 100 Then $dx += 1/360 $dy +=1 SetCamera( 0, 200*Sin($dx), 200*Cos($dx), 0,0,0 ) If WinExists( $Title ) = 0 Then ExitLoop $CheckWindowTimer = TimerInit( ) EndIf Wend Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. 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