Jump to content

Au3GlPlugin T2 - OpenGl Plugin Evolution


A. Percy
 Share

Recommended Posts

  • Replies 72
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi!

Run OK under XP.

But not under Vista.

An idea? Thanks by advance.

Hi :)

I didn't test under Vista. I'll reserch about. ;)

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

You guys will get a kick out of this. Make sure your mic!!!

#Include <string.au3>
#include <misc.au3>
#include "GlPluginUtils.au3"
AutoItSetOption( "TrayIconHide", 1 )
Dim $lpszDevice
Dim $lpszDeviceID
Dim $lpszOpenFlags
Dim $lpszRequest
Dim $lpszFlags
Dim $lpszCommand
Dim $lpszReturnString
Dim $cchReturn
Dim $mciError
$lpszDevice = "new type waveaudio"
$lpszOpenFlags = "alias mywave"
$lpszFlags = ""
$lpszCommand = StringFormat( "open %s %s %s", $lpszDevice, $lpszOpenFlags, $lpszFlags)
$lpszReturnString = _StringRepeat( " ", 100)
$cchReturn = StringLen($lpszReturnString)
$mciError = _mciSendString($lpszCommand, $lpszReturnString, $cchReturn, 0);
If $mciError[0] <> 0 Then _mciShowError($mciError[0])
$lpszDeviceID = "mywave"
$lpszRequest = "level"
$lpszFlags = ""
$lpszCommand = StringFormat( "status %s %s %s", $lpszDeviceID, $lpszRequest, $lpszFlags);
$point = 0



$Title = "Au3GlPlugin - Example"

;defining window
DefineGlWindow( 400, 300, $Title )
;setting back color
SetClearColor( 1.0, 1.0, 1.0 )

;creating light 0
CreateLight( 0, 300, 300, 300 )
SetLightAmbient( 0, 0.2, 0.2, 0.2 )
SetLightDiffuse( 0, 0.7, 0.7, 0.7 )
SetLightSpecular( 0, 1.0, 1.0, 1.0 )

;creating an object
$Object1 = ObjectCreate( )
;creating a shape in object
$head = AddSphere( $Object1, 0, 10, 0, 60, 10, 10, .255, .128, .064, 1.0 )
$leye = AddSphere( $Object1, -20, 30, 40, 20, 10, 10, .5, .8, .4, 1.0 )
$reye = AddSphere( $Object1, 20, 30, 40, 20, 10, 10, .5, .8, .4, 1.0 )
$mouth = AddCube( $Object1, 3, 1, 2, 0.4, 1.0, 0.4, 1.0 )

;ShapeRotate( $Object1, $Cube, 0, 20, 0 )

;setting to print the object
SetPrint( $Object1 )

;setting camera parameters
SetCamera( 0, 30, 200, 0, 10, 0 )

Opt( "WinTitleMatchMode", 3 )
WinWait( $Title )
$CheckWindowTimer = TimerInit( )
$X = 0
$up = False
While 1
    SceneDraw( )
    If $X = 10 Then
        $X = $X - .5
        $up = False
    ElseIf $X = -10 Then
        $X = $X + .5
        $up = True
    EndIf
    If $up = False Then $X = $X - .5
    If $up = True Then $X = $X + .5
    ObjectRotate( $Object1, $X, $X, $X )
    $mciError = _mciSendString($lpszCommand, $lpszReturnString, $cchReturn, 0);
    If $mciError[0] <> 0 Then _mciShowError($mciError[0])
    $vol = $mciError[2]
    If $vol > 20 Then $vol = $vol/3
    If $vol < 3 Then $vol = 1
    
    ShapeScale( $Object1, $mouth, 10, $vol, 70 )
    Sleep(20)
    ;ConsoleWrite($vol&@CRLF)
        If TimerDiff( $CheckWindowTimer ) > 1000 Then
        If WinExists( $Title ) = 0 Then ExitLoop
        $CheckWindowTimer = TimerInit( )
    EndIf
WEnd

    
Func SpecialEvents()
    Exit
EndFunc

Func _mciSendString($lpszCommand, $lpszReturnString, $cchReturn, $hwndCallback)
    Return DllCall("winmm.dll", "long", "mciSendStringA", "str", $lpszCommand, "str", $lpszReturnString, "long", $cchReturn, "long", 0)
