3d move (Irrlicht)

BlitzMax Forums/BlitzMax Programming/3d move (Irrlicht)

been trying to get Irrlicht 3de egine to work like blitz 3ds for about 2 days and got fairly far. (most impressive feature: IMouseClick(button:int))

now i'm stuck on a, should be, simple problem, i can't get an 'actor' to move 'forwed' or 'strafft' correctly.

the function goes somthing like this:

method IMove(x:int, y:int, z:int)
     kvector3d = knodehandle.getposition()
     xx = kvetcor3d.getx()
     yy = kvector3d.gety()
     zz = kvector3d.getz()
     kvector3d = knodehandle.getrotation()
     pp = kvector3d.getx()
     yy = kvector3d.gety()
     rr = kvector3d.getz()

    ' x (strafft)
    ' y ('up')
    ' z (forwed)
    xx:+ cos(yy) * z
    yy:- sin(yy) * z
    zz:- sin(yy) * z

    knewpos = createvector3d(xx, yy, zz)
    setposition(knewpos)
end method


the code is above is rubbish but i'm at college and didn't bring the actual code. but the problem is i can't think how to make the 'entity' move Relative to its rotation.

thx for any help.

try this (untested):

Function ib3d_MoveEntity(entity:T_irrISceneNode,x:Float,y:Float,z:Float)
	If (entity=Null Or Not entity.isValid()) Then Throw "Entity does not exist or is invalid" 
	Local dest:T_irrVector3df=T_irrVector3df.createFromVals(x,y,z)
	entity.getRelativeTransformation().transformVect(dest)
	entity.setPosition(dest)
EndFunction


cool,thx gman.tho i had to swap the x and z values around to get it to move in the right direction.