View Full Version : Irrlicht module: unofficial preview 3
ErosOlmi
08-05-2007, 16:30
Hi all.
3rd unofficial preview Irrlicht module wrapper for thinBasic.
Due to file size, we will not attach new release to post.
Please download it from http://www.thinbasic.com/public/products/thinBasic/Scripts/Irrlicht/pv3/Irrlicht_pv3.zip
Size: 4.8Mb
Before using it, please delete all previous sample Irrlicht scripts and related files. We are considering to create a dedicated SetUp_IrrlichtModuleWrapper.exe file for future updates. We will see.
Anyhow, Unzip in thinBasic directory maintaining directory structure.
Then go under thinBasic\SampleScripts\Irrlicht\ and execute thinBasic script samples. If not working let us know.
Attention:
irrlicht.DLL MUST be located into thinBasic.EXE executable folder in order to work. We are thinking how to avoid this but for the moment that is the way
Some thinBasic_Irrlicht module info:
developer: Roberto
module is developed using MS C/C++
thinBasic module wrapper is under development using thinBasic SDK for MS C/C++
irrlicht.DLL is compressed using UPX 3.00w original is about 1.4Mb while the one we distribute is about 510Kb
due to under development status and dll size, we will not deliver this module with official thinBasic release but we will keep a parallel temp project.
Later, when quite stable, we will decide how to go on
Have fun and please let us know if all is working fine on your box.
If not working, please tell us your OS and hardware config.
Ciao
Eros
Ok, I've tried it and it works on my computer, as you can see. :)
I tried the Quake Map and it worked but in order to close the Window I had to use 'Alt + F4'.
Also after I finished using it, the Application was still running in the background and I had to use the TaskManager to close it.
I've tried other versions of Irrlicht in the past like the C++, C# and Java versions and I'd encountered these kind of problems before.
ErosOlmi
08-05-2007, 16:56
Thanks a lot matthew.
Yes, to close window you need to press ALT+F4, sorry I forgot to mention.
We also see in Irrlicht forum that there are some problems in releasing the engine when using Alt+F4. We are trying to investigate and force some internal shut down.
Roberto is aware of it but thanks a lot for reporting.
Ciao
Eros
RobertoBianchi
08-05-2007, 17:11
Eros,
maybe you should update matthew's thincore.dll?
Roberto
ErosOlmi
08-05-2007, 17:17
matthew,
maybe Roberto is right. when we started developing Irrlicht wrapper we had some similar problems but we were able to fix it changing WHILE/WEND processing.
Can you please be sure to have current thinBasic preview version 1.3.0.1 updated 2007.05.06?
Thanks a lot.
Eros
I'd been using thinBASIC version 1.3.0.0. :P
I've just downloaded the new version and tried it.
After I shutdown the Application I checked the taskmanager and it wasn't running in the background. :)
ErosOlmi
08-05-2007, 17:43
Roberto's memory is still very good.
Perfect matthew. You was just loosing all those changes http://www.thinbasic.com/public/products/thinBasic/help/html/version_1_3_0_1.htm
:D
Attention. with preview version 1.3.0.1 one or two of NeHe examples had problems due to new way to parse parameters in some TBGL functions.
I've already fixed NeHe examples you posted in forum. You should fix your local examples. Mainly to fix the problem you need to add ( and ) to sorround function parameters when first parameter start with a numeric expression between ().
Ciao
Eros
Petr Schreiber
08-05-2007, 19:59
Roberto,
do you know it looks awesome ? ;)
Matthew - sorry for inconvinience with TBGL parenthesis issues, but it had to be changed to kick maximum speed possible from thinCore/TBGL.
Thanks a lot,
Petr
Worked great guys. I ran it in directx 9.0c, opengl and software render and they all worked. Software render was interesting as it took some time to draw and it made the scene very grainy, so interesting to see. But directx and opengl ran smooth as a bell.
In case you missed it, arrow keys move you and mouse turns you. And as mention ALT+F4 to exit.
Thanks again Roberto!!
It working perfect for me (using OpenGL & DirectX 9). Maybe Frank Dodd's wrapper for FreeBasic can help develop irrlicht module: http://www.freebasic.net/forum/viewtopic.php?t=3584
Michael Hartlef
10-11-2010, 15:14
Hi Bagamut,
thanks for mentioning this. I forgot about it totally. As Roberto seem to have not interest in this anymore, I might have a look at this freebasic wrapper.
Cheers
Michael
largo_winch
17-05-2011, 11:16
anybody out there can help me to understand how to adept "irrlicht" wrapper for thinbasic? How has created "thinbasic_irrlicht.dll"? What tool I have to use? I want to create a dungeon with a monster in there with irrlicht/thinbasic :) petr, michael, eros, matthew, bagamut or some person of this forum site could help? you are welcome to give some infos or links or something else.
regards, largo
ErosOlmi
17-05-2011, 12:38
Hi largo,
sorry no-one replied to your request.
Irrlicht project was a Roberto Bianchi project, I just published it.
If I remember well, it was a wrapper of a C++ library. You need to have Microsoft C++ in order to go on with the project.
If someone is interested to go on, I can see if I'm in the position (I've to ask to Roberto about that) to publish source code of the wrapper.
Ciao
Eros
largo_winch
07-06-2011, 11:19
I've tried to tranlsate "enum types" with thinbasic. See my example. The freebasic example I have desactivated and it's below thinbasic part. perhaps somebody can check the thinbasic code how to specify "types objects" with a number ( = 1) or better using equates and say what's correct?
'---------------> ' Event types from irrlicht part ------->
'enum IRR_EEVENT_TYPE
' IRR_EET_GUI_EVENT = 0
' IRR_EET_MOUSE_INPUT_EVENT = 1
' IRR_EET_KEY_INPUT_EVENT = 2
' IRR_EET_JOYSTICK_INPUT_EVENT = 3
' IRR_EET_LOG_TEXT_EVENT = 4
' IRR_EET_USER_EVENT = 5
'End enum
'-------------------------------------------> irrlicht part
' Empty GUI script created on 06-07-2011 10:21:23 by largo_winch (ThinAIR)
Uses "console"
'----------------------> THINBASIC PART -------------------->
Type MyEnum
'enum MyEnum
'option1 = 1
'option2 = 2
'option3 = 3
option1 As Single '= 1 doesn't work!
option2 As Single '= 2 doesn't work!
option3 As Single '= 3 doesn't work!
'End enum
End Type
Dim xmyEnum As MyEnum
Dim MyVar As Integer
Dim MyVar2 As Integer
MyVar = xmyEnum.option1
MyVar2 = xmyEnum.option2
Select Case MyVar
Case xmyEnum.option1
PrintL "Option 1"
Case xmyEnum.option2
PrintL "Option 2"
Case xmyEnum.option3
PrintL "Option 3"
End Select
'result="Option 1"
Select Case MyVar2
'Case xmyEnum.option1 '--------> only with a trick to get the correct result! :)
' PrintL "Option 1"
Case xmyEnum.option2
PrintL "Option 2"
Case xmyEnum.option3
PrintL "Option 3"
End Select
'result="Option 2"
'Sleep 1500
WaitKey
'-----------------------------------------------> end thinbasic script ----->
'------ original Freebasic code example ------------------------------------>
'
'enum MyEnum
' option1 = 1
' option2 = 2
' option3 = 3
'End enum
'Dim MyVar As Integer
'Dim MyVar2 As Integer
'MyVar = option1
'MyVar2 = option2
'Select Case MyVar
' Case option1
' Print "Option 1"
' Case option2
' Print "Option 2"
' Case option3
' Print "Option 3"
'End Select
'
'Select Case MyVar2
' Case option1
' Print "Option 1"
' Case option2
' Print "Option 2"
' Case option3
' Print "Option 3"
'End Select
'Sleep 1500
'-----> result "option1"
'-----> result "option2"
bye, largo
Petr Schreiber
07-06-2011, 11:34
Hi,
if you have FreeBASIC enum like this:
enum IRR_EEVENT_TYPE
IRR_EET_GUI_EVENT = 0
IRR_EET_MOUSE_INPUT_EVENT = 1
IRR_EET_KEY_INPUT_EVENT = 2
IRR_EET_JOYSTICK_INPUT_EVENT = 3
IRR_EET_LOG_TEXT_EVENT = 4
IRR_EET_USER_EVENT = 5
End enum
you can re-represent it in thinBASIC like:
Alias Long As IRR_EEVENT_TYPE
Begin Const 'IRR_EEVENT_TYPE
%IRR_EET_GUI_EVENT = 0
%IRR_EET_MOUSE_INPUT_EVENT = 1
%IRR_EET_KEY_INPUT_EVENT = 2
%IRR_EET_JOYSTICK_INPUT_EVENT = 3
%IRR_EET_LOG_TEXT_EVENT = 4
%IRR_EET_USER_EVENT = 5
End Const
...
Dim MyEvent As IRR_EEVENT_TYPE
MyEvent = %IRR_EET_USER_EVENT
or even simply as:
Alias Long As IRR_EEVENT_TYPE
Begin Const 'IRR_EEVENT_TYPE
%IRR_EET_GUI_EVENT = 0 ' -- Sets start of numbering
%IRR_EET_MOUSE_INPUT_EVENT ' -- This is automatically 1
%IRR_EET_KEY_INPUT_EVENT ' -- This is automatically 2...
%IRR_EET_JOYSTICK_INPUT_EVENT
%IRR_EET_LOG_TEXT_EVENT
%IRR_EET_USER_EVENT
End Const
...
Dim MyEvent As IRR_EEVENT_TYPE
MyEvent = %IRR_EET_USER_EVENT
Regarding original FreeBasic code, it would become something like:
Uses "console"
Begin Const 'MyEnum
%option1 = 1 ' -- Start from 1
%option2
%option3
End Const
Dim MyVar, MyVar2 As Long ' -- Integer would work as well, but LONGs are faster
MyVar = %option1
MyVar2 = %option2
Select Case MyVar
Case %option1
PrintL "Option 1"
Case %option2
PrintL "Option 2"
Case %option3
PrintL "Option 3"
End Select
Select Case MyVar2
Case %option1
PrintL "Option 1"
Case %option2
PrintL "Option 2"
Case %option3
PrintL "Option 3"
End Select
WaitKey
Petr
largo_winch
07-06-2011, 20:16
thank you petr for infos about "enum" translations help to thinbasic !
yoh! now I've done next step and crazy thing: I have translated the "irrlichtwrapper.bi" for thinbasic as include file (as well as I am able to do that after two hours!). see my zip folder. but I have to add something more. So I can imagine I have to connect the file to thincore? I must build a module engine?
' Empty GUI script created on 06-07-2011 18:31:07 by largo_winch (ThinAIR)
'' Includes for extension libraries
#INCLUDE "Irrlicht_lw1.inc"
Uses "console", "ui"
Declare Function LoadLibrary Lib "KERNEL32.DLL" Alias "LoadLibraryA" (lpLibFileName As Asciiz) As Long
hLib = LoadLibrary("IRRLICHT.DLL")
hLib = LoadLibrary("IRRLICHTWRAPPER.DLL")
'--------------------------------------------------------------->
IrrStart (%IRR_EDT_OPENGL, 400, 200, %IRR_BITS_PER_PIXEL_32,_
%IRR_WINDOWED, %IRR_NO_SHADOWS, %IRR_IGNORE_EVENTS,_
%IRR_VERTICAL_SYNC_ON )
'IrrStart, %IRR_EDT_OPENGL, 400, 200, 32,_
' %FALSE, %FALSE, %FALSE, 0
' Set the title of the display
IrrSetWindowCaption( "Example 01: Hello World" )
' add a static text object to the graphical user interface. The text will be
' drawn inside the defined rectangle, the box will not have a border and the
' text will not be wrapped around if it runs off the end
IrrAddStaticText( "Hello World", 4,0,200,16, %IRR_GUI_NO_BORDER, %IRR_GUI_NO_WRAP )
' while the scene is still running
While IrrRunning
' begin the scene, erasing the canvas to white before rendering
IrrBeginScene( 255,255,255 )
' draw the Graphical User Interface
IrrDrawGUI
' end drawing the scene and render it
IrrEndScene
Wend
' -----------------------------------------------------------------------------
' Stop the irrlicht engine and release resources
IrrStop "irrstart" is a sub declaration but thinbasic doesn't accept this command or cannot read this command although it's defined in include file.
bye, largo
Petr Schreiber
07-06-2011, 20:37
Hi!,
you are almost there!
Tip #1
Remove this code from the include file and examples:
Declare Function LoadLibrary Lib "KERNEL32.DLL" Alias "LoadLibraryA" (lpLibFileName As Asciiz) As Long
Dim hlib As DWord
Dim v As Long
hLib = LoadLibrary("IRRLICHT.DLL")
hLib = LoadLibrary("IRRLICHTWRAPPER.DLL")
Why? Because you can declare the DLL in the DECLAREs directly, see Tip #2 :p
Tip #2
Just specify the DLL directly in the declarations. That means for example this:
Declare Function IrrRunning Alias "IrrRunning" () As Integer
becomes this:
Declare Function IrrRunning LIB "IrrlichtWrapper.DLL" Alias "IrrRunning" () As Integer
Tip #3
Value initialization is not supported in declare statements, so this:
Declare Sub IrrStart Alias "IrrStart" ( _
ByVal device_type As IRR_DEVICE_TYPES, _
ByVal iwidth As Integer, _
ByVal iheight As Integer, _
ByVal bitsperpixel As Integer, _ 'unSigned
ByVal fullscreen As Integer, _
ByVal use_shadows As Integer, _
ByVal iCaptureMouse As Integer, _
ByVal vsync As Integer = IRR_OFF ) '
becomes (with Tip #2 applied as well):
Declare Sub IrrStart Lib "IrrlichtWrapper.dll" Alias "IrrStart" ( _
ByVal device_type As IRR_DEVICE_TYPES, _
ByVal iwidth As Integer, _
ByVal iheight As Integer, _
ByVal bitsperpixel As Integer, _ 'unSigned
ByVal fullscreen As Integer, _
ByVal use_shadows As Integer, _
ByVal iCaptureMouse As Integer, _
ByVal vsync As Integer) ' -- Removed initialization
Tip #4
Be precise, for example
you have IrrStart defined twice in the INC file, first as SUB (correct), second as function (wrong, delete it)
you need to be sure about data types, for example I have seen:
ByVal bitsperpixel As Integer, _ 'unSigned
.. but Integer is signed of course, so this is confusing
Beware! FreeBasic Integer is 32bit while ThinBASIC Integer is 16bit! So FreeBasic Integer should be Long or Int32 data type in ThinBASIC.
To see the details on FreeBASIC data types, look here: http://mateusz.viste.free.fr/dos/fb_types.pdf
(http://mateusz.viste.free.fr/dos/fb_types.pdf)To see the details on ThinBASIC data types, look here: http://www.thinbasic.com/public/products/thinBasic/help/html/numericvariables.htm
(http://www.thinbasic.com/public/products/thinBasic/help/html/numericvariables.htm)
I think you did good job, now just make the details fit and you can run Irrlicht tomorrow :)
Petr
ErosOlmi
07-06-2011, 20:50
Largo,
in thinBasic there is no need to use "LoadLib" to load a libraries in order to access sub or functions inside them: you just need to declare the needed sub/functions and all the rest will be done automagically. So change all your needed declares in order to use the LIB clause
The problem is that you need to declare your subs/functions using the LIB "libName" clause. See http://www.thinbasic.com/public/products/thinBasic/help/html/declare.htm
Other problems I've fixed in attached files:
in DECLARE statement you cannot indicate default values for optional parameters, just use OPTIONAL keyword for optional parameters
WSTRING is not supported. wstring is just a UNICODE (double byte) string. Use UCODE$ to convert from ascii to UNICODE string
IrrStart was defined more than once. I just commented some out and leave the first version I found in the include file. I do not know it it is ok or not
Ciao
Eros
ErosOlmi
07-06-2011, 20:53
oops, sorry Petr. I posted while you was posting.
Your is a much better explanation than mine! :good:
largo_winch
08-06-2011, 10:35
thanks to petr and eros! I have aim to manage this irrlicth monsterly stuff!
I see a little light at the end of the hole :) but there are some more questions.
' Empty GUI script created on 06-08-2011 08:53:01 by largo_winch (ThinAIR)
'----------------------------------------------------------------
'Question about irrlicht_engine, if this translation is correct:
'----------------------------------------------------------------
'1) --------------------->
'#define IRR_OFF 0
%IRR_OFF = 0
'#define IRR_ON 1
%IRR_ON = 0
'2) --------------------->
'TYPE irr_node As LONG Ptr
Type irr_node
irr_node As Long Ptr
End Type
'Type irr_gui_object as Any Ptr
Type irr_gui_object
irr_gui_object As Any Ptr
End Type
'TYPE irr_mesh as LONG PTR
Type irr_mesh ' doesn't work for loading objects
irr_mesh As Long Ptr
End Type
-example one (Hello irrlicht) opens a dialog as wished, but Title text isn't correct (I see hyroglyphs). see my example.
-I've changeld nearly all integer into longs.
-included lib's (LIB "IrrlichtWrapper.DLL") as needed.
- all wstring/zstring I changed into "string"
- all examples you find in zip folder with new "irrlicht_lw.inc" (not perfect but nearly 90 per cent I am thinking!)
more questions will come.thanks boys for helping and hints! ;)
eros, I didn't see your example until some seconds before my post here. I will check next hours.
I cannot load yet any irrlicht object (irr_mesh) gives still errors.
bye largo
ErosOlmi
08-06-2011, 11:00
WSTRING are UNICODE strings while thinBasic strings are ascii strings.
Use UCODE$ to convert your string from ascii to UNICODE string when WSTRING is needed
Petr Schreiber
08-06-2011, 14:08
Your code:
'1) --------------------->
'#define IRR_OFF 0
%IRR_OFF = 0
'#define IRR_ON 1
%IRR_ON = 0
'2) --------------------->
'TYPE irr_node As LONG Ptr
Type irr_node
irr_node As Long Ptr
End Type
'Type irr_gui_object as Any Ptr
Type irr_gui_object
irr_gui_object As Any Ptr
End Type
'TYPE irr_mesh as LONG PTR
Type irr_mesh ' doesn't work for loading objects
irr_mesh As Long Ptr
End Type
can be converted as:
'1) --------------------->
'#define IRR_OFF 0
%IRR_OFF = 0
'#define IRR_ON 1
%IRR_ON = 1 ' ! -- You probably forgot this by accident :)
'2) --------------------->
'TYPE irr_node As LONG Ptr
Alias DWord As irr_node ' -- it serves to store 32bit address to LONG
'Type irr_gui_object as Any Ptr
Alias DWord As irr_gui_object ' -- it serves to store 32bit address to anything
'TYPE irr_mesh as UINTEGER PTR
Alias DWord As irr_mesh ' -- it serves to store 32bit address to DWORD
Petr
largo_winch
08-06-2011, 19:05
well, here we are :) the first "hello irrlicht" example perfect running!
thanks to petr ("Alias DWord As" ) and eros (Ucode$) again for help.
' Empty GUI script created on 06-07-2011 18:31:07 by largo_winch
' Empty GUI script created on 06-08-2011 18:37:00 by largo_winch
'' Includes for extension libraries
#INCLUDE "Irrlicht_lw1b.inc"
Uses "console"
IrrStart (%IRR_EDT_OPENGL, 500, 400, 32,_ ' '%IRR_BITS_PER_PIXEL_32
%IRR_WINDOWED, %IRR_NO_SHADOWS, %IRR_IGNORE_EVENTS,_ '
%IRR_VERTICAL_SYNC_ON )
' Set the title of the display
IrrSetWindowCaption(Ucode$ ("Example 01: Hello Irrlicht_World") )
IrrAddStaticText(Ucode$("Hello Largo's Irrlicht_World"), 15,20,400,64, %IRR_GUI_NO_BORDER, %IRR_GUI_NO_WRAP, IRR_GUI_OBJECT) 'type: IRR_GUI_OBJECT is important !
PrintL, IrrGetFPS 'see result in console window!
' while the scene is still running
While IrrRunning
' begin the scene, erasing the canvas to white before rendering
IrrBeginScene( 55,255,255 )
' draw the Graphical User Interface
IrrDrawGUI
' end drawing the scene and render it
IrrEndScene
Wend
' ----------------------------------------------------------------------------->
' Stop the irrlicht engine and release resources
IrrStop
example and new irrlicht include file you find in zip file. Give feedback if there are problems with running this example. must working fine!
bye, largo
I found some interesting game engine fully based on IrrLicht and Newton. Here the link to offical site (http://www.n3xt-d.org/index.html).
Overview:
N3xtD engine project is aimed specifically the 'alternative' languages (such as Basic, for example). He is compiling a number of known and proven tools like Irrlicht (v1.8.x) for graphics, Newton for the physical part, and some part of proprietary code, designed to improve overall.
This project is oriented primarily towards simplicity and ease of implementation, even if it is as complete as possible.
This engine has ports to PureBasic, FreeBasic, BlitzMax. This engine has more features then FreeBasic IrrLicht wrapper. Download page (http://www.n3xt-d.org/crbst_1.html).
largo_winch
17-06-2011, 12:19
here now I show four new irrlicht examples with thinbasic. feel free for testing. only the mouse control in dungeon-collision example doesn't work fully satisfied I will check if I can change that for next time.
it's good feeling to see the model and the rooms and the scene with living objects ;) (models)
feedback is important if these examples are working for you. all files in zip folder.
notation: only files with 3.8 mb files I can upload. it's possible to change that limitation?
thinbasic_irrlicht include file was updated.
eros please change that in thinbasic-code script example again, here I have some problems with code tags, sorry!:
'' ---------------------------------------------------------------------------- '' Irrlicht Wrapper for Imperative Languages - Freebasic Examples '' Frank Dodd (2006) '' ---------------------------------------------------------------------------- '' Example 08: Shadows and Lights '' This example loads a map and a model into the scene and then applies realtime '' shadows to the model cast from lights in the scene that can be seen on the '' surface of other objects. '' ---------------------------------------------------------------------------- ' ' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ' TRANSLATION: Empty GUI script created on 06-16-2011 15:21:58 by largo_winch (ThinAIR) ' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> #INCLUDE "Irrlicht_lw1c.inc" Uses "console" '' //////////////////////////////////////////////////////////////////////////// '' global variables ' irrlicht objects Dim MD2Mesh As irr_mesh Dim MeshTexture As irr_texture Dim SceneNode As irr_node Dim BSPMesh As irr_mesh Dim BSPNode As irr_node Dim OurCamera As irr_camera Dim Light As irr_node ' ----------------------------------------------------------------------------- ' start the irrlicht interface '500, 400 IrrStart( %IRR_EDT_OPENGL, 600, 500, %IRR_BITS_PER_PIXEL_32, %IRR_WINDOWED, _ '200 %IRR_SHADOWS, %IRR_IGNORE_EVENTS, %IRR_VERTICAL_SYNC_ON ) ' send the window caption IrrSetWindowCaption( Ucode$("TB_Example 08: Shadows and Lights. / alt+F4: close window" )) ' load the MD2 model from example 4 into the scene 'MD2Mesh = IrrGetMesh( "./media/zumlin.md2" ) MD2Mesh = IrrGetMesh( "./media/super.md2" ) 'MeshTexture = IrrGetTexture( "./media/zumlin.pcx" ) MeshTexture = IrrGetTexture( "./media/super.bmp" ) SceneNode = IrrAddMeshToScene( MD2Mesh ) IrrSetNodeMaterialTexture( SceneNode, MeshTexture, 0 ) IrrSetNodeMaterialFlag( SceneNode, %IRR_EMF_LIGHTING, %IRR_OFF ) IrrPlayNodeMD2Animation( SceneNode, %IRR_EMAT_STAND ) ' load the bsp map from example 5 into the scene IrrAddZipFile( "./media/map-20kdm2.pk3", %IRR_IGNORE_CASE, %IRR_IGNORE_PATHS ) BSPMesh = IrrGetMesh( "20kdm2.bsp" ) BSPNode = IrrAddMeshToSceneAsOcttree( BSPMesh ) ' move the map into position around the model IrrSetNodePosition( BSPNode, -1370,-88,-1400) ' add a camera into the scene OurCamera = IrrAddCamera( 50,0,0, 0,0,0 ) ' switching shadows on is very simple just call the command for the scene node ' that you want to cast shadows IrrAddNodeShadow( SceneNode,0 ) ' the shadow colour is a global property for the whole scene (however you can ' change it as you move into different areas of your scene) the first ' parameter is the alpha blend for the shadow this shadow is half washed out ' which gives the appearence of ambient light in the room illuminating the ' shadowed surface, the second set of numbers defines the color of the shadow ' which in this case is black IrrSetShadowColor( 128, 0, 0, 0 ) ' finally we need to add a light into the scene to cast some shadows. when using ' shadows you probably only want one or two lights as they can be time consuming ' the first set of parameters for this light specify the position its created ' at, the second set of parameters define the color - rather than 255 integer ' levels the intensity of red/green/blue is defined from 0 to 1 and finally ' you define the radius of effect of the light Light = IrrAddLight( %IRR_NO_PARENT, 100,100,-100, 0.9,0.3,0.3, 600.0 ) ' the second light is an ambient light and illuminates all surfaces in the scene ' uniformly. this is usually a low value that is used to change the lighting ' level across the entire scene IrrSetAmbientLight( 0.1, 0.1, 0.1 ) ' ----------------------------------------------------------------------------- ' while the irrlicht environment is still running While IrrRunning ' begin the scene, erasing the canvas with sky-blue before rendering IrrBeginScene( 240, 255, 255 ) ' draw the scene IrrDrawScene ' end drawing the scene and render it IrrEndScene Wend ' ----------------------------------------------------------------------------- ' Stop the irrlicht engine and release resources IrrStop
bye, largo
ErosOlmi
17-06-2011, 12:21
Hi largo,
can you please try to repost the code because it seems it missed line feed
ErosOlmi
17-06-2011, 12:39
notation: only files with 3.8 mb files I can upload. it's possible to change that limitation?
Thanks a lot, examples work great.
I just needed to download from the web missing Microsoft C library msvcp71.dll (I think it is needed by IrrlichtWrapper.dll wrapper)
Attachments limit for .ZIP file changed to 5Mb, hope it is enough
Eros
Petr Schreiber
17-06-2011, 13:19
Hi,
the examples are very nice, all of them ran without problem, except the irrlicht-collision-dungeon, where the camera movement on my PC was very slow (moved mouse by 40cm -> rotated by ~2 degrees).
This problem could be fixed by changing the rotation speed:
Camera = IrrAddFPSCamera(0,25,1,100.0,0.5,-1,0,irr_camera)
... but I am not sure if this fix is not just for my PC only. I am not sure what units the rotateSpeed uses.
Petr
All samples working good.
1st PC:
OS: Windows 7 x86 Ultimate
Core: AMD Phenom X3 8750 2.4Ghz
Mem: 2Gb DDR2 1066Mhz
Video: NVIDIA GeForce 8800 GT 512Mb
2nd PC:
OS: Windows XP x86 Professional
Core: Intel E5800
Mem: 1Gb DDR 400Mhz
Video: AMD Radeon HD2600XT 512Mb
A little later, testing on two laptops.
largo_winch
17-06-2011, 15:23
thanks bezumec, eros, petr for testing. I have found the problem some minutes before (I was too tired last night to check all features!), the camera speed rotation wasn't high enough. so you can use 50.0 or 100.0 for this. same thing petr has found (thanks!) for error checking.
these lines are important. the second value of IrrAddFpsCamera(0,50...) is important.
'-------------> Important -------------------------------------->
' next we add a first person perspective camera to the scene
Camera = IrrAddFPSCamera(0,50.0,1,100.0,0.5,-1,0,50) ' second number (50) gives speed rotation!
'-------------> Important -------------------------------------->
Internetsurfing: I am using at the moment linux and mozilla firefox, but I have some problems with code tags, don't know why.
Here a new fixed version of "dungeon-collision12a" example in zip file. Copy this file into first folder above. You can now move (and jump) through whole SCENE! That's really exciting ! :)
eros thanks for that:
Attachments limit for .ZIP file changed to 5Mb, hope it is enough
I will check if other irrlicht examples can work too for thinbasic. but I need time.
@bezumec: "N3xtD_FreeBasic.zip" can you check the link for me? or please give a link where I can download (right-click-mouse) to save download file? I have some problems here at the moment. Thanks for the link! (problem solved, downloaded file from another pc machine at work)
bye, largo
ErosOlmi
17-06-2011, 19:53
Well, thnks to you for your efforts!!!
Really appreciated.
largo_winch
20-06-2011, 09:56
1) here two little animations (at my old machine about 58 seconds) with a monster and the nice woman. monster was fighting against invisible enemy, but unfortunately was knocked out, other side woman (fairy girl) is moving, dancing, jumping without end.
I will check to look for new quake or md2 models by internet googling.
Well, thnks to you for your efforts!!!
Really appreciated.
oh no, thanks to you for great thinbasic language ! you are welcome.
2) important notice: copy the content of new zip folder (monster-moving-fighting.zip) "data" folder and three *.tbasic examples (monster, woman, zombie) in main folder of my last post #25 (irrlicht-tb-largo3a-all) to run the examples.
bye, largo
Another open source library for FreeBASIC http://freebasic.net/forum/viewtopic.php?t=17406 based on irrlicht_c library from this project http://pir.sourceforge.net
hello. what's the sense of creation of a thinbasic module (here about irrlicht topic) or it's sometimes better to use an include file (translation) as I did with irrlicht wrapper? a) to be truly I don't know how to make module creation for irrlicht as there a native functions (dll, freebasic and specially irrlicht.dll ) they didn't exist for thinbasic yet. the kind of equate using (%) doesn't work for module creation, I am right? btw: I tried some steps in module directions (freebasic-> thinbasic) but didn't know exactly where to set a reliable function for thinbasic coming from freebasic that didn't exist native for freebasic or by using the "irrlichtwrapper.bi" would make errors if I am using these functions. do you understand me? ;) c) thanks for the link maxim, I will check next days. bye, largo hello. sorry for my english. i understand you badly. perhaps this link will help somehow http://www.thinbasic.com/community/showthread.php?11225
largo_winch
01-07-2011, 11:54
ok, same serious question again: where's better to create a module for thinbasic or what good reasons (benefits) there are to use an include file? perhaps eros or petr can talk about this topic or give advices. bye, largo
Petr Schreiber
01-07-2011, 13:14
Hi Largo_Winch,
if include file works, the module would be redundant I guess. Some time ago, the DECLAREd functions in includes had slower execution than module based keywords, but I think the difference is no more so big.
That is the reason why for example OpenGL is provided via header and not module.
The general rule I follow is:
if it is just a wrapper of existing DLL -> make include
if it is something more, computionaly expensive and so on, then module is the way to go
Petr
i have added a rotating sun around a totem, with shadow enabled. i have used largo_winch example, and changed the floor by editing the texture inside *.pk3 since .pk3 is just a zip file. indeed i hate this room but can't use another one. i failed to load another using 3ds room model.
the dynamic shadows are useful in designing sundials which cast a shadow upon the position of the sun.
the game engines are too difficult to use, but as someone said about windows api: do not try to be smart with windows api just use it. this is the principle of operating a TV by only switching a button we don't need to know its internal circuits. and life are too short to learn everything.
i have added other md2 and obj files to experiment with
download the file from here:
http://www.mediafire.com/?q28ewxy83w5qdwq
(http://www.mediafire.com/?q28ewxy83w5qdwq)
P.S: the shadow are not correct visually, may be usefull in picasso art.
7359
Petr Schreiber
02-08-2011, 01:31
Hi Zak,
thanks for interesting demo!
On my PC, the totem did not get displayed at all, the console said:
Unknown data object in animation of .x file: Header
But when I tuned line 45 in the source to load some MD2 file directly, it worked okay.
Petr
another demo with irrlicht , show how to scale, position, rotate the objects. i have used the Largo wrapper.
also i must say that the maxim wrapper for python are excellent , it is available here http://sourceforge.net/projects/pir/
together with thinbasic, freebasic, and others codes wich used his irrlicht_c.dll more recent than what are posted here. i have tried all the python 26 examples and works okay by running test_python26.bat, and every time you press X or quit or alt+F4 you go to the next example. there are a youtube demo http://www.youtube.com/watch?v=pr7xl9PziRk
the above car example are not in the package. right click the video to copy its youtube address.
which show a Funny pure Python 3d vehicle. it is suitable for who want to study a million irrlicht examples tutorials wich are available in C++, and maxim wrapper are more irrlicht style.
now the problem here is that the cross model have no shadow, is it managed by the model designer to cast no shadow !!!, or a bug in irrlicht.
i have downloaded the model from here http://pauldahuach.com.ar/program_en.htm#Nehe31
and exported it by milkshape to obj file so to use it with this example. its structure are complex and not simply a 4 boxes.
i have also exported it to Ogre files (mesh, skeleton) so to use it in blitzmax flow3d http://flow3d.boxsnap.com/ Ogre library , and i have replace the robot by the cross model and i have disappointed that it show a shadow !!!!, may be ogre are more robust.
download my example (1.4 MB) from here:
http://www.mediafire.com/?gnanala7ja9d99i
7824
Thanks, zak!
My last wrapper edition and examples accessible only from SVN here https://pir.svn.sourceforge.net/svnroot/pir or here https://pyirrlicht.googlecode.com/svn/trunk.
I planned make next release, but this require more time.
Thank you maxim very much, i have downloaded most of the files, i run the test_python26.bat and see that there are improved files and a new files , i also enjoyed the great toy VehicleSceneNode and thanks for this.
the info when i run the batch is:
Irrlicht Engine version 1.8.0-alpha
Microsoft Windows XP Professional Service Pack 3
Using renderer: OpenGL 3.3.0
GeForce 210/PCI/SSE2: NVIDIA Corporation
OpenGL driver version is 1.2 or better.
GLSL version: 3.3
you may need to upload more media files , i have found the media folder in http://sourceforge.net/projects/irrlicht/files/Irrlicht SDK/1.3/irrlicht-1.3.zip/download works okay to texture many examples
regarding the cross shadow problem i have added the model cross.obj to the example specialFX.py and there is a shadow
http://s16.postimage.org/eh82lf2kl/special_FX.jpg
so i guess it is because you are using irrlicht v 1.8, while my thinbasic example above are using the wrapper which depends on an older version. in fact the developer of freebasic wrapper (http://www.frankdodd.screaming.net/IrrlichtWrapper/) stop its developing and the last post in the freebasic forum (http://www.freebasic.net/forum/viewtopic.php?f=14&t=3584&hilit=irrlicht) is 3 july 2011
the example specialFX works better for me when using the opengl, there are some problems with displaying the fire.
i attach the same your python example specialFX_cross and specialFX_dwarf with its media files http://www.mediafire.com/?dc7itudk4c5z15z . works great with the new irrlicht_c.dll except the fire which are not displayed when i use opengl and displayed erroneously when using directx3d9 , but the fire is displayed okay and realistic like this in the dev-cpp irrlicht 1.3
http://s8.postimage.org/sspn9tkj9/special_FX_fire.jpg
as displayed by the same example in irrlicht 1.3 using dev-cpp.
but all in all it is great
Yes, you right, 1.8 have strange effect with particle system.
Thank you for found this.
I made support for Irrlicht 1.7.3 and commit revision to SVN, also add new chess gui example (require chess.ttf).
For testing with irrlicht_c_173.dll reverse comment in pyirrlicht.py on lines 49 and 50 (c_module = ctypes.CDLL(...))
now it works, the light and the fire as should be, thanks maxim, the picture below is the same whether i use driverType = OpenGL or = DIRECT3D9 , it seems v 1.73 are better and also works correctly with DIRECT3D9.
http://s18.postimage.org/4fyjnaiuh/special_FX173.jpg
ok
1.8 version valid work with EDT_BURNINGSVIDEO
also see new 2d game bricka (a breakout clone), original version developed by Leonel Machava, this demonstrate Irrlicht collisions detection
bricka_i.py from SVN
http://youtu.be/G_so6tjPnRM
using driverType = EDT_BURNINGSVIDEO works for me with v1.8 in the specialFX example there is the light and the fire but too slow. also works with bricka_j in python26.
i will install python 3.2.2 , but i remember i can't install opengl on 3.x contrary to v2.6. i will see.
thanks
leonhardt
24-05-2013, 15:47
Hi all.
3rd unofficial preview Irrlicht module wrapper for thinBasic.
Due to file size, we will not attach new release to post.
Please download it from http://www.thinbasic.com/public/products/thinBasic/Scripts/Irrlicht/pv3/Irrlicht_pv3.zip
Size: 4.8Mb
Before using it, please delete all previous sample Irrlicht scripts and related files. We are considering to create a dedicated SetUp_IrrlichtModuleWrapper.exe file for future updates. We will see.
Anyhow, Unzip in thinBasic directory maintaining directory structure.
Then go under thinBasic\SampleScripts\Irrlicht\ and execute thinBasic script samples. If not working let us know.
Attention:
irrlicht.DLL MUST be located into thinBasic.EXE executable folder in order to work. We are thinking how to avoid this but for the moment that is the way
Some thinBasic_Irrlicht module info:
developer: Roberto
module is developed using MS C/C++
thinBasic module wrapper is under development using thinBasic SDK for MS C/C++
irrlicht.DLL is compressed using UPX 3.00w original is about 1.4Mb while the one we distribute is about 510Kb
due to under development status and dll size, we will not deliver this module with official thinBasic release but we will keep a parallel temp project.
Later, when quite stable, we will decide how to go on
Have fun and please let us know if all is working fine on your box.
If not working, please tell us your OS and hardware config.
Ciao
Eros
I think memory resource is still more important than hard disk, if a dll or exe is compressed by UPX,the file size reduces,but it will cost extra memory to run.