EndFunc   ;==>_mciSendString
Func _mciShowError($mciError)
    Dim $errStr; Error message
    $errStr = _StringRepeat( " ", 100) ; Reserve some space for the error message
    $Result = DllCall("winmm.dll", "long", "mciGetErrorStringA", "long", $mciError, "string", $errStr, "long", StringLen($errStr))
    MsgBox(0, "MCI test", "MCI Error Number " & $mciError & ":" & $Result[2])
EndFunc   ;==>_mciShowError
Check out ConsultingJoe.com
Link to comment
Share on other sites

  • 2 weeks later...

Here is in mind a better version of _CreateCube()

it returns the ID of the diffrent sides allowing you to add a texture to the diffrent sides of the cube.

and in the older version 2 of the sides was wrong way, you couldent see it unless you added texture to the each side of the cube

Edit: Small question, is it possible to change a texture while the window is runing??

Func _My_CreateCube( $ObjId, $OrX, $OrY, $OrZ, $DeX, $DeY, $DeZ ,$Red, $Green, $Blue, $Alpha)   
    Local $V1[3] = [ $OrX, $OrY, $OrZ ]
    Local $V2[3] = [ $DeX, $OrY, $OrZ ]
    Local $V3[3] = [ $OrX, $DeY, $OrZ ]
    Local $V4[3] = [ $DeX, $DeY, $OrZ ]
    Local $V5[3] = [ $OrX, $OrY, $DeZ ]
    Local $V6[3] = [ $DeX, $OrY, $DeZ ]
    Local $V7[3] = [ $OrX, $DeY, $DeZ ]
    Local $V8[3] = [ $DeX, $DeY, $DeZ ]
    Local $QuadIndex[6]
    
    Local $Normal[3] = [ 0, 0,-1 ]
    Local $QuadIndex
    $QuadIndex[0] = _AddQuadEx( $ObjId, $V1, $V2, $V4, $V3, $Normal, $Red, $Green, $Blue, $Alpha )

    Local $Normal[3] = [ 1, 0, 0 ]
    $QuadIndex[1] = _AddQuadEx( $ObjId, $V8, $V4, $V2, $V6, $Normal, $Red, $Green, $Blue, $Alpha )

    Local $Normal[3] = [ 0, 0, 1 ]
    $QuadIndex[2] = _AddQuadEx( $ObjId, $V7, $V8, $V6, $V5, $Normal, $Red, $Green, $Blue, $Alpha )

    Local $Normal[3] = [-1, 0, 0 ]
    $QuadIndex[3] = _AddQuadEx( $ObjId, $V3, $V7, $V5, $V1, $Normal, $Red, $Green, $Blue, $Alpha )
    
    Local $Normal[3] = [ 0, 1, 0 ]
    $QuadIndex[4] = _AddQuadEx( $ObjId, $V1, $V5, $V6, $V2, $Normal, $Red, $Green, $Blue, $Alpha )

    Local $Normal[3] = [ 0,-1, 0 ]
    $QuadIndex[5] = _AddQuadEx( $ObjId, $V7, $V3, $V4, $V8, $Normal, $Red, $Green, $Blue, $Alpha )
    
    Return $QuadIndex
EndFuncoÝ÷ ØLZ^º&jz%uêïz»"¢ziÊ&¦,ÿmêòX¤{w]zÉ-¢¦Âäx(ØZ¶Ì!Ê)ÞyÙ'£hÂÚ©àzØ^µìmº·¨}«!jºÚ"µÍÚ[ÛYH  ][ÝÑÛYÚ[][Ë]][ÝÂÚ[ÛYH   ÓZØË]LÉÝÂ]]Ò]Ù]Ü[Û    ][ÝÕ^RXÛÛYI][ÝËH
BÜ
    ][ÝÕÚ[]SX]Ú[ÙI][ÝËÈ
BÝÙ^]
    ][ÝÞÑTÐßI][ÝË    ][Ý×Ñ^]  ][ÝÊBÙY[[ÈÚ[ÝÂÌÍÕÚ[]HH   ][ÝÊ^JÝ
ØÙ[J][ÝÂY[QÛÚ[ÝÊÚÝÜÚYÌÚÝÜZYÚÌ ÌÍÕÚ[]KJBÜÙ][ÈXÚÈÛÛÜÙ]ÛXÛÛÜKKK
BØÜX][ÈYÚÜX]SYÚ
ÌÌÌ
BÙ][XY[]YÚYÙJËËÈ
BÙ]YÚÜXÝ[KKK
B^]YH
B^PY
    ][ÝÑÚÝÜI][ÝËYÔXY
    ÌÎNÒÐÕIÌLÐÛÛÛ[[   ÌLÑÚÝÜ ÌÎNË ÌÎNÕØ[ÌÎNÊJB^][ÙJ
BØÜX][È[ØXÝÌÍÓØXÝHHØXÝÜX]J
BØÜX][ÈHÚH[ØXÝÉÌÍÐÝXHHYÝXJ  ÌÍÓØXÝKÚÝÜZYÚÐÚÝÜÚY
KKKKJBÌÍÐÝXHHÓ^WÐÜX]PÝXJ    ÌÍÓØXÝKKJÚÝÜZYÚÐÚÝÜÚY
KKLKLJÚÝÜZYÚÐÚÝÜÚY
KLHKK
BÜÝ][ÈHÚH
ÝHØXÝ
BÚTÝ]J    ÌÍÓØXÝK    ÌÍÐÝXKN
BÜÙ][ÈHØ[YBÙ]Ø[YJËL
BÜÙ][ÈÈ[HØXÝÜ    ÌÍÞHHÈ
U^P[
    ÌÍÓØXÝK    ÌÍÐÝXVÉÌÍÞLWK   ][ÝÑÚÝÜI][ÝÊB^Ù][
    ÌÍÓØXÝH
BÌÍØ[ÛHHÐÚ[ÙHÈÈXZÙHHÝXH][ÝHØÜY[ÈÛÛH]È^HØÜY[MÌLÚ]LÌÍÔ[WÖÛÛHHLBÌÍÔÙX×ÖÛÛHHÂÚ[HBNÙ]Ú[ÂTØÙ[Q]Ê
BBRYÒÔÜÙY
LJH[ÒÔÜÙY
LH[BNÕÚ[Ù]Ý]J   ÌÍÕÚ[]K ][ÝÉ][ÝËÕ×ÔÒÕÊBBTÛY
L
BBQÜ   ÌÍÞH ÌÍÔ[WÖÛÛHÈ   ÌÍÔÙX×ÖÛÛHÝ
BBBUØ[YJ   ÌÍØ[ÛK  ÌÍÞ
BBBTØÙ[Q]Ê
BBBTÛY
JBBS^BUØ[YJ    ÌÍØ[ÛK  ÌÍÞ
BBUÚ[HÒÔÜÙY
LJH[ÒÔÜÙY
LBBBRYÒÔÜÙY
JH[BBBIÌÍØ[ÛHHÔÝ]QÚÝÜ
    ÌÍØ[ÛJBBBBUØ[YJ    ÌÍØ[ÛK  ÌÍÔÙX×ÖÛÛJBBBQ[ÙRYÒÔÜÙY
ÊH[BBBIÌÍØ[ÛHHÔÝ]QÚÝÜ
K   ÌÍØ[ÛJBBBBUØ[YJ    ÌÍØ[ÛK  ÌÍÔÙX×ÖÛÛJBBBQ[YBBTØÙ[Q]Ê
BBBRY   ÌÍØ[ÛH  ÝÈÍ[ ÌÍØ[ÛHH
Ê  ÌÍØ[ÛKLÍ
BBBRY   ÌÍØ[ÛH  È[ ÌÍØ[ÛHHÍ
ÉÌÍØ[ÛBBUÑ[BQÜ   ÌÍÞH ÌÍÔÙX×ÖÛÛHÈ    ÌÍÔ[WÖÛÛHÝL
BBBUØ[YJ   ÌÍØ[ÛK  ÌÍÞ
BBBTØÙ[Q]Ê
BBBTÛY
JBBS^BUØ[YJ    ÌÍØ[ÛK  ÌÍÞ
BBTØÙ[Q]Ê
BBTÛY
L
BBNÕÚ[Ù]Ý]J ÌÍÕÚ[]K ][ÝÉ][ÝËÕ×ÒQJBQ[YTÛY
JBÙ[[ÈÔÝ]QÚÝÜ
    ÌÍÔ×Ñ  ÌÍÐÝÐ[ÛJBRY   ÌÍÔ×ÑH[BQÜ    ÌÍÞH ÌÍÐÝÐ[ÛHÈ    ÌÍÐÝÐ[ÛJÎHÝKÊKÌBBBUØ[YJ  ÌÍÞ  ÌÍÔÙX×ÖÛÛJBBBTØÙ[Q]Ê
BBBTÛY
JBBS^BTØÙ[Q]Ê
BQ[ÙRY ÌÍÔ×ÑHH[BQÜ   ÌÍÞH ÌÍÐÝÐ[ÛHÈ    ÌÍÐÝÐ[ÛKNHÝNKÊKÌBBBUØ[YJ  ÌÍÞÊBBBTØÙ[Q]Ê
BBBTÛY
JBBS^BTØÙ[Q]Ê
BQ[YIÌÍÐÝÐ[ÛHH    ÌÍÞT]    ÌÍÐÝØ[ÛB[[Â[ÈØ[YJ  ÌÍÔ×Ð[ÛK  ÌÍÔ×ÖÛÛJBSØØ[  ÌÍÐ^VÌBRY   ÌÍÔ×Ð[ÛH  ÝÈÍ[ ÌÍÔ×Ð[ÛHH
Ê  ÌÍÔ×Ð[ÛKLÍ
BRY ÌÍÔ×Ð[ÛH  È[ ÌÍÔ×Ð[ÛHHÍ
ÉÌÍÔ×Ð[ÛBIÌÍÜH    ÌÍÔ[WÖÛÛJÊ   ÌÍÔ×ÖÛÛKIÌÍÔ[WÖÛÛJBIÌÍÜHHËMMNLLÍNMÎBIÌÍÒ[×Ð[ÛHH    ÌÍÔ×Ð[ÛB  ÌÍÔ×Ø[ÛHH
    ÌÍÜJÌÍ
JÌÍÔ×Ø[ÛB ÌÍÓ]×ÜÜÞH
È  ÌÍÜ
ÛÜÊ  ÌÍÔ×Ø[ÛJB ÌÍÓ]×ÔÜÞH
È  ÌÍÜ
Ú[ ÌÍÔ×Ø[ÛJB ÌÍÓ]×ÔÜÞÔYH
ÈL
ÛÜÊ  ÌÍÔ×Ø[ÛJB ÌÍÓ]×ÔÜÞÔYH
ÈL
Ú[ ÌÍÔ×Ø[ÛJBÙ]Ø[YJ ÌÍÓ]×ÜÜÞ ÌÍÓ]×ÔÜÞ
B   ÌÍÐ^VÌHH    ÌÍÓ]×ÜÜÞ ÌÍÐ^VÌWHH   ÌÍÓ]×ÔÜÞ]    ÌÍÐ^B[[Â[ÈÓ^WÐÜX]PÝXJ  ÌÍÓØY   ÌÍÓÜ    ÌÍÓÜK   ÌÍÓÜ    ÌÍÑV ÌÍÑVK    ÌÍÑV ÌÍÔY ÌÍÑÜY[  ÌÍÐYK    ÌÍÐ[JBBSØØ[    ÌÍÕVÌ×HHÈ ÌÍÓÜ    ÌÍÓÜK   ÌÍÓÜBSØØ[ ÌÍÕÌ×HHÈ  ÌÍÑV ÌÍÓÜK   ÌÍÓÜBSØØ[ ÌÍÕÖÌ×HHÈ    ÌÍÓÜ    ÌÍÑVK    ÌÍÓÜBSØØ[ ÌÍÕÌ×HHÈ  ÌÍÑV ÌÍÑVK    ÌÍÓÜBSØØ[ ÌÍÕVÌ×HHÈ ÌÍÓÜ    ÌÍÓÜK   ÌÍÑVBSØØ[  ÌÍÕÌ×HHÈ  ÌÍÑV ÌÍÓÜK   ÌÍÑVBSØØ[  ÌÍÕÖÌ×HHÈ    ÌÍÓÜ    ÌÍÑVK    ÌÍÑVBSØØ[  ÌÍÕÌ×HHÈ  ÌÍÑV ÌÍÑVK    ÌÍÑVBSØØ[  ÌÍÔ]XY[^ÍBBSØØ[   ÌÍÓÜX[Ì×HHÈLHBSØØ[ ÌÍÔ]XY[^IÌÍÔ]XY[^ÌHHÐY]XY^
    ÌÍÓØY   ÌÍÕK ÌÍÕ  ÌÍÕ  ÌÍÕË    ÌÍÓÜX[  ÌÍÔY ÌÍÑÜY[  ÌÍÐYK    ÌÍÐ[H
BSØØ[ ÌÍÓÜX[Ì×HHÈKBIÌÍÔ]XY[^ÌWHHÐY]XY^
    ÌÍÓØY   ÌÍÕ  ÌÍÕ  ÌÍÕ  ÌÍÕ  ÌÍÓÜX[  ÌÍÔY ÌÍÑÜY[  ÌÍÐYK    ÌÍÐ[H
BSØØ[ ÌÍÓÜX[Ì×HHÈHBIÌÍÔ]XY[^ÌHHÐY]XY^
    ÌÍÓØY   ÌÍÕË    ÌÍÕ  ÌÍÕ  ÌÍÕK ÌÍÓÜX[  ÌÍÔY ÌÍÑÜY[  ÌÍÐYK    ÌÍÐ[H
BSØØ[ ÌÍÓÜX[Ì×HHËLKBIÌÍÔ]XY[^Ì×HHÐY]XY^
    ÌÍÓØY   ÌÍÕË    ÌÍÕË    ÌÍÕK ÌÍÕK ÌÍÓÜX[  ÌÍÔY ÌÍÑÜY[  ÌÍÐYK    ÌÍÐ[H
BBSØØ[    ÌÍÓÜX[Ì×HHÈKBIÌÍÔ]XY[^ÍHHÐY]XY^
    ÌÍÓØY   ÌÍÕK ÌÍÕK ÌÍÕ  ÌÍÕ  ÌÍÓÜX[  ÌÍÔY ÌÍÑÜY[  ÌÍÐYK    ÌÍÐ[H
BSØØ[ ÌÍÓÜX[Ì×HHÈLKBIÌÍÔ]XY[^ÍWHHÐY]XY^
    ÌÍÓØY   ÌÍÕË    ÌÍÕË    ÌÍÕ  ÌÍÕ  ÌÍÓÜX[  ÌÍÔY ÌÍÑÜY[  ÌÍÐYK    ÌÍÐ[H
BBT]    ÌÍÔ]XY[^[[Â[ÈÑ^]

BQ^][[
Edited by Alek

[font="Impact"]Never fear, I is here.[/font]

Link to comment
Share on other sites

Yes, you can change shape texture while running the window, just set the texture again in same shape. :)

I'll test your scripts in monday, cause I'm using today the computer fo my fiance.

... and if you want, can I put it in next version?

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

@Alek - Very usefull your function. I tried your example :)

Very good!

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

  • 3 weeks later...

Update.

DefineGlWindow improved.

And CreateCubeEx by Alek added

Edited 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

Hi,

First I must thank you for creating such an awesome plug in.

However, I have problem running the examples that involves ntdll.dll which generates a crash message when ever an example with "Texture" is started. SciTe would start compiling it and fails to start with a windows error message. I have a dedicated card as shown below which show definitely support OpenGL, I am unsure why this is happening and search of the forum does not reveal the proper solution to my problem. Therefore, I have posted here for help. Thank you for any replies.

Here's some basic sepc:

Vista 32 bit Home Basic

8600m GT

C2D 1.6

Edited by JohnWang
Link to comment
Share on other sites

Hi,

First I must thank you for creating such an awesome plug in.

However, I have problem running the examples that involves ntdll.dll which generates a crash message when ever an example with "Texture" is started. SciTe would start compiling it and fails to start with a windows error message. I have a dedicated card as shown below which show definitely support OpenGL, I am unsure why this is happening and search of the forum does not reveal the proper solution to my problem. Therefore, I have posted here for help. Thank you for any replies.

Here's some basic sepc:

Vista 32 bit Home Basic

8600m GT

C2D 1.6

Thank you!

I didn't test on Windows Vista, but mrbond007 told me about the same problem:

@A. Percy

Great example dude <_<

after posting a file to the download page you need to wait for Jon's approval. If Jon accepts the file it will be available for the rest of us, but it's better not to include exe files, you can put all your uncompiled scripts, examples and the dll files in one zip file and than upload it to the download page.

the reason that T2 and the examples doesn't work on Vista is because the Texture functions returns error "1 - unable to use the dll file". maybe if you try calling the api straight from the gl files ??. Anyway temporary disabling the texture funtions in the ItCopter works sometimes .

Cheers

Baki

So, I need Windows Vista to work on some solutions for this problem. I need some time :)

Thank you for your help.

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

Some people asked for embeding the plugin window into a GUI from autoit. Today I found a nice example about embeding a window, by SmOke_N.

Is it possible to embed Windows Explorer?

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

Using SmOke_N embeded window solution:

#include <GUIConstants.au3>
#include "GlPluginUtils.au3"

Opt( "GUIOnEventMode", 1 )

$hGUI = GUICreate( "Au3GlPlugin in a AutoIt GUI", 520, 400, -1, -1, BitOr( $WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_CLIPCHILDREN ) )
$Label = GUICtrlCreateLabel ( "Rotation: ", 20, 20, 80  )

$Exp1 = _EmbedGl( $hGUI, 400, 300, 100, 20 )
GUISetState( @SW_SHOW, $hGUI )

SetClearColor( 0.2, 0.2, 0.2 )
CreateLight( 0, 300, 300, 300 )
SetLightAmbient( 0, 0.2, 0.2, 0.2 )
SetLightDiffuse( 0, 0.7, 0.7, 0.7 )
SetLightSpecular( 0, 1.0, 1.0, 1.0 )

$CubeObj = ObjectCreate( )
$Box = AddCube( $CubeObj, 70, 70, 70, 1.0, 0.2, 0.2, 1.0 )
SetPrint( $CubeObj )

SetCamera( 0, 60, 250, 0, 0, 0 )
GUISetOnEvent( $GUI_EVENT_CLOSE, "ExitProgram" )


$Y_Axis = 0
While 1
    SceneDraw( )
    sleep( 10 )
    
    ;Rotate box
    ObjectRotate( $CubeObj, $Y_Axis, $Y_Axis, 0 )
    GUICtrlSetData( $Label, "Rotation: " & $Y_Axis )
    
    $Y_Axis += 1.5
    If $Y_Axis < 0 Then $Y_Axis += 360
    If $Y_Axis > 360 Then $Y_Axis -= 360
WEnd

Func ExitProgram( )
    WinClose($Exp1)
EndFunc

;adapted from example from SmOke_N
Func _EmbedGl( $hGUI, $nWidth, $nHeight, $nLeftGUI, $nTopGUI )
    Local $EmbededWin = GUICreate( "Au3GlWindowPnl", $nWidth, $nHeight, $nLeftGUI, $nTopGUI, $WS_CHILD, -1, $hGUI  ) ;BitOr( $WS_CLIPCHILDREN, $WS_CHILD ),
    Local $WindowName = "Au3GlPluginWindow"
    Local $WinTitle = "[CLASS:GLUT;TITLE:" & $WindowName & "]"
    DefineGlWindow( $WindowName )
    WinWait( $WinTitle )
    Local $RetVal = 0
    $RetVal = _WinEmbedToGUI( WinGetHandle( $WinTitle ), $EmbededWin, 0, 0, $nWidth, $nHeight, 0x96000000, $WS_EX_RIGHT )
    GUISetState( @SW_SHOW, $EmbededWin )
    Return $RetVal
EndFunc

;by SmOke_N
Func _WinEmbedToGUI($hWnd, $hGUI, $nLeftGUI, $nTopGUI, $nRightGUI, $nBottomGUI, $nStyle = -2, $nExStyle = -2)
    Local $nExStyleEx = DllCall("user32.dll", "int", "GetWindowLong", "hwnd", $hWnd, "int", -20)
    If IsArray($nExStyleEx) = 0 Then Return SetError(1, 0, 0)
    DllCall( "user32.dll", "int", "SetWindowLong", "hwnd", $hWnd, "int", -20, "int", BitOr($nExStyleEx[0], 0x00000040 ) );WS_EX_MDICHILD
    DllCall( "user32.dll", "int", "SetParent", "hwnd", $hWnd, "hwnd", $hGUI )
    WinSetState( $hWnd, '', @SW_SHOW )
    WinMove($hWnd, "", $nLeftGUI, $nTopGUI, $nRightGUI, $nBottomGUI )
    If $nStyle = -2 And $nExStyle = -2 Then Return $hWnd
    Local $GWL_STYLE = -16, $GWL_EXSTYLE = -20
    Local $SWP_NOMOVE = 0x2, $SWP_NOSIZE = 0x1
    Local $SWP_SHOWWINDOW = 0x40, $SWP_NOZORDER = 0x4
    Local $iFlags = BitOR($SWP_SHOWWINDOW, $SWP_NOSIZE, $SWP_NOMOVE, $SWP_NOZORDER)
    If $nStyle = -2 Then $nStyle = $WS_MINIMIZEBOX + $WS_CAPTION + $WS_POPUP + $WS_SYSMENU
    If $nExStyle = -2 Then $nExStyle = $nExStyleEx[0]
    DllCall("User32.dll", "int", "SetWindowLong", "hwnd", $hWnd, "int", $GWL_STYLE, "int", $nStyle)
    DllCall("User32.dll", "int", "SetWindowLong", "hwnd", $hWnd, "int", $GWL_EXSTYLE, "int", $nExStyle)
    DllCall("User32.dll", "int", "SetWindowPos", "hwnd", $hWnd, "hwnd", 0, "int", 0, "int", 0, _
            "int", 0, "int", 0, "int", $iFlags)
    Return $hWnd
EndFunc

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

Update released today.

May be frustrating for Windows Vista users, but I didn't fixed the Vista problem yet. My fault. :">

For other users, I added EmbedGlWindow funcionality. Now it's possible to add the gl window to your own form.

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

  • 2 months later...

Hi

If you have problems with texture mode, take a look here.

Thanks to danwilli :D

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

Yes, you can change shape texture while running the window, just set the texture again in same shape. :D

I'll test your scripts in monday, cause I'm using today the computer fo my fiance.

... and if you want, can I put it in next version?

Hi,

I have tried the above using, Texture Add, and Texture Bind, and the use of Capture Screen function to update the screen. It works and the screenshot refreshes and update the cube I was using. However, every time the function TextureAdd is called it use up a small amount of ram (probably because the cube was small. Also I have exclude the possibility that the Screenshot/Screenshot function was using the RAM by Isolating it), and with a while loop set to update the texture can result in gigs of RAM used up in matter of couple of minutes. So, is it possible to by pass this by removing the texture from the RAM once it is used presently? If not, do you plan to write a function in the near future for such function?

Thank you in advance, this plugin is awesome, and I really appreciate you spending your personal time maintaining it.

Edited by JohnWang
Link to comment
Share on other sites

Hi,

I have tried the above using, Texture Add, and Texture Bind, and the use of Capture Screen function to update the screen. It works and the screenshot refreshes and update the cube I was using. However, every time the function TextureAdd is called it use up a small amount of ram (probably because the cube was small. Also I have exclude the possibility that the Screenshot/Screenshot function was using the RAM by Isolating it), and with a while loop set to update the texture can result in gigs of RAM used up in matter of couple of minutes. So, is it possible to by pass this by removing the texture from the RAM once it is used presently? If not, do you plan to write a function in the near future for such function?

Thank you in advance, this plugin is awesome, and I really appreciate you spending your personal time maintaining it.

Thank you!

It's a good idea. I'll do something about it.

In next month I'll buy a new computer and finaly I'll can give more attention to my projects, including the plugin.

Thank you again!

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

Error:

C:\Programming\AutoIt\Au3GL\examples\TestWorld-by_zerozshadow.au3 (21) : ==> Unknown function name.: 
DefineGlWindow( $WinTitle ) 
^ ERROR
You need glut32.dll and au3glplugin.dll on your machine.

Edit: and glaux.dll

Edited 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

What is the base unit for shapes, pixel? For example, I used AddCube and I want it to fit the screen perfectly, but a 240 in the width parameter will exceed the 1280 x 800 res of my screen.

Thank you.

1:1

You need put your camera in a minimum distance from your object, in your case, the size of object from it's face.

Remember that camera factor changes according your window size

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

  • 1 month later...

Updated.

Fixed object deletion.

Fixed texture examples (thanks to danwilli).

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...