Matrix 4 Problem [beginner]

Irrlicht.Net is no longer developed or supported, Irrlicht.Net Cross Platform is a much more complete wrapper. Please ask your C# related questions on their forums first.
Locked
Thorben Linneweber

Matrix 4 Problem [beginner]

Post 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
Thorben Linneweber

Post 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
Sergio Cossa
Posts: 22
Joined: Fri Jun 03, 2005 2:00 pm
Location: Argentina

Post 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.
Sergio Cossa
Argentina
Locked