ConsultingJoe Posted December 8, 2006 Posted December 8, 2006 Alpha... Ok, now it works. but what are the parameters of the sphere Check out ConsultingJoe.com
A. Percy Posted December 8, 2006 Author Posted December 8, 2006 AddGlSphere( Name, X, Y, Z, Radius, Slices, Stacks, Red, Green, Blue, Alpha ) X, Y, Z - position Radius - radius of sphere Slices - like longitude of Earth Stacks - like latitude Red, Green, Blue, Alpha - color 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
ConsultingJoe Posted December 8, 2006 Posted December 8, 2006 Flying with AutoIt.use your pointer keys.NOTE: if you have Epilepsy, you should not play this.CODE#compiler_plugin_funcs=DefineGlWindow, SetClearColor, SetCamera, GlMainLoop, AddLine, AddTriangle, AddObject, RotateObject, TranslateObject, AddGlSphere;AutoItSetOption( "TrayIconHide", 1 )#include <GUIConstants.au3>#include <misc.au3>Global Const $TBS_REVERSED = 0x200$handle = PluginOpen( @ScriptDir & "\Au3GlPlugin.dll" );--------------------------------------------------------------------------------------------Func _AddTriangleEx( $Name, $V1, $V2, $V3, $Normal, $Red, $Green, $Blue, $Alpha ) If UBound( $V1 ) and UBound( $V2 ) and UBound( $V3 ) and UBound( $Normal ) Then AddTriangle( $Name, $V1[0], $V1[1], $V1[2], $V2[0], $V2[1], $V2[2], $V3[0], $V3[1], $V3[2], $Normal[0], $Normal[1], $Normal[2], $Red, $Green, $Blue, $Alpha ) EndIfEndFunc;--------------------------------------------------------------------------------------------Func _CreateRect( $Name, $Red, $Green, $Blue, $Alpha, $width, $height, $depth, $x, $y, $z ) AddObject( $Name ) Local $V1[3] = [ -($width/2)+$x, $height/2+$y, -($depth/2)+$z] Local $V2[3] = [ $width/2+$x, $height/2+$y, -($depth/2)+$z] Local $V3[3] = [ -($width/2)+$x, -($height/2)+$y, -($depth/2)+$z] Local $V4[3] = [ $width/2+$x, -($height/2)+$y, -($depth/2)+$z] Local $V5[3] = [ -($width/2)+$x, $height/2+$y, $depth/2+$z] Local $V6[3] = [ $width/2+$x, $height/2+$y, $depth/2+$z] Local $V7[3] = [ -($width/2)+$x, -($height/2)+$y, $depth/2+$z] Local $V8[3] = [ $width/2+$x, -($height/2)+$y, $depth/2+$z] Local $Normal[3] = [ 0, 0, 1 ] _AddTriangleEx( $Name, $V1, $V2, $V3, $Normal, $Red, $Green, $Blue, $Alpha ) _AddTriangleEx( $Name, $V3, $V4, $V2, $Normal, $Red, $Green, $Blue, $Alpha ) Local $Normal[3] = [ 1, 0, 0 ] _AddTriangleEx( $Name, $V6, $V2, $V8, $Normal, $Red, $Green, $Blue, $Alpha ) _AddTriangleEx( $Name, $V8, $V4, $V2, $Normal, $Red, $Green, $Blue, $Alpha ) Local $Normal[3] = [ 0, 0,-1 ] _AddTriangleEx( $Name, $V6, $V8, $V5, $Normal, $Red, $Green, $Blue, $Alpha ) _AddTriangleEx( $Name, $V7, $V8, $V5, $Normal, $Red, $Green, $Blue, $Alpha ) Local $Normal[3] = [-1, 0, 0 ] _AddTriangleEx( $Name, $V5, $V1, $V3, $Normal, $Red, $Green, $Blue, $Alpha ) _AddTriangleEx( $Name, $V5, $V7, $V3, $Normal, $Red, $Green, $Blue, $Alpha ) Local $Normal[3] = [ 0, 1, 0 ] _AddTriangleEx( $Name, $V1, $V6, $V5, $Normal, $Red, $Green, $Blue, $Alpha ) _AddTriangleEx( $Name, $V1, $V2, $V6, $Normal, $Red, $Green, $Blue, $Alpha ) Local $Normal[3] = [ 0,-1, 0 ] _AddTriangleEx( $Name, $V3, $V8, $V7, $Normal, $Red, $Green, $Blue, $Alpha ) _AddTriangleEx( $Name, $V3, $V8, $V4, $Normal, $Red, $Green, $Blue, $Alpha )EndFunc;--------------------------------------------------------------------------------------------$title = "AutoIt OpenGl Experiment"DefineGlWindow( @DesktopWidth, @DesktopHeight, $title )SetCamera( 0, 0, 300, 0, 0, 0 )SetClearColor( .02, 0, .02 )AddObject( "a" )AddObject( "b" )AddObject( "c" )AddObject( "d" )AddTriangle( "a", -30, -20, -20, 30, -20, -20, 0, -20, 60, 0, 0, 1, 1, 0, 0, .2 );bottomAddTriangle( "b", 0, 10, -20, 30, -20, -20, 0, -20, 60, 0, 0, 1, 0, 0, 1, .2 );leftAddTriangle( "c", -30, -20, -20, 0, 10, -20, 0, -20, 60, 0, 0, 1, 1, 2, 1, .2 );rightAddTriangle( "d", -30, -20, -20, 30, -20, -20, 0, 10, -20, 1, 0, 0, 0, 0, 0.1, .05 );backTranslateObject( "a", 0, -30, 0 )TranslateObject( "b", 0, -30, 0 )TranslateObject( "c", 0, -30, 0 )TranslateObject( "d", 0, -30, 0 );_CreateRect( "b", 0, 100, 0, .4, 50, 10, 100, 100, 30, 10 )AddGlSphere( "e", 0, 0, 0, 10, 10, 10, 1.0, 0.4, 0.4, 1.0 )TranslateObject( "f", -120, 0, 0 )GlMainLoop( )WinWait( $title )WinSetState( $title, "", @SW_MAXIMIZE )$y = 0$x = 0$up_down = 1$left_right = 1$X_Axis = 0$Y_Axis = 0$Z_Axis = 0;RotateObject( "a", 0, 180, 0 );RotateObject( "b", 0, 180, 0 );RotateObject( "c", 0, 180, 0 );RotateObject( "d", 0, 180, 0 )While 1 SetClearColor( Random(.0, .5), Random(.0, .5), Random(.0, .5) ) ;$pos = WinGetPos( $title ) ;$mouse = MouseGetPos() ;If WinActive( $title ) And $mouse[0] > $pos[0] And $mouse[0] < $pos [2] And $mouse[1] > $pos[1] And $mouse[1] < $pos [3] And _IsPressed("01") Then ; $X_Axis = $mouse[1] ; $Y_Axis = $mouse[0] ; ;TrayTip("", "X: " & $Y_Axis & @CRLF & "Y: " & $X_Axis, 1, 16 ) ;EndIf If Not WinExists( $title ) Then ExitLoop If _IsPressed("25") Then $X_Axis = $X_Axis - 1.3 move($X_Axis, $Y_Axis, $Z_Axis) EndIf If _IsPressed("26") Then $Y_Axis = $Y_Axis + 1.3 move($X_Axis, $Y_Axis, $Z_Axis) EndIf If _IsPressed("27") Then $X_Axis = $X_Axis + 1.3 move($X_Axis, $Y_Axis, $Z_Axis) EndIf If _IsPressed("28") Then $Y_Axis = $Y_Axis - 1.3 move($X_Axis, $Y_Axis, $Z_Axis) EndIf ;RotateObject( "e", 0, $Y_Axis*3, 0 ) ;$Y_Axis = $Y_Axis + 2 ;If $Y_Axis = 360 Then $Y_Axis = 0 ;If $Y_Axis > 360 Then $Y_Axis = $Y_Axis - 360 WendPluginClose( $handle )Func move($X_Axis, $Y_Axis, $Z_Axis) TranslateObject( "a", $X_Axis, $Y_Axis, $Z_Axis ) TranslateObject( "b", $X_Axis, $Y_Axis, $Z_Axis ) TranslateObject( "c", $X_Axis, $Y_Axis, $Z_Axis ) TranslateObject( "d", $X_Axis, $Y_Axis, $Z_Axis )EndFunc Check out ConsultingJoe.com
A. Percy Posted December 9, 2006 Author Posted December 9, 2006 That was... insane! Try create a Star Wars game! 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
ConsultingJoe Posted December 9, 2006 Posted December 9, 2006 That was... insane! Try create a Star Wars game! Thanks I would like to but I have to be able to edit the objects and delete them.If there was a way to design the objects and have it write the code that would be cool, I could make it if I had those other commands.Suggestions:Object EditObject DeleteObject Create Object (For Guis)Objects return object variablesCreate Light/ReflectionI could think of a bunch more Check out ConsultingJoe.com
ConsultingJoe Posted December 9, 2006 Posted December 9, 2006 One more thing, When you close the plugin or exit could you make it close because it seems to stay running Check out ConsultingJoe.com
Zedna Posted December 10, 2006 Posted December 10, 2006 One more thing, When you close the plugin or exit could you make it close because it seems to stay runningI have the same problem when trying examples from here. Resources UDF ResourcesEx UDF AutoIt Forum Search
ConsultingJoe Posted December 10, 2006 Posted December 10, 2006 (edited) I have the same problem when trying examples from here.I have it use the exit function when it is exiting, so if the window is gone it exits. or have it close processBut I also want to know how you made a sphere out of the triangles, what is the formula? Edited December 10, 2006 by CyberZeroCool Check out ConsultingJoe.com
XxXFaNtA Posted December 10, 2006 Posted December 10, 2006 I thought he used a Sphere object out of the OpenGL stuff btw...is the colorflashing normal in your example cyberzerocool? Because my eyes starting bleeding >.< /[center][/center]
RazerM Posted December 10, 2006 Posted December 10, 2006 I just commented out line 88. Anyway nice example zerocool 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.
Lakes Posted December 10, 2006 Posted December 10, 2006 This is really cool! WTG guys!, great job so far! 2015 - Still no flying cars, instead blankets with sleeves.
ConsultingJoe Posted December 10, 2006 Posted December 10, 2006 I just commented out line 88. Anyway nice example zerocoolLOL, yeah but it was just there to show you what you can do. I can't wait for the next update. Check out ConsultingJoe.com
ConsultingJoe Posted December 12, 2006 Posted December 12, 2006 I am bumping this because I don't think enough people know how useful and powerful this is. Check out ConsultingJoe.com
A. Percy Posted December 12, 2006 Author Posted December 12, 2006 New update in 12/12/06 See first post! And please, try sample2.au3 included with source code! 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
nfwu Posted December 12, 2006 Posted December 12, 2006 Nice! A real 3D engine! Good job guys! #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode()
A. Percy Posted December 12, 2006 Author Posted December 12, 2006 Thanks! I will work now in lights management, so it will be a 3d engine. We need make some UDFs with parser to load objects from file, some functions that creates polygons, functions documentation, etc... And we need a colision system for games 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
ConsultingJoe Posted December 12, 2006 Posted December 12, 2006 (edited) Thanks!I will work now in lights management, so it will be a 3d engine.We need make some UDFs with parser to load objects from file, some functions that creates polygons, functions documentation, etc...And we need a colision system for games I am here to help, I could do some udfs for different shapes, I just need you to review them to make sure points are correct. Please give me the formula for the sphere though.And yes we need events for shapes such as colision and mouse clicks, etc.Thanks a lotBTW: Cool new example, how do you map out your points when you are designing? Edited December 12, 2006 by CyberZeroCool Check out ConsultingJoe.com
A. Percy Posted December 13, 2006 Author Posted December 13, 2006 Thanks! Well, the sphere... I did not "program" it. I used a glut function to do it. But if I need create in hand a sphere, I can calculate the vertex positions using ( Radius * sen( angle ) ) and ( Radius * cos( angle ) ) to obtain X and Y... I will use it when create function to rotate camera and spot light. For now we need to document all functions... The easy way is looking in source code. :"> 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
A. Percy Posted December 13, 2006 Author Posted December 13, 2006 BTW: Cool new example, how do you map out your points when you are designing?Well... I map in my mind... This is a sequel of PovRay (www.povray.org) 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
ConsultingJoe Posted December 13, 2006 Posted December 13, 2006 (edited) Thanks!Well, the sphere... I did not "program" it. I used a glut function to do it. But if I need create in hand a sphere, I can calculate the vertex positions using ( Radius * sen( angle ) ) and ( Radius * cos( angle ) ) to obtain X and Y...I will use it when create function to rotate camera and spot light.For now we need to document all functions... The easy way is looking in source code. :">Ok, thanks, I will make a few more UDFs and write up a help file in the next few days. thanksBTW: I see you made DelObject, Thanks but would you make EditObject for triangles and spheres? Edited December 13, 2006 by CyberZeroCool Check out ConsultingJoe.com
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