Problem with "rotate"

Hi,

I’m currently implementing Collada import for “Render Studio”, you can see the c# source code at : http://rs.codeplex.com/

But I have a problem when loading the “BikeFromXSI” from :
http://collada.org/owl/browse.php?sess= … rtname=ASC

When I remove the rotation, the bike sounds correct, but when I add it, I got a very strange result, where some parts of the bike are not at the correct position and the correct orientation.

You have to concatenate the transforms in the order they occur within the node element.

Thanks a lot Marcus,

It is what I do, here is my code :

it = navigator.Select("child::*", NSManager);
            while (it.MoveNext())
            {
                switch (it.Current.Name)
                {
                    case "lookat":
                        LookAt(it.Current);
                        break;
                    case "matrix":
                        Matrix(it.Current);
                        break;
                    case "rotate":
                        Rotate(it.Current);
                        break;
                    case "scale":
                        Scale(it.Current);
                        break;
                    case "skew":
                        Skew(it.Current);
                        break;
                    case "translate":
                        Translate(it.Current);
                        break;
                    case "instance_geometry":
                        InstanceGeometry(it.Current);
                        break;
                }
            }

        public void Translate(XPathNavigator navigator)
        {
            Node node = _nodes.Peek();

            float[] translation = ConvertString2FloatArray(navigator.Value);
            Vector3 transVector = new Vector3(translation[0], translation[1], translation[2]);

            // Apply all the transformations to the same matrix
            node.Rotation.Translation = node.Rotation.Translation + transVector;
        }


        public void Rotate(XPathNavigator navigator)
        {
            Node node = _nodes.Peek();

            string sid = navigator.GetAttribute("sid", "");
            float[] rotation = ConvertString2FloatArray(navigator.Value);

            double angle = rotation[3] / 180 * System.Math.PI;
            double theta = System.Math.Cos(angle / 2);

            Quaternion q = new Quaternion(theta, rotation[0], rotation[1], rotation[2]);

            // Apply all the transformations to the same matrix
            node.Rotation = node.Rotation * q.ToRotationMatrix();
        }