Irrlicht 3D Engine for PureBasic! *Official Thread*
-
- Addict
- Posts: 1648
- Joined: Mon Sep 20, 2004 3:52 pm
- Contact:
-
- Addict
- Posts: 1648
- Joined: Mon Sep 20, 2004 3:52 pm
- Contact:
While I am wrapping it, you'd be amazed how much I had to add and change to get things working through pbBlade wrote:I had the same feeling, but supposed that it's how the Irrlicht engine works...dagcrack wrote: I dont see why irrlicht works like that... load a mesh into memory and later add a "node" ... weird I would say... one would think that loadmesh will let you set a handle for the mesh and it will be loaded.. and thats about all.
dracflamloc was just wrapping it, isn't he?
-
- Addict
- Posts: 1648
- Joined: Mon Sep 20, 2004 3:52 pm
- Contact:
Essentially thats all addnode does, but by keeping the original mesh unmodified it means you'll always have a copy of the original model and not one with lots of transformations. Otherwise you could be duplicating a transformed mesh. Also, enjoy natively porting irrlicht's entirely C++ Class-based and object-oriented structure to purebasic 
If you can do it go ahead though.

If you can do it go ahead though.
-
- Enthusiast
- Posts: 362
- Joined: Wed Aug 06, 2003 2:49 pm
- Location: Venice - Italy, Japan when possible.
- Contact:
I'm sure that a lot of work is needed.dracflamloc wrote:While I am wrapping it, you'd be amazed how much I had to add and change to get things working through pb
I said "wrapping" to say that you didn't decided how the original engine works

dracflamloc wrote: enjoy natively porting irrlicht's entirely C++ Class-based and object-oriented structure to purebasic





-
- Addict
- Posts: 1648
- Joined: Mon Sep 20, 2004 3:52 pm
- Contact:
make sure you keep a copy of the source somewhere else this time 

( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
LOL but all this things happends because people is LAZY LAME....LAZY SO LAZY THEY ALMOST STOP! and its true.
Really PEOPLE stop being lazy for BACKUPING get a cheap harddrive, you cant?, Get a usb stick... 16 mb even thats enough for backuping code!, you cant?, ,BUY a blank dvd, you can't?, BUY a blank CD, if not. quit this already...
BY THE WAY wheres the opengl support?
Really PEOPLE stop being lazy for BACKUPING get a cheap harddrive, you cant?, Get a usb stick... 16 mb even thats enough for backuping code!, you cant?, ,BUY a blank dvd, you can't?, BUY a blank CD, if not. quit this already...



BY THE WAY wheres the opengl support?
-
- Addict
- Posts: 1648
- Joined: Mon Sep 20, 2004 3:52 pm
- Contact:
-
- Addict
- Posts: 1648
- Joined: Mon Sep 20, 2004 3:52 pm
- Contact:
Source for the library is now available to all, and so it shall stay:
http://www.dracsoft.com/viewdownload.php?id=26
Licensed under the LGPL
http://www.dracsoft.com/viewdownload.php?id=26
Licensed under the LGPL
-
- User
- Posts: 22
- Joined: Sun Feb 15, 2004 5:34 pm
Cannot Compile Irrlicht in PB-
Nevermind, problem solved... it compiled.. I needed to update pb to latest version.
However, the "ship" and "planet" aren't very ship or planet looking and the textures on them don't make sense. anyone else agree?
ALso, are there any more examples or tutorials to use this?
best,
mike
Line 6: Structure Not Found: I3D_GUI_EVENT
The following is the only thing I tried to run (the IrrlichTest.pb file)
----
;**************************
; Test PB_Irrlicht Program
;**************************
;GUI EVENT HANDLER
ProcedureCDLL EventHandler(*EventData.I3D_GUI_EVENT)
If *EventData\eventType=#I3D_EVENT_GUI
If *EventData\flag2=#I3D_GUIEVENT_BUTTON_CLICKED
If *EventData\flag1=102
i3D_Node_SetMaterialFlag(1,#I3D_MATERIALFLAG_WIREFRAME,1)
EndIf
EndIf
EndIf
EndProcedure
;MAIN PROGRAM
ShipData.I3D_NODEDATA
PlanetData.I3D_NODEDATA
If i3D_Initialize3D(#I3D_DRIVER_OPENGL, 640,480,32,0,1,@EventHandler())
;set startup values
InitKeyboard()
i3D_SetShadowColor(255,0,0,0)
i3D_SetBackgroundColor(155,90,90,90)
i3D_SetWindowCaption("Test PB_Irrlicht - Version: " + i3D_GetEngineVersion())
i3D_GUI_SetFont("./fontcourier.bmp")
i3D_LoadMesh("./ship1.ms3d")
i3D_LoadTexture("./ship1.bmp")
i3D_AddAnimatedNode("./ship1.ms3d",1,1,1,1,1)
i3D_AddAnimatedNode("./planet.ms3d",3,1,1,1,1)
i3D_Node_SetMaterialType(1,#I3D_MATERIALTYPE_SPHERE_MAP)
i3D_Node_SetTexture("./ship1.bmp",1,0)
i3D_AddDynamicLight(1,5,5,5,100,255,255,255,100)
i3D_Camera_SetPosition(20,50,20)
i3D_Node_AddDynamicShadow(1)
;create GUI
EditBox1.l = i3D_GUI_CreateEditBox("Edit box sample",101,100,100,250,150,1)
Button1.l = i3D_GUI_CreateButton("Wireframe",102,400,100,500,150)
Static1.l = i3D_GUI_CreateStaticText("Static text is fun!",103,250,250,400,300,0,0)
MsgBox.l = i3D_GUI_CreateMessageBox("Test MsgBox","Testing 1 2 3",104,1,#I3D_GUI_MSGBOX_OK + #I3D_GUI_MSGBOX_CANCEL)
While i3D_IsRunning()
i3D_Camera_PointAtNode(1)
;Start the rendering sequence - ORDER MATTERS
i3D_BeginRender(1,1)
;Render to the screen
i3D_RenderScene()
i3D_RenderGUI()
;Draw2DText must be done between beginrender and endrender, no other time
i3D_Draw2DText("./fontcourier.bmp",10,10,"Hello and welcome to PB_Irrlicht by dracflamloc!",255,255,255,255,0)
i3D_Draw2DText("./fontcourier.bmp",10,30,"http://www.dracsoft.com/",255,255,255,255,0)
i3D_Draw2DText("./fontcourier.bmp",10,50,"X: " + Str(ShipData\xPos),255,255,255,255,0)
i3D_Draw2DText("./fontcourier.bmp",10,70,"Z: " + Str(ShipData\zPos),255,255,255,255,0)
i3D_Draw2DText("./fontcourier.bmp",10,90,"FPS: " + Str(i3D_GetFPS()),255,255,255,255,0)
;End the rendering sequence
i3D_EndRender()
;update data and rotate object
i3D_Node_GetData(1,@ShipData)
i3D_Node_SetRotation(1,ShipData\xRot+0.05,ShipData\yRot+0.05,ShipData\zRot-0.05)
i3D_Node_GetData(3,@PlanetData)
i3D_Node_SetRotation(3,PlanetData\xRot,PlanetData\yRot+0.15,PlanetData\zRot)
;check keypress
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Left)
i3D_Node_SetPosition(1,ShipData\xPos - 0.05,ShipData\yPos,ShipData\zPos)
ElseIf KeyboardPushed(#PB_Key_Right)
i3D_Node_SetPosition(1,ShipData\xPos + 0.05,ShipData\yPos,ShipData\zPos)
ElseIf KeyboardPushed(#PB_Key_Down)
i3D_Node_SetPosition(1,ShipData\xPos,ShipData\yPos,ShipData\zPos + 0.05)
ElseIf KeyboardPushed(#PB_Key_Up)
i3D_Node_SetPosition(1,ShipData\xPos,ShipData\yPos,ShipData\zPos - 0.05)
ElseIf KeyboardPushed(#PB_Key_Escape)
i3D_Close3D()
EndIf
Wend
Else
MessageRequester("Error","Could not initialize the 3D device. Make sure you have PB_Irrlicht.dll")
EndIf
i3D_DoCleanUp()
End
----------
However, the "ship" and "planet" aren't very ship or planet looking and the textures on them don't make sense. anyone else agree?
ALso, are there any more examples or tutorials to use this?
best,
mike
I extracted the library one your website (pb_irrlicht.zip) and then tried to compile the .pb file, IrrlichTest.pb but it won't compile-dracflamloc wrote:Source for the library is now available to all, and so it shall stay:
http://www.dracsoft.com/viewdownload.php?id=26
Licensed under the LGPL
Line 6: Structure Not Found: I3D_GUI_EVENT
The following is the only thing I tried to run (the IrrlichTest.pb file)
----
;**************************
; Test PB_Irrlicht Program
;**************************
;GUI EVENT HANDLER
ProcedureCDLL EventHandler(*EventData.I3D_GUI_EVENT)
If *EventData\eventType=#I3D_EVENT_GUI
If *EventData\flag2=#I3D_GUIEVENT_BUTTON_CLICKED
If *EventData\flag1=102
i3D_Node_SetMaterialFlag(1,#I3D_MATERIALFLAG_WIREFRAME,1)
EndIf
EndIf
EndIf
EndProcedure
;MAIN PROGRAM
ShipData.I3D_NODEDATA
PlanetData.I3D_NODEDATA
If i3D_Initialize3D(#I3D_DRIVER_OPENGL, 640,480,32,0,1,@EventHandler())
;set startup values
InitKeyboard()
i3D_SetShadowColor(255,0,0,0)
i3D_SetBackgroundColor(155,90,90,90)
i3D_SetWindowCaption("Test PB_Irrlicht - Version: " + i3D_GetEngineVersion())
i3D_GUI_SetFont("./fontcourier.bmp")
i3D_LoadMesh("./ship1.ms3d")
i3D_LoadTexture("./ship1.bmp")
i3D_AddAnimatedNode("./ship1.ms3d",1,1,1,1,1)
i3D_AddAnimatedNode("./planet.ms3d",3,1,1,1,1)
i3D_Node_SetMaterialType(1,#I3D_MATERIALTYPE_SPHERE_MAP)
i3D_Node_SetTexture("./ship1.bmp",1,0)
i3D_AddDynamicLight(1,5,5,5,100,255,255,255,100)
i3D_Camera_SetPosition(20,50,20)
i3D_Node_AddDynamicShadow(1)
;create GUI
EditBox1.l = i3D_GUI_CreateEditBox("Edit box sample",101,100,100,250,150,1)
Button1.l = i3D_GUI_CreateButton("Wireframe",102,400,100,500,150)
Static1.l = i3D_GUI_CreateStaticText("Static text is fun!",103,250,250,400,300,0,0)
MsgBox.l = i3D_GUI_CreateMessageBox("Test MsgBox","Testing 1 2 3",104,1,#I3D_GUI_MSGBOX_OK + #I3D_GUI_MSGBOX_CANCEL)
While i3D_IsRunning()
i3D_Camera_PointAtNode(1)
;Start the rendering sequence - ORDER MATTERS
i3D_BeginRender(1,1)
;Render to the screen
i3D_RenderScene()
i3D_RenderGUI()
;Draw2DText must be done between beginrender and endrender, no other time
i3D_Draw2DText("./fontcourier.bmp",10,10,"Hello and welcome to PB_Irrlicht by dracflamloc!",255,255,255,255,0)
i3D_Draw2DText("./fontcourier.bmp",10,30,"http://www.dracsoft.com/",255,255,255,255,0)
i3D_Draw2DText("./fontcourier.bmp",10,50,"X: " + Str(ShipData\xPos),255,255,255,255,0)
i3D_Draw2DText("./fontcourier.bmp",10,70,"Z: " + Str(ShipData\zPos),255,255,255,255,0)
i3D_Draw2DText("./fontcourier.bmp",10,90,"FPS: " + Str(i3D_GetFPS()),255,255,255,255,0)
;End the rendering sequence
i3D_EndRender()
;update data and rotate object
i3D_Node_GetData(1,@ShipData)
i3D_Node_SetRotation(1,ShipData\xRot+0.05,ShipData\yRot+0.05,ShipData\zRot-0.05)
i3D_Node_GetData(3,@PlanetData)
i3D_Node_SetRotation(3,PlanetData\xRot,PlanetData\yRot+0.15,PlanetData\zRot)
;check keypress
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Left)
i3D_Node_SetPosition(1,ShipData\xPos - 0.05,ShipData\yPos,ShipData\zPos)
ElseIf KeyboardPushed(#PB_Key_Right)
i3D_Node_SetPosition(1,ShipData\xPos + 0.05,ShipData\yPos,ShipData\zPos)
ElseIf KeyboardPushed(#PB_Key_Down)
i3D_Node_SetPosition(1,ShipData\xPos,ShipData\yPos,ShipData\zPos + 0.05)
ElseIf KeyboardPushed(#PB_Key_Up)
i3D_Node_SetPosition(1,ShipData\xPos,ShipData\yPos,ShipData\zPos - 0.05)
ElseIf KeyboardPushed(#PB_Key_Escape)
i3D_Close3D()
EndIf
Wend
Else
MessageRequester("Error","Could not initialize the 3D device. Make sure you have PB_Irrlicht.dll")
EndIf
i3D_DoCleanUp()
End
----------
-
- Addict
- Posts: 1648
- Joined: Mon Sep 20, 2004 3:52 pm
- Contact: