private void ReadNodeTransform(Node node, XElement nodeElement) { Vector3 translate = nodeElement.Element(Ns + "translate").Value.ToVec3(); node.Translation = Matrix.CreateTranslation(translate); Matrix rotation = Matrix.Identity; IEnumerable<XElement> rotations = nodeElement.Elements(Ns + "rotate"); foreach (var rotationElement in rotations) { Vector3 rot = rotationElement.Value.ToVec3(); float angle = rotationElement.Value.ToFloat(3); rotation = Transform.Rotate(angle, rot)*rotation; } node.Rotation = rotation; Vector3 scale = nodeElement.Element(Ns + "scale").Value.ToVec3(); node.Scale = Matrix.CreateScale(scale); }
private void ReadNodeInfo(Node node, XElement nodeElement) { node.Id = nodeElement.Attribute("id").Value; node.Name = nodeElement.Attribute("name").Value; }