Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Au3Irrlicht 2.0


  • Please log in to reply
427 replies to this topic

#21 sheeva

sheeva

    Seeker

  • Active Members
  • 39 posts

Posted 07 May 2010 - 01:39 PM

Dlls are 32bit. That means you have to run 32bit AutoIt when using them.


edit:
It's not very nice to delete posts the way you did. Then I have to do what I did now.


Sorry for that trancexx,
i have not view your answer and i have find where the problem. now it work.

I have another problem now...

I have to use GUI function but the parameter $i_ID is not very clear.
for example

_IrrAddListBox($i_Horizontal, $i_TopX, $i_TopY, $i_BottomX, $i_BottomY, $i_ID, $i_Background, $h_Parent)

i know i have to put some id for my control like "MY_LIST_BOX" but how ?

if i put that with quotes like this "MY_LIST_BOX" autoit crash. if i put a variable AutoIT doesn't crash but nothing append.

So how can i use this parameter.

Thank's







#22 JRowe

JRowe

    Chasing the white rabbits

  • Active Members
  • PipPipPipPipPipPip
  • 1,764 posts

Posted 07 May 2010 - 02:08 PM

Check out the reference.htm page in the document folder. I'll put docs online this weekend.

id specifies a unique numerical reference for the listbox so events can be identified as coming from this object

The variables you see are done per the AutoIt UDF standard. $i_ prefacing a variable means that it's an integer. $s_ means a string. $h_ means a handle (or pointer in this case.)

_IrrAddListBox(100, 10, 10, 60, 60, [u][b]42[/b][/u], 0, 0)

Something like that would set the ID of the object as 42. The ID would be used to detect events.

Try converting the .bas _Examples in order to see how they're supposed to be used, and modify those examples until you've got a handle on how things work. I'll eventually have them all converted and available for reference, but for now, it's best not to experiment. Those features which haven't been demoed yet are subject to radical change, and even the ones who have been demoed might get a total overhaul.

In 2-3 weeks we'll have a stable release with most if not all the functionality demoed and documented. Sorry for the inconvenience :idea:

#23 sheeva

sheeva

    Seeker

  • Active Members
  • 39 posts

Posted 07 May 2010 - 02:19 PM

Hi Jrowe,

I have read example GUI but one parameter is not used in FB source the "$i_Horizontal"
but i think that i will wait docs ;-)

anyway, excellent work.

#24 A. Percy

A. Percy

    VW Sedan user

  • Active Members
  • PipPipPipPipPipPip
  • 561 posts

Posted 07 May 2010 - 04:32 PM

Perfect! :idea:
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

Posted Image VW Bug userPosted Image

Pinheiral (Pinewood) city: http://pt.wikipedia.org/wiki/Pinheiral

#25 shadowhacker

shadowhacker

    Seeker

  • Active Members
  • 11 posts

Posted 07 May 2010 - 05:12 PM

Ok guys got a bug for you. At the _IrrAddListBox function there is one extra parameter. It's the firast one. There is no horisontal/vertical scroll. So here is the new fixed function:

Func _IrrAddListBox($i_TopX, $i_TopY, $i_BottomX, $i_BottomY, $i_ID, $i_Background, $h_Parent)     $result = DllCall($_irrDll, "ptr:cdecl", "IrrAddListBox", "int", $i_TopX, "int", $i_TopY, "int", $i_BottomX, "int", $i_BottomY, "int", $i_ID, "int", $i_Background, "ptr", $h_Parent)     Return $result[0] EndFunc   ;==>_IrrAddListBox


EDIT: Ok i found an other one. It's about the _IrrAddEditBox. There is no horizontal parameter, but there is a parameter that i don't know what it does. So here is the fix.

Func _IrrAddEditBox($s_Text, $i_TopX, $i_TopY, $i_BottomX, $i_BottomY, $i_Unknown, $i_ID, $i_Border, $i_Password, $h_Parent)     $result = DllCall($_irrDll, "ptr:cdecl", "IrrAddEditBox", "wstr", $s_Text, "int", $i_TopX, "int", $i_TopY, "int", $i_BottomX, "int", $i_BottomY, "int", $i_Unknown, "int", $i_Border, "int", $i_Password, "ptr", $h_Parent)     Return $result[0] EndFunc   ;==>_IrrAddEditBox


EDIT: Back again. The _IrrAddButton function had one less parameter. Here is the fix.

