Page 6 of 16

Posted: Wed Jan 17, 2007 7:56 pm
by Chrono Syndrome
btw. you speaking german ?
No.

Heh, one more question: How can I set node transparency (like EntityAlpha in B3D) ?

Posted: Thu Jan 18, 2007 9:01 am
by Chrono Syndrome
Bug Report ?
Using this code:

Code: Select all

XIncludeFile "C:\Program Files\PureBasic\Examples\IrrlichtWrapper\PureBasic\IrrlichtWrapper.pbi"

Global *Camera.irr_camera, *RotPoint.irr_node
Define *Cube.irr_node, Dist = -30
Define *KeyEvent.IRR_KEY_EVENT
Define *Texture.irr_texture
Dim *Cones.irr_node(3)

InitIrrlichtWrapperDll()
OpenWindow(0, 0, 0, 800, 600, "--My Test--",  #PB_Window_ScreenCentered)
IrrStartex(#IRR_EDT_DIRECT3D9, 800, 600, #False, #True, #True, 32, #True, #True, #True, WindowID(0))

Procedure SetCamera(Dist.F)
Define X.F, Y.F, Z.F
IrrGetNodePosition(*RotPoint, @X, @Y, @Z)
IrrSetNodePosition(*Camera, X, Y, Z)
IrrMoveNodeRight(*Camera, Dist)
EndProcedure

Procedure.F Wrap(Angle.F)
If Angle >= 360 : Angle - 360 : EndIf
If Angle < 0 : Angle + 360 : EndIf
ProcedureReturn Angle
EndProcedure

Procedure Rotate(*Node, X.F, Y.F, Z.F)
Define OX.F, OY.F, OZ.F
IrrGetNodeRotation(*Node, @OX, @OY, @OZ)
IrrSetNodeRotation(*Node, Wrap(OX + X), Wrap(OY + Y), Wrap(OZ + Z))
EndProcedure

*Camera = IrrAddCamera(0, 0, 0, 0, 0, 0)
*Cube = IrrAddCubeSceneNode(5)
*RotPoint = IrrAddEmptySceneNode()
For I = 0 To 3
*Cones(I) = IrrAddConeSceneNode(20, 20, 2)
IrrSetNodeScale(*Cones(I), 1, 2, 1)
IrrSetNodeRotation(*Cones(I), 0, 0, I * 90)
IrrMoveNodeUp(*Cones(I), 2.5)
IrrSetNodeAllMaterialEmissiveColor(*Cones(I), 0, 0, 180, 0)
IrrAddChildToParent(*Cones(I), *Cube)
Next I
IrrSetNodeAllMaterialEmissiveColor(*Cube, 0, 255, 0, 0)

Define Rot.f, NOP.F, X.F, Y.F, Z.F

SetCamera(Dist)
IrrAddChildToParent(*Camera, *RotPoint)

While IrrRunning()
If IrrKeyEventAvailable() 
*KeyEvent = IrrReadKeyEvent()
If *KeyEvent\direction = #IRR_KEY_DOWN
Select *KeyEvent\key
Case #IRR_KEY_ARROW_LEFT : Rotate(*RotPoint, 0, -5, 0)
Case #IRR_KEY_ARROW_RIGHT : Rotate(*RotPoint, 0, 5, 0)
Case #IRR_KEY_ARROW_UP : Rotate(*RotPoint, 5.001, 0, 0)
Case #IRR_KEY_ARROW_DOWN : Rotate(*RotPoint, -5.001, 0, 0)
Case #IRR_KEY_ADD : If Dist < -10 : Dist + 1 : SetCamera(Dist) : EndIf
Case #IRR_KEY_SUBTRACT : If Dist > -50 : Dist - 1 : SetCamera(Dist) : EndIf
Case #IRR_KEY_ESCAPE : End
EndSelect
EndIf
EndIf

Rotate(*Cube, 0, 0, 1)

IrrBeginScene(0, 0, 0)
IrrDrawScene()
IrrEndScene()

Wend
IrrStop()
FreeIrrlichtWrapperDll()
Try, using DOWN key, rotate camera to position straight under my figure: you will see some weird things...

Posted: Sat Jan 27, 2007 10:19 am
by Chrono Syndrome
AP ?

Posted: Fri Feb 02, 2007 10:47 am
by Chrono Syndrome
Any progress ?

Posted: Wed Feb 14, 2007 9:39 am
by Godai
Anyone ported the pixel lighting example btw?

Posted: Tue Feb 20, 2007 9:28 am
by Godai
Can use vertex transparency without lighting being on? Is this a bug or?

Posted: Thu Feb 22, 2007 12:11 pm
by JoRo
Just a might be stupid question:
Why do we need a Irrlicht wrapper?
As I could see, Irrlicht comes with a dll. Why not simply load the dll als lib and that is all?

Posted: Thu Feb 22, 2007 12:18 pm
by Godai
It's an object oriented engine, so it needs a wrapper to work it's best with PureBasic. That being said, the integration could be better ;)

Posted: Thu Feb 22, 2007 12:36 pm
by JoRo
Hm, I do not really understand, what that means.

I want to use the irrlicht engine for rendering terrains, landscapes, produced with my terrain generator GeoControl.
So, the user interactions would be solved with PB. that then gives the commands to the irrlicht engine.

Is this not possible, or is it more, that I have to think more objectorientated?

I need the functions for loading a 16bit raw terrain, resolution up to 8192, but 4096 would be enough, for textures for those terrains, shadows and lightning and may be GI. Also a inifinte water plane and water shaders.

Can your wrapper do this?

It is really urgent. I want to release the second version in the first half, and if the 3D engine works good, I will have to recode some things, to work in 3D.

Posted: Thu Feb 22, 2007 1:28 pm
by traumatic
JoRo wrote:As I could see, Irrlicht comes with a dll. Why not simply load the dll als lib and that is all?
While it's absolutely possible to directly use the DLL using interfaces
(COM) up to a certain extent, there're still too many things that had to be
changed inside the DLL in order to make it properly work from PureBasic.

For example, a lot of functions return byVal which leads to crashes as
PB can't handle this. Other (necessary) functions aren't exported at all,
meaning you'd have to re-code them in PB or change the DLL accordingly.

Whatever you look at it, the original DLL or LIB can't be used so there
are only two options left: Write a C-ish wrapper and surrender OOP or
change the DLL.

Posted: Thu Feb 22, 2007 1:43 pm
by JoRo
Thanks for that explanation, now I see the problems.
That seems to be a bit a weak point of PB. The Ogre engine does not have a wrapper to PB, and the implementation in PB itself is .............

So, it looks like buying ColdSteel, if it is far enough or using the wrapper here.

Posted: Thu Feb 22, 2007 1:50 pm
by dige
JoRo wrote:The Ogre engine does not have a wrapper to PB, and the implementation in PB itself is .............
No, the Ogre PB Engine is going that way:
traumatic wrote: [ ] Write a C-ish wrapper and surrender OOP
[x] change the DLL.
:wink:

Posted: Thu Feb 22, 2007 2:44 pm
by Rings
JoRo wrote:So, it looks like buying ColdSteel, if it is far enough or using the wrapper here.
and fact is that the 'coldsteel' is not more than a wrapper for irrlicht,
as its based on that sources.

Posted: Fri Feb 23, 2007 7:39 am
by JoRo
Well, just tested the wrapper.
Seems, like only the silly 8 bit terrains can be loaded.
I have read that there is a patch for support of 16 bit terrains in Irrlicht.

Posted: Fri Feb 23, 2007 8:13 am
by dige
I could watch Ring's new signature for hours... :P