irrlicht3D move, turn, align to vector

BlitzMax Forums/BlitzMax Programming/irrlicht3D move, turn, align to vector

UNZ(Posted 2013) [#1]
After pro and con discussion about the common 3d engines ready to use for bmax I decided to go with irrlicht. But I need some help here.

Is there an example of these basic movements? (how is it even possible that they are not implemented already)
I think matrix4 has some methods for calculating this stuff but I can't find a documentation and the complete mod seems to be uncommented...

I need some sort of align to vector to rotate a node to a point in space (another node).
Just like... you know... PointEntity()

BTW:
Is there any finished project with BlitzMax and Irrlicht?


thx


Kryzon(Posted 2013) [#2]
What Irrlicht wrapper are you using? link to it.
We need to see the available transform methods it has.


UNZ(Posted 2013) [#3]
I use gman's irrlicht mod 1.73. http://www.gprogs.com/viewtopic.php?id=450
Just found the b3d style commands. Maybe I can learn from them.


Kryzon(Posted 2013) [#4]
Yeah. Irrlicht deals a bit different with movement.
Every node has that node.setPosition( Vector3df ) method.

This works exactly like a PositionEntity(), where the node\entity is positioned at an absolute, world space value.
With Blitz3D we don't supply a vector object, but we still inform the vector components (those XYZ coordinates).
Dealing with a vector object like Irrlicht allows you more control, because you can transform that vector in several ways before committing it to the node\entity.

Transforming the vector is the way to emulate MoveEntity(), which deals with a "local" vector (a vector we create while considering the node it's being applied to as the origin). It'll displace the entity locally, according to its orientation.
So the Blitz3D lib supplied by GMan does something like the following:
Function MoveEntity( node:ISceneNode, x:Float, y:Float, z:Float )
	[...]
	
	Local dest:Vector3df=Vector3df.createFromVals(x,y,z)
	node.getRelativeTransformation().transformVect(dest)
	node.setPosition(dest)
End Function
Good thing you discovered the Blitz3D lib, it'll be great for you to get familiar with Irrlicht - a good goal is to get familiar enough with this engine to develop your own additions to the B3D framework for it.
I don't know of any finished or even ongoing projects with BMax+Irr, but the module is very well done. I'd only be weary of it not being actively developed - imagine if you find a bug.

In any case, if you go to Irrlicht's homepage you'll find lots of projects made with it and other languages.


UNZ(Posted 2013) [#5]
Thanks,

I think I can figure it out now. :)
The b3d command set is pure gold to learn from.