mesh rotation

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
mr.xyz
Posts: 7
Joined: Wed Aug 25, 2010 3:16 pm

mesh rotation

Post by mr.xyz »

Hello, I'm trying to rotate a mesh on a irrlicht generated terrain. I succeeded in rotate my mesh in the Y axis for the direction, and I have the normal of the terrain's triangle where the mesh is. Do you have an idea or a solution ? Thanks !

Here some pictures of my problem :

Image
Image

And my code :

Code: Select all

selectedSceneNode =
            collMan->getSceneNodeAndCollisionPointFromRay(
                verticalLine,
                intersection,
                HitTriangle,
                IDFlag_IsPickable, // This ensures that only nodes that we have set up to be pickable are considered
                0); // Check the entire scene (this is actually the implicit default)

        if(selectedSceneNode != 0)
        {
            if(HitTriangle != lastHitTriangle)
            {
                lastHitTriangle = HitTriangle;

                core::vector3df normal = HitTriangle.getNormal();
*

So how can I rotate my mesh with the normal ?
Post Reply