Exemple #1
0
        public Node(NodeTemplate template)
        {
            Translation = new TranslateTransform3D();
            PrimaryRotation = new AxisAngleRotation3D(template.Axis, 0);

            Transform3DGroup group = new Transform3DGroup();
            group.Children.Add(new RotateTransform3D(PrimaryRotation, template.Center));
            group.Children.Add(Translation);
            Transform = group;
        }
Exemple #2
0
 private Node LoadNode(NodeTemplate nt)
 {
     Node node = new Node(nt);
     node.Content = Template.Model.Geometries[nt.Name];
     Nodes[nt.Name] = node;
     foreach (NodeTemplate child in nt.Children)
     {
         node.Children.Add(LoadNode(child));
     }
     return node;
 }
Exemple #3
0
 public virtual void Load(Loader l, Instruction i)
 {
     switch (i.Type)
     {
         case "node":
             string id = i.String();
             node = new NodeTemplate(id);
             Nodes[id] = node;
             if (Root == null)
                 Root = node;
             break;
         case "par": // Parent
             Nodes[i.String()].Children.Add(node);
             break;
         case "cent":
             node.Center = i.Point3D();
             break;
         case "axis":
             node.Axis = i.Vector3D();
             break;
     }
 }