Func _IrrAddButton($i_TopX, $i_TopY, $i_BottomX, $i_BottomY, $i_ID, $s_Text, $s_Tip, $h_Parent)     $result = DllCall($_irrDll, "ptr:cdecl", "IrrAddButton", "int", $i_TopX, "int", $i_TopY, "int", $i_BottomX, "int", $i_BottomY, "int", $i_ID, "wstr", $s_Text, "wstr", $s_Tip, "ptr", $h_Parent)     Return $result[0] EndFunc   ;==>_IrrAddButton


Replace the old functions with the new ones.

I will be back with some more fixes if i find them.

EDIT: Ok i replaced str with wstr and it's working fine. So i presume that in all the GUI function you should replace the str with the wstr, i'm not posting here all the function that need the replacement.

Edited by shadowhacker, 08 May 2010 - 07:45 PM.

Posted Image

#26 corgano

corgano

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 829 posts

Posted 08 May 2010 - 04:17 AM

I have been experimenting with the zip archives example. I tried this:
AutoIt         
  $file = FileOpenDialog("thing","","DAE (*.dae)" ) #include "au3Irrlicht2.au3" HotKeySet("{ESC}", "_exit") Func _exit() _IrrStop() Exit EndFunc _IrrStart($IRR_EDT_OPENGL, 800, 400, $IRR_BITS_PER_PIXEL_32, $IRR_WINDOWED, $IRR_NO_SHADOWS, $IRR_IGNORE_EVENTS) _IrrSetWindowCaption("Example 05: BSP Map") _IrrAddZipFile("./media/map-20kdm2.pk3", $IRR_IGNORE_CASE, $IRR_IGNORE_PATHS) ;~ $BSPMesh = _IrrGetMesh("20kdm2.bsp") $BSPMesh = _IrrGetMesh($file) $BSPNode = _IrrAddMeshToSceneAsOcttree($BSPMesh) $Camera = _IrrAddFPSCamera() $CameraNode = $Camera _IrrSetNodePosition($CameraNode, 1750, 149, 1369) _IrrSetNodeRotation($CameraNode, 4, -461.63, 0) _IrrHideMouse() WHILE _IrrRunning()     _IrrBeginScene(240, 255, 255)     _IrrDrawScene()     _IrrEndScene() WENDD


But it didn't work. I am trying to open a .dae file with. How do i do this? Where do i look for help with this? I looked up IrrGetMesh in the Irr wiki but got nothing.
0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

#27 shadowhacker

shadowhacker

    Seeker

  • Active Members
  • 11 posts

Posted 08 May 2010 - 07:15 AM

Well as i see there you don't really understand the way zip archives work, or you don't understand what kind of loading metod to use for models.
You use zip archives only when you want to load a 3D model or map from a pk3 archive or a zip archive. And the code looks like this:

