Jump to content

OpenGL


DW1
 Share

Recommended Posts

So... I wish I had a more technical explanation of the issues I am encountering... here it goes:

I downloaded the OpenGL T2 files, ran the texture example, and everything was fine. I tried to use my own texture, and now I don't see the texture. I went back to the texture example (unchanged) and ran to notice that now, it did not have the texture applied either. Now every time I try to bind a texture, it just doesn't appear for me.

I did not have this problem with the pre T2 version. But I experienced the above issue on my home PC, and then today I tried at work, and the same odd results happened.

I have probably done something wrong here, but I cannot figure out what.

Link to comment
Share on other sites

Hi

To use textures, you need follow some steps:

1 - Set the texture buffer: how many textures are you planning to use?

TextureSetBuffer( 1 )

2 - Add your texture

TextureAdd( "My_Texture", @ScriptDir & "\MyTex.bmp" )

3 - Tell to plugin use texture mode

TextureSetMode( 1 )

4 - Apply your texture.

$RetVal = ObjectCreate( )

$Sphere= AddSphere( $RetVal, 1, 1, 0, 1, 20, 9, $Red, $Green, $Blue, 1 )

TextureBind( $RetVal, $Sphere, ""My_Texture"" )

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

The demo below, ran for me once with a texture. Now I cannot see the texture at all.....

#include "GlPluginUtils.au3"

FileInstall( "data\au3.bmp", "data\au3.bmp" )

;hide icon!!!!!!
AutoItSetOption( "TrayIconHide", 1 )
HotKeySet( "{ESC}", "End" )

$Title = "Au3GlPlugin - Testing Texture Mode"
If MsgBox( 36, "Screen", "Run this demo in fullscreen mode?" ) = 6 Then
    DefineGlWindow( $Title )
Else
    DefineGlWindow( $Title, 400, 300 )
EndIf
SetClearColor( 0.0, 0.0, 0.0 )

TextureSetBuffer( 1 )
TextureAdd( "Au3", @ScriptDir & "\data\au3.bmp" )
TextureSetMode( 1 )

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 )

CreateLight( 1, -300, 300, 300 )
SetLightAmbient( 1, 0.2, 0.2, 0.2 )
SetLightDiffuse( 1, 0.7, 0.7, 0.7 )
SetLightSpecular( 1, 1.0, 1.0, 1.0 )

$CubeObj = ObjectCreate( )
$Box = AddCube( $CubeObj, 70, 70, 70, 1.0, 1.0, 1.0, 1.0 )
TextureBind( $CubeObj, $Box, "Au3" )
SetPrint( $CubeObj )

SetCamera( 0, 60, 250, 0, 0, 0 )

Opt( "WinTitleMatchMode", 3 )
WinWait( $Title )
$CheckWindowTimer = TimerInit( )
$Y_Axis = 0
While 1
    SceneDraw( )
    sleep( 10 )
    
    ;Rotate box
    ObjectRotate( $CubeObj, $Y_Axis, $Y_Axis, 0 )
    
    $Y_Axis += 1.5
    If $Y_Axis < 0 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 ) > 1000 Then
        If WinExists( $Title ) = 0 Then ExitLoop
        $CheckWindowTimer = TimerInit( )
    EndIf
Wend

I will be rebooting my machine right now, and I will be right back to see if that fixes the issue or not.

Link to comment
Share on other sites

remove that FileInstall...

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

And the more simple example I made:

#include "GlPluginUtils.au3"

TextureSetBuffer( 1 )
TextureAdd( "Muttley", @ScriptDir & "\Muttley.bmp" ) ;download any Muttley image and put in same path of script
TextureSetMode( 1 )

;defining window
$WinTitle = "Muttley"
DefineGlWindow( $WinTitle, 500, 500 )
SetCameraView( 1.0, 5000 )

;setting back color
SetClearColor( 0.8, 0.8, 0.8 )

;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, 0.1, 0.1, 0.1 )

SetCamera( 0, 0, 30, 0, 0, 0 )

$MyObj = ObjectCreate( )

$Sphere = AddSphere( $MyObj, 1, 1, 0, 2, 20, 9, 1, 1, 1, 1 )
ShapeRotate( $MyObj, $Sphere, 0, 0, 5 )
TextureBind( $MyObj, $Sphere, "Muttley" )

SetPrint( $MyObj )

While 1
    SceneDraw( )
    Sleep( 100 )
Wend

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

I just get a white sphere... no picture(texture) on it :D

I put muttley.bmp in the script directory.

I have seen the texturing work ONCE per machine that I have installed this to.

Very strange... I'll test it in my house later with the last version of autoit.

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

I GOT IT!!! I GOT IT!!! I GOT IT!!!

I am sorry for wasting so much time with this.... I also think I will go bald a year sooner :D

The examples are not written correctly

You now MUST declare all of the Texture info BEFORE calling the window :P

So this:

$Title = "Au3GlPlugin - Testing Texture Mode"
If MsgBox( 36, "Screen", "Run this demo in fullscreen mode?" ) = 6 Then
    DefineGlWindow( $Title )
Else
    DefineGlWindow( $Title, 400, 300 )
EndIf
SetClearColor( 0.0, 0.0, 0.0 )

TextureSetBuffer( 2 )
TextureAdd( "Au3", @ScriptDir & "\data\au3.BMP" )
TextureSetMode( )oÝ÷ Ù(hºW[yÈZ¶aÆ®¶­seFWGW&U6WD'VffW""¥FWGW&TFBgV÷C´S2gV÷C²Â67&DF"fײgV÷C²b3#¶FFb3#¶S2ä$ÕgV÷C²¥FWGW&U6WDÖöFR ¢b33cµFFÆRÒgV÷C´S4vÅÇVvâÒFW7FærFWGW&RÖöFRgV÷C°¤b×6t&÷3bÂgV÷Cµ67&VVâgV÷C²ÂgV÷Cµ'VâF2FVÖòâgVÆÇ67&VVâÖöFSògV÷C²ÒbFVà FVfæTvÅvæF÷rb33cµFFÆR¤VÇ6P FVfæTvÅvæF÷rb33cµFFÆRÂCÂ3¤VæD`¥6WD6ÆV$6öÆ÷"ãÂãÂã

Thank you so much for supporting this plugin, I personally appreciate it very much, THANK YOU!

Danny W

Link to comment
Share on other sites

Thank you!!!! :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

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...