Jump to content

Au3IrrLicht


A. Percy
 Share

Recommended Posts

Just to inform the fans ( :evil: ), the project is not dead, just hibernated for a short time while I fix some personal pendencies.

I hope the project is not dead ! ;) is a too wonderfull project to be dead (thank's Percy)

I have made a script who handle cover from my Huge Mp3 collection with a same (?) feeling of iphone. so called 'Flow'

it work very well and very smoothly but some function (especially remove() ) drive me crazy (if Mr. Percy can take contact with me it will be great :evil: )

you can see 2 screenshots and if you need a screen recorded video just ask me (because a can't upload it)

When the project is finished i realease the sources of course.

Any suggestion are welcome

Sorry for my poor english.

Merry Christmas.

post-10931-12609732508694_thumb.jpg

post-10931-12609732624855_thumb.jpg

Link to comment
Share on other sites

  • Replies 231
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Me and a group of friends were going to attempt a more advanced game with this, but found it lacking in some areas. Since development is temporarily stalled, I was wondering if you might let me have a copy of the source code for Au3Irrlicht.dll so that I can expand it to meet our needs. I know C++, which I am assuming you used to write Au3Irrlicht.dll, and would give you any upgrades that I make.

Our plan for the game is something like a 3D version of

I understand if you do not want to let me have the source, but it would be very nice.

Thanks,

-Matt

_________[u]UDFs[/u]_________-Mouse UDF-Math UDF-Misc Constants-Uninstaller Shell

Link to comment
Share on other sites

I absolutely could not get Remove() to work. I tried all kinds of different things and spent many days messing with my mesh's thinking the problem was there. But even when I used mesh's from the example, Remove() caused AutoIt to crash ;)

What I ended up doing was creating a switch

$toon=GetMesh(""&$install&"\data\Models\male.md2" )
    $node = AddMeshSceneNode($toon)
    SetMaterialTexture( $node, 0, GetTexture(""&$install&"\data\Models\DarthVader.pcx" ) )
    SetVisible( $node, 1 )
    $toon1=GetMesh(""&$install&"\data\Models\female.3ds" )
    $node1 = AddMeshSceneNode($toon1)
    SetMaterialTexture( $node1, 0, GetTexture(""&$install&"\data\Models\au3" ) )
    SetVisible( $node1, 0 )

then later in the code did this

$gender2=GUICtrlRead($gender1)
            If $gender2<>$gender Then
                If $gender2="Female" Then
                    SetVisible( $node, 0 )
                    SetVisible( $node1, 1 )
                    $gender=$gender2
                ElseIf $gender2="Male" Then
                    SetVisible( $node, 1 )
                    SetVisible( $node1, 0 )
                    $gender=$gender2
                EndIf
            EndIf

That works fine for this part of the script but later could cause big problems if I cannot completely delete character graphics from the game. (Imagine the strain on the RAM with all the invisible dead npc's :evil:

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Link to comment
Share on other sites

  • 2 weeks later...

I absolutely could not get Remove() to work. I tried all kinds of different things and spent many days messing with my mesh's thinking the problem was there. But even when I used mesh's from the example, Remove() caused AutoIt to crash ;)

What I ended up doing was creating a switch

$toon=GetMesh(""&$install&"\data\Models\male.md2" )
    $node = AddMeshSceneNode($toon)
    SetMaterialTexture( $node, 0, GetTexture(""&$install&"\data\Models\DarthVader.pcx" ) )
    SetVisible( $node, 1 )
    $toon1=GetMesh(""&$install&"\data\Models\female.3ds" )
    $node1 = AddMeshSceneNode($toon1)
    SetMaterialTexture( $node1, 0, GetTexture(""&$install&"\data\Models\au3" ) )
    SetVisible( $node1, 0 )

then later in the code did this

$gender2=GUICtrlRead($gender1)
            If $gender2<>$gender Then
                If $gender2="Female" Then
                    SetVisible( $node, 0 )
                    SetVisible( $node1, 1 )
                    $gender=$gender2
                ElseIf $gender2="Male" Then
                    SetVisible( $node, 1 )
                    SetVisible( $node1, 0 )
                    $gender=$gender2
                EndIf
            EndIf

That works fine for this part of the script but later could cause big problems if I cannot completely delete character graphics from the game. (Imagine the strain on the RAM with all the invisible dead npc's :evil:

Just wanted to update that this problem was cleared up for me.

A node must have a child node attached to it in order to Remove() (delete) it.

Edited by kaotkbliss

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Link to comment
Share on other sites

  • 2 weeks later...

Hello,

First, Happy new year 2010 !

This a new screenshot of my player (Beta 8) using au3Irrlicht and a lot of other stuffs like Bass udf (what a Wonderfull UDF !)

still now in a very beta state. but just to show how i use irrlicht. (i'm not a gamer you know ;) )

some buttons (like volume & Mix Value) is in irrlicht AddImage() function. If somebody nows how to make a

image disapear like SetVisible() for 3d object.

The custom 'gauge' was also made with AddImage()function.

The visualisation (spectrum) is maded with 16 Billboards and change in real time during the music. largely inspired by monoceres visualisation

for bass UDF. (thank's to him)

Play,Stop,Pause buttons are pure Autoit Buttons.

i'm still have a problem to put some background on Listview

Picea give me a function to do that but i'm still have garbage when i change selection. so if anybody have idea to fix that

the interface will be much better.

I use also GDI+ but just for the track infos generation (album/title etc.) I have to use this trick's because fonts of Irrlicht

are so small for the moment... please Percy make something for this.

any suggestion are welcome.

Autoit is rock !

post-10931-12628777579509_thumb.jpg

Link to comment
Share on other sites

some buttons (like volume & Mix Value) is in irrlicht AddImage() function. If somebody nows how to make a

image disapear like SetVisible() for 3d object.

Why dont you use gui and gdi+ for volume & Mix Value?

I use also GDI+ but just for the track infos generation (album/title etc.) I have to use this trick's because fonts of Irrlicht

are so small for the moment... please Percy make something for this.

For fonts in screen i used BillboardSceneNode (black background on alpha chan with wight text)

_GDIPlus_Startup ()
$hImage1 = _GDIPlus_BitmapCreateFromFile ( "name_01.bmp" )
$hGraphics = _GDIPlus_ImageGetGraphicsContext ( $hImage1 )
$hBrush = _GDIPlus_BrushCreateSolid ( 0xFFF0F4F9 )
$hFormat = _GDIPlus_StringFormatCreate (  )
$hFamily = _GDIPlus_FontFamilyCreate ( "King Arthur Special" )
$hFont = _GDIPlus_FontCreate ( $hFamily , 11 , 1 )
$tLayout = _GDIPlus_RectFCreate ( 0 , 0 , 200 , 25 )
_GDIPlus_StringFormatSetAlign ( $hFormat , 1 )
_GDIPlus_GraphicsDrawStringEx ( $hGraphics , "<" & InputBox ( "Your Char Name" , "" , "TestChar" , " M8" ) & ">" , $hFont , $tLayout , $hFormat , $hBrush )
_GDIPlus_ImageSaveToFile ( $hImage1 , "name_02.bmp" )
_GDIPlus_ShutDown (  )
...
$Node32 = AddBillboardSceneNode ( $Node_001 , 64, 8 ) 
SetMaterialTexture ( $Node32 , 0 , GetTexture ( "name_02.bmp" )  ) 
SetMaterialType ( $Node32 , $EMT_TRANSPARENT_ADD_COLOR ) 
SetMaterialFlag ( $Node32 , $EMF_LIGHTING , 0 )

Do you use some other trick (and if you use other pls share it with everyone if you can) or its the same (or similar) one to what i use?

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

Why dont you use gui and gdi+ for volume & Mix Value?

For fonts in screen i used BillboardSceneNode (black background on alpha chan with wight text)

_GDIPlus_Startup ()
$hImage1 = _GDIPlus_BitmapCreateFromFile ( "name_01.bmp" )
$hGraphics = _GDIPlus_ImageGetGraphicsContext ( $hImage1 )
$hBrush = _GDIPlus_BrushCreateSolid ( 0xFFF0F4F9 )
$hFormat = _GDIPlus_StringFormatCreate (  )
$hFamily = _GDIPlus_FontFamilyCreate ( "King Arthur Special" )
$hFont = _GDIPlus_FontCreate ( $hFamily , 11 , 1 )
$tLayout = _GDIPlus_RectFCreate ( 0 , 0 , 200 , 25 )
_GDIPlus_StringFormatSetAlign ( $hFormat , 1 )
_GDIPlus_GraphicsDrawStringEx ( $hGraphics , "<" & InputBox ( "Your Char Name" , "" , "TestChar" , " M8" ) & ">" , $hFont , $tLayout , $hFormat , $hBrush )
_GDIPlus_ImageSaveToFile ( $hImage1 , "name_02.bmp" )
_GDIPlus_ShutDown (  )
...
$Node32 = AddBillboardSceneNode ( $Node_001 , 64, 8 ) 
SetMaterialTexture ( $Node32 , 0 , GetTexture ( "name_02.bmp" )  ) 
SetMaterialType ( $Node32 , $EMT_TRANSPARENT_ADD_COLOR ) 
SetMaterialFlag ( $Node32 , $EMF_LIGHTING , 0 )

Do you use some other trick (and if you use other pls share it with everyone if you can) or its the same (or similar) one to what i use?

Bok bogQ,

That's exactly the Trick ! of course i have made a function containing gdi+ command where i can pass some information from ID3TAG. then i save the genrerated image on HardDisk (to bad that we cant pass directly GDI+ pointer (in your exemple $himage) directly to SetMaterialTexture() function. Just to win a bit of time.

This approach have a big problem but easily skippable. the first SetmaterialTexture() will work fine but if you redo this command a second time

with other image but same filename the first image generated will always appear. so you have to generate always a new filename for picture. on my script is not so difficult. my first attempt was to save a image named TrkInfos.jpg (work only the first time) now i save albumName_TrackName.jpg (that work fine) of course after this i delete the last generated infos to not have finally 200 GB of useless Track Infos ;)

I must tell also that TrackInfos at screen is a Billboard object and not Image from addimage() function because billboard is hiddeable and not images... i dont know why but its like this (still waiting Percy for an update :evil: )

For the Volume Level and Mix Value these buttons are Static so it's better to create it only one time (i'm using Firework from adobe) but maybe for the percentage indicator... i will take a look.

Thank's for your reaction and if you have any other suggestion i take it !

Sorry for my bad english.

PS : Zivim u Hrvatskoj ali slabo pricam hrvatski zato sam Belgijanac. oprosti.

Edited by sheeva
Link to comment
Share on other sites

Using flat 2D nodes to display images is more intuitive, I would think, since it leaves them open to manipulation on the same terms as every other object the engine uses.

This approach have a big problem but easily skippable. the first SetmaterialTexture() will work fine but if you redo this command a second time

with other image but same filename the first image generated will always appear. so you have to generate always a new filename for picture. on my script is not so difficult. my first attempt was to save a image named TrkInfos.jpg (work only the first time) now i save albumName_TrackName.jpg (that work fine) of course after this i delete the last generated infos to not have finally 200 GB of useless Track Infos

$TrkInfos = GetTexture ( "TrkInfos.jpg" )
SetMaterialTexture($node, 0, $TrkInfos)

;SomeGDIFunction("TrkInfos.jpg")
;Change the image, then reload it using the top 2 lines. you have to both load the texture into memory and then SetMaterialTexture in order to change the image.

You need to explicitly load TrkInfos.jpg each time you have an updated image, rather than just using SetMaterialTexture, because you'll just have the original image still in memory.

I hope that wasn't confusing at all. ;)

Link to comment
Share on other sites

Using flat 2D nodes to display images is more intuitive, I would think, since it leaves them open to manipulation on the same terms as every other object the engine uses.

$TrkInfos = GetTexture ( "TrkInfos.jpg" )
SetMaterialTexture($node, 0, $TrkInfos)

;SomeGDIFunction("TrkInfos.jpg")
;Change the image, then reload it using the top 2 lines. you have to both load the texture into memory and then SetMaterialTexture in order to change the image.

You need to explicitly load TrkInfos.jpg each time you have an updated image, rather than just using SetMaterialTexture, because you'll just have the original image still in memory.

I hope that wasn't confusing at all. :evil:

Hi JRowe,

I will try that NOW ! ;) and i let you know.

with Flat 2D you mean Billoard or Image ? 'AddBilboardnode() or AddImage()'

Thank's.

Link to comment
Share on other sites

Billboard nodes, definitely. The AddImage functions are usable, but billboards are far superior. You can also create a normal mesh scene node from a flat mesh, which can be manipulated like any other normal node.

For fonts, use bitmap fonts and GDI for a GUI system. Irrlicht isn't necessarily going to give you better or easier GUI functions compared to writing your own with GDI. Bitmap fonts can be individual images for each character, or a single image with all characters on it, each of which is given a texture pointer, and arranged using AddImage or camera oriented meshes/billboards.

There are many methods of handling GUI interactions, none of which are native to Irrlicht (although, there are many GUI packages for it.) Most can be handled quite efficiently by autoit GDI+ manipulation. If you run into a particular task that needs handling, just post here. Most likely someone can point you to a thread or whip up a function for you right here.

Link to comment
Share on other sites

There are tools for creating Irrlicht-fonts ;) One example is http://www.gljakal.com/irrfontmaker/index.php