_IrrAddZipFile("./media/map-20kdm2.pk3", $IRR_IGNORE_CASE, $IRR_IGNORE_PATHS) ;<--- the zip archive you need to open that contains the bsp map that you will load in the next command $BSPMesh = _IrrGetMesh("20kdm2.bsp") ;<--- bsp map file from the zip archive (this is usualy in the map folder in the zip archive) $BSPNode = _IrrAddMeshToSceneAsOcttree($BSPMesh) ;<--- the command that adds the map to the scene as an octtree so collisions can be made easyer(this cmd it's used only for maps)


If you want to load a 3D model you use th folowing code:

$MD2Mesh = _IrrGetMesh("./media/zumlin.md2") ;<--- the models mesh you want to add to the scene $MeshTexture = _IrrGetTexture("./media/zumlin.pcx") ;<--- the texture you want to apply to the model in the scene(usualy each model has a texture) $SceneNode = _IrrAddMeshToScene($MD2Mesh) ;<--- you add the model to the scene _IrrSetNodeMaterialTexture($SceneNode, $MeshTexture, 0) ;<--- you apply the texture to the model

Edited by shadowhacker, 08 May 2010 - 07:16 AM.

Posted Image

#28 bogQ

bogQ

    For me, it’s simple - it’s a way of life.

  • Active Members
  • PipPipPipPipPipPip
  • 1,775 posts

Posted 08 May 2010 - 01:17 PM

_IrrAddHillPlaneMesh fix (if im not wrong)
from {"ptr", $h_Material, $f_HillHeight = 0}
to {"ptr", $h_Material, "float", $f_HillHeight}

Func _IrrAddHillPlaneMesh($s_Name, $f_TileSizeX, $f_TileSizeY, $i_TileCountX, $i_TileCountY, $h_Material = 0, $f_HillHeight = 0, $f_CountHillsX = 0, $f_CountHillsY = 0, $f_TextureRepeatCountX = 1, $f_TextureRepeatCountY = 1)     $result = DllCall($_irrDll, "ptr:cdecl", "IrrAddHillPlaneMesh", "ptr", $s_Name, "float", $f_TileSizeX, "float", $f_TileSizeY, "int", $i_TileCountX, "int", $i_TileCountY, "ptr", $h_Material, "float", $f_HillHeight ,"float", $f_CountHillsX, "float", $f_CountHillsY, "float", $f_TextureRepeatCountX, "float", $f_TextureRepeatCountY) ;~  ConsoleWrite(@error)     Return $result[0] EndFunc   ;==>_IrrAddHillPlaneMesh

Edited by bogQ, 08 May 2010 - 01:23 PM.

TCP server and client - Learning about TCP servers and clients connection
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.

 


#29 shadowhacker

shadowhacker

    Seeker

  • Active Members
  • 11 posts

Posted 08 May 2010 - 01:52 PM

Ok guys, i got a problem here. When using GUI all the text in the GUI like window name, or listbox item, or editbox text, or button text, or button tip text...actualy i think all the text in the GUI has a problem. Some times it doesn't show at all and some times it shows just parts of the text. I looked over the wrapper source and i saw there that the text parameter in the IrrAddWindow function, for example, it's wchar_t type. I think that is a kind of char but i'm not sure. Well in the au3Irrlicht file the DllCall function has a str type before the text parameter. From my logic i think that is wrong, but i can't find a way(or a type) that would work there.
So a little help on that thing would be appreciated. Thanks.
Posted Image

#30 bogQ

bogQ

    For me, it’s simple - it’s a way of life.

  • Active Members
  • PipPipPipPipPipPip
  • 1,775 posts

Posted 08 May 2010 - 02:00 PM

Post the script that replicate problem, im haveing problems to learn what func do what at the moment so geave some example to try to test it pls :idea:

Edit:

Possible problems on...

$result = DllCall($_irrDll, "ptr:cdecl", "IrrAddGrass", "ptr", $h_Terrain, "int", $i_X, "int", $i_Y, "int", $i_PatchSize, $f_FadeDistace, $i_Crossed, "float", $f_GrassScale, "int", $i_MaxDensity, "int", $i_DataPosX, "int", $i_DataPosY, "ptr", $h_HeightMap, "ptr", $h_TextureMap, "ptr", $h_GrassMap, "ptr", $h_GrassTexture)

$result = DllCall($_irrDll, "ptr:cdecl", "IrrAddFlyCircleAnimator", "ptr", $h_Node, "float", $f_CenterX, $f_CenterY, "float", $f_CenterZ, "float", $f_Radius, "float", $f_Speed)


Edited by bogQ, 08 May 2010 - 02:26 PM.

TCP server and client - Learning about TCP servers and clients connection
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.

 


#31 shadowhacker

shadowhacker

    Seeker

  • Active Members
  • 11 posts

Posted 08 May 2010 - 05:44 PM

Here you go, this a test GUI. See if for you it shows the text captions from the button, window, listbox items. And i noticed that in the editbox i get a strange value if i don't put any text.

AutoIt         
#cs ----------------------------------------------------------------------------     TriniX Development #ce ---------------------------------------------------------------------------- #include "au3Irrlicht2.au3" OnAutoItExitRegister("Au3Exit") HotKeySet("{ESC}", "Au3Exit") global $title = "TriniX Development - GUI Test" global $NEW_BUTTON = 10, $LISTBOX_FORM = 11, $EDITBOX_FORM = 12 global $form1 main() func main()     _IrrStart($IRR_EDT_OPENGL, 800, 600, $IRR_BITS_PER_PIXEL_32, $IRR_WINDOWED, $IRR_NO_SHADOWS, $IRR_IGNORE_EVENTS)     _IrrSetWindowCaption($title)     ;Let's make the GUI     $form1 = _IrrAddWindow("Window title", 10, 10, 500, 300, $IRR_GUI_MODAL)     _IrrAddButton(5, 22, 105, 47, $NEW_BUTTON, "First button", "Just a tip", $form1)     $listbox = _IrrAddListbox(5, 55, 105, 200, $LISTBOX_FORM, 1, $form1)     _IrrAddListBoxItem($listbox, "First item")     _IrrAddListBoxItem($listbox, "Second item")     _IrrAddEditBox("", 5, 205, 155, 220, $EDITBOX_FORM, 0, 1, 0, $form1)     while _IrrRunning() ;the main while         while WinActive($title)             _IrrBeginScene(240, 255, 255)             _IrrDrawScene()             _IrrDrawGUI() ;Drawing the GUI             _IrrEndScene()         wend     wend     return Au3Exit() endfunc Func Au3Exit() ;When the script exits     _IrrStop()     Exit 0 EndFunc

Posted Image

#32 bogQ

bogQ

    For me, it’s simple - it’s a way of life.

  • Active Members
  • PipPipPipPipPipPip
  • 1,775 posts

Posted 08 May 2010 - 06:59 PM

Did not realized that your using edited version until now :)

