Page 1 of 1

Matrix 4 Problem [beginner]

Posted: Thu Jul 21, 2005 2:55 pm
by Thorben Linneweber
Hello!

I want to translate the following c++ code into vb.net:

Code: Select all

//Rotate a node on its own X,Y,Z axises
void localRotate(ISceneNode *node, vector3df vRotation){
    matrix4 m = node->getRelativeTransformation();
    matrix4 n;
    n.setRotationDegrees(vRotation);
    m *= n;
    node->setRotation( m.getRotationDegrees() );
}
->

Code: Select all

 
 Private Sub localRotate(ByVal node As Irrlicht.Scene.ISceneNode, ByVal vRotation As Irrlicht.Core.Vector3D)
        Dim m As Irrlicht.Core.Matrix4 = node.RelativeTransformation()
        Dim n As Irrlicht.Core.Matrix4

        n.SetRotationDegrees(vRotation)
        m = n * m

    End Sub
The multiplication of m and n does not work in vb because the operator wasn't made for multiplication of "matrix4".

Do you have any suggestions how to solve my problem?

Thanks
Thorben Linneweber

Posted: Thu Jul 21, 2005 4:52 pm
by Thorben Linneweber
Okay, I solved the problem myself

m = m.op_Multiply(n, m)



I have just another problem with

smgr->getRootSceneNode())->getRotation() [c++ code]

From Irrlicht c++ docu:

"...This is the scene node wich is parent of all scene nodes. The root scene node is a special scene node which only exists to manage all scene nodes. It will not be rendered and cannot be removed from the scene."

The vb.net scenemanager hasn't got "getRootSceneNode". Can you help me
to translate this code into vb.net code? :


Code: Select all

//Rotate a node on the global X,Y,Z axises
void globalRotate(ISceneNode *node, vector3df vRotation){
    matrix4 m;
    m = (smgr->getRootSceneNode())->getAbsoluteTransformation();
    m.transformVect(vRotation);
    node->setRotation(vRotation + node->getRotation());
}

Thorben Linneweber

Posted: Fri Jul 22, 2005 2:34 pm
by Sergio Cossa
I neither can make that translation in C#... will it be that it is not still implemented for. NET?

All the best.