Exemple #1
0
        private void CreateBoneLineNode(string filename)
        {
            EZMFile ezmFile = EZMFile.Load(filename);

            ezmFile.LoadTextures();
            var rootElement = this.scene.RootNode;

            for (int i = 0; i < ezmFile.MeshSystem.Meshes.Length; i++)
            {
                EZMMesh mesh  = ezmFile.MeshSystem.Meshes[i];
                var     model = new NodeLineModel(mesh.Skeleton.Bones);
                var     node  = NodeLineNode.Create(model);
                rootElement.Children.Add(node);
            }
        }
        public static NodeLineNode Create(NodeLineModel model)
        {
            var vs    = new VertexShader(vertexCode);
            var fs    = new FragmentShader(fragmentCode);
            var array = new ShaderArray(vs, fs);
            var map   = new AttributeMap();

            map.Add("inPosition", NodeLineModel.strPosition);
            map.Add("inColor", NodeLineModel.strColor);
            var builder = new RenderMethodBuilder(array, map, new LineWidthSwitch(6));
            var node    = new NodeLineNode(model, builder);

            node.Initialize();

            return(node);
        }