Your have str and you need wstr "text as wstring ptr"

EDIT: Global Enum $IRR_GUI_MODAL, $IRR_GUI_NOT_MODAL ;Is needed for _IrrAddWindow shadowhacker fix on func

If its working with wstr for you (i need second opinion i know that its working for me :( ) pls shadowhacker reedit post up there with fix funcs (dont like to double post the same funcs only becose of "wstr" :) )

EDIT: Ok i replaced str with wstr and it's working fine. So i presume that in all the GUI function you should replace the str with the wstr, i'm not posting here all the function that need the replacement.


EDIT: Cool, now only jrowe to fix all funcs so that everyone can have identical version :idea:

Edited by bogQ, 08 May 2010 - 07:56 PM.

TCP server and client - Learning about TCP servers and clients connection
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.

 


#33 JRowe

JRowe

    Chasing the white rabbits

  • Active Members
  • PipPipPipPipPipPip
  • 1,764 posts

Posted 08 May 2010 - 08:17 PM

Yes, there's a whole lot of functions that have incorrect parameters, which are mostly str/wstr differences. The last release was mostly for structure, finetuning will occur as I convert the demos and update the functions to match the dll, instead of the reference documentation, which is how I built the first pass. I have some important goings on today and won't be able to release, and I have some work to do tomorrow, but hopefully I can get an update out tomorrow evening (I'll try to get the big feature demos added in.)

Keep up the debugging and experiments guys, thanks for the help!

#34 kaotkbliss

kaotkbliss

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 2,338 posts

Posted 20 May 2010 - 02:42 PM

Sweet! I can't wait to mess with this. I've had it downloaded for a couple weeks now but unfortunately I am in my math class at this time (and math is my worst subject) so it's taking much of my time and concentration. Lots of nice additions from the first (skydome, grass etc.) I do hope the colors are better. It could have been incorrect settings on my part (I didn't experiment too much on that yet) I can't remember exactly but I think it had to do with lighting on the node, it was either good looking colors but flat looking node, or greyish dull colors and shadowed node.

8yyxkx.jpg010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My first project  Allin1 Program launcher

Bill Calculator

Got <Insert problem here>? There's an AutoIt script for that!


#35 corgano

corgano

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 829 posts

Posted 19 June 2010 - 09:41 PM

This topic has gone without reply for too long

I am having issues getting it to load the textures with my .obj file, I am probably missing something obvious. I have also tried exporting it from sketchup as .dae and as .obj files, all 3 load the mesh without textures. halp?

EDIT
Here is code
Plain Text         
#include "au3Irrlicht2.au3" HotKeySet("{ESC}", "_exit") Func _exit() _IrrStop() Exit EndFunc _IrrStart($IRR_EDT_OPENGL, 800, 400, $IRR_BITS_PER_PIXEL_32, $IRR_WINDOWED, $IRR_NO_SHADOWS, $IRR_IGNORE_EVENTS) _IrrSetWindowCaption("Example 05: BSP Map") $BSPMesh = _IrrGetMesh("./su out/lev5.obj") $BSPNode = _IrrAddMeshToSceneAsOcttree($BSPMesh) $Camera = _IrrAddFPSCamera() $CameraNode = $Camera _IrrSetNodePosition($CameraNode, 100, 100, 100) _IrrSetNodeRotation($CameraNode, 0, 60, 60) _IrrHideMouse() WHILE _IrrRunning()     _IrrBeginScene(240, 255, 255)     _IrrDrawScene()     _IrrEndScene() WEND

And here is map file (skp and the obj as exported by sketchup)
Attached File  su out.zip   614.26KB   237 downloads