PS: I think, Irrlicht should have GUI-functions, since there are GUI functions in the docs

Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Too bad. this is not working. i have still try that before. (founded in my old source version) but noway.

$TrkInfos = GetTexture("TrkInfos.jpg") work but when i made a

SetMaterialTexture($FeedbackText, 0, $TrkInfos ) always same picture appears...

I have try with remove function... nothing so i have removed entire Billboardnode ($FeedbackText) and reconstruct each time i have to

display some new text... same problem. the image pointer seems to be static or something like that. if i made a consolewrite($TrkInfos) i'm still

have the same number.

Link to comment
Share on other sites

There are tools for creating Irrlicht-fonts :evil: One example is http://www.gljakal.com/irrfontmaker/index.php

PS: I think, Irrlicht should have GUI-functions, since there are GUI functions in the docs

Hi ProgAndy,

Thanks i have downloaded this software.

but the fonction to load fonts (generated by this program) is not already implemented. to bad.

I'm not strong enough to call this function directly in the irrlicht.dll ;) so i'm still waiting A.percy.

Anyway, thank's for the link.

Link to comment
Share on other sites

The irrlicht dll might have to be revised, given the limitations of the plugin architecture. It might be more effective to rewrite the dll with DllCall in mind. This is not to disparage A. Percy's work in any way, just that there are tasks that might be more easily handled using dllCalls.