Edited by corgano, 19 June 2010 - 09:47 PM.

0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

#36 JRowe

JRowe

    Chasing the white rabbits

  • Active Members
  • PipPipPipPipPipPip
  • 1,764 posts

Posted 19 June 2010 - 11:11 PM

You'll need to specify the material in order to apply the textures. Check out the "3D Models - Meshes and Nodes" example earlier in the thread to see the material and texture functions.

#37 corgano

corgano

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 829 posts

Posted 19 June 2010 - 11:36 PM

so if I apply textures and materials in sketchup, I have to re-apply these to the map after I export it?

EDIT

This made it a light gray instead of black, but i don't exactly get what needs to be done
Plain Text         
#include "au3Irrlicht2.au3" HotKeySet("{ESC}", "_exit") Func _exit() _IrrStop() Exit EndFunc _IrrStart($IRR_EDT_OPENGL, 800, 400, $IRR_BITS_PER_PIXEL_32, $IRR_WINDOWED, $IRR_NO_SHADOWS, $IRR_IGNORE_EVENTS) _IrrSetWindowCaption("Example 05: BSP Map") $BSPMesh = _IrrGetMesh("./su out/lev5.obj") $MeshTexture = _IrrGetTexture("./su out/lev5.mtl") $BSPNode = _IrrAddMeshToSceneAsOcttree($BSPMesh) _IrrSetNodeMaterialTexture($BSPNode, $MeshTexture, 0) _IrrSetNodeMaterialFlag($BSPNode, $IRR_EMF_LIGHTING, $IRR_OFF) $Camera = _IrrAddFPSCamera() $CameraNode = $Camera _IrrSetNodePosition($CameraNode, 100, 100, 100) _IrrSetNodeRotation($CameraNode, 0, 60, 60) _IrrHideMouse() WHILE _IrrRunning()     _IrrBeginScene(240, 255, 255)     _IrrDrawScene()     _IrrEndScene() WEND

Edited by corgano, 20 June 2010 - 12:10 AM.

0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

#38 bogQ

bogQ

    For me, it’s simple - it’s a way of life.

  • Active Members
  • PipPipPipPipPipPip
  • 1,775 posts

Posted 20 June 2010 - 05:29 PM

I dont know if engine can handle .mtl files as textures.
I dont have any problem aplying jpg file from folder as texture.

You can do it from 3d editing program or from irr command the choice is your, personaly i think its best to aply picture directly from the editing program becose i detecetd (in anim8or) that UV is mesed up (or its not turned on) on object so picture isnt displayed correctly and that is something that irr engine cant correct for you. If i turn UV option on your object texture is displayed correctly.
Hope that you understand this words about UV maping becose english isnt my main language :mellow: .

TCP server and client - Learning about TCP servers and clients connection
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.

 


#39 corgano

corgano

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 829 posts

Posted 21 June 2010 - 03:31 AM

I am not quite sure What you are talking about

The materials are applied in sketchup, not quite sure what format to export the model in. I attached a zip file with my sketchup model and the exported .obj a couple posts ago, and if anyone has sketchup and would be willing to help me figure this out i would greatly appreciate this.
0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

#40 bogQ

bogQ

    For me, it’s simple - it’s a way of life.

  • Active Members
  • PipPipPipPipPipPip
  • 1,775 posts

Posted 21 June 2010 - 04:09 PM

You added
$MeshTexture = _IrrGetTexture("./su out/lev5.mtl")
as your texture
I think that .mlt inst valid texture so try to use .jpg files to put on your 3D objects as texture.
When you say 'The materials' that is some picture or materials with collor, becose on your object file (.obj) i did not seen any texture or material aplyed or added to the object. So that is why its start point is gray. (probably sketchup isnt so good in exporting).

This is only if the picture (.jpg or other irr supported formats) isnt dislpayed correctly on object.
You exported object in .obj with sketchup, so i dont know do the program exported it all cotectly.
Your model (in .obj form) do not have correct UV maping, or no UV maping at all. So you created some model and probably messed up vertexs (or program did that when he exported it) when you created it and engine dont know where what parts to put from picture to object, as the result you get messed up picture on model or no picture at all (this isnt engine bug, its problem on your or program side :mellow: ). (google the "UV maping" for more info, or heare is one picture to help you http://loupguru.com/store/images/MapExchange.jpg )

Maby its best to try with some other modeling program if sketchup isnt working like it shud.

TCP server and client - Learning about TCP servers and clients connection
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.

 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users