Link to comment
Share on other sites

The irrlicht dll might have to be revised, given the limitations of the plugin architecture. It might be more effective to rewrite the dll with DllCall in mind. This is not to disparage A. Percy's work in any way, just that there are tasks that might be more easily handled using dllCalls.

If thing you have right JRowe, this can be more polyvalent. especially when dll is changing Version (like is the case now) so maybe a udf will be

more efficient. but i have to say, the work of A. Percy is great and amazingly stable.

Link to comment
Share on other sites

Returns a pointer to a texture.

Loads the texture from disk if it is not already loaded

drop() only work with create* on textures :/

Remove() dont have any efect on textures :/

so we will probably need this if im not wrong

virtual void irr::video::IVideoDriver::removeTexture ( ITexture * texture ) [pure virtual]

Removes a texture from the texture cache and deletes it.

This method can free a lot of memory! Please note that after calling this, the pointer to the ITexture may no longer be valid, if it was not grabbed before by other parts of the engine for storing it longer. So it is a good idea to set all materials which are using this texture to 0 or another texture first.

Parameters:

texture Texture to delete from the engine cache.

Edit:

JRowe do you have any example on calling irr dll on any function? If you do maby A.Percy can have easier time with his project using direct dllcall from autoit to irr dll instead of calling his dll.

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

The current scenario is this: irrlicht functions are called from a dll written as a plugin for AutoIt's plugin architecture. The plugin architecture doesn't handle AutoIt variants, it explicitly passes strings and ints and so on. Arrays can't be passed back and forth between a script and the c++ code without some non-trivial coding added on to do that. Arrays are necessary if you want to efficiently manage things like collision detection, morph animations(although there is a workaround) and various other basic operations.

The DllCall scenario I mentioned would involve using a dll written to expose functions and writing script functions to manage those dll calls. It is trivial to pass arbitrary data to external functions using DllCall, so arrays are as easy as passing a variable name. This makes the au3 side of things a bit more complex, but it simplifies the requirements of the c++ dll, and skips over any of the plugin limitations. This would enable us to use physics engines, gui systems, and other packages without having to muck about with c++ functionality.

I'll see if the irrlicht dll can be easily compiled to expose all of the api, but I'm not sure how or even if that's possible at this point.

Link to comment
Share on other sites

Hey Percy! Notepad here and I wanted to have a more detailed look on how to add textures to models (I'm very good at making textures)! If that is possible if you cannot respond then I understand and I hope somebody else will answer for me if it's not possible for you to. :D

Hi.

Link to comment
Share on other sites

  • 1 month later...

A.Percy emailed me the source code with permission to distribute. Here's the source, with the VS projects and so on. You'll need the irrlicht 1.4.2 SDK in order to compile it. At some point, it would be great to get this up on google code or some sort of version control system.

This project is being released under the MIT license. Thank you A.Percy!

The MIT License

Copyright © 2010 Alexsandro Percy (aka: A.Percy)

Permission is hereby granted, free of charge, to any person obtaining a copy

of this software and associated documentation files (the "Software"), to deal

in the Software without restriction, including without limitation the rights

to use, copy, modify, merge, publish, distribute, sublicense, and/or sell

copies of the Software, and to permit persons to whom the Software is

furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in

all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE

AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER

LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,

OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN

THE SOFTWARE.

http://www.AutoIt.me/au3IrrlichtSource.zip

Edited by JRowe
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...