Пример #1
0
        public static DrawModesNode Create(IBufferSource model, string position, string color, vec3 size)
        {
            RenderMethodBuilder smoothBulder, flatBuilder;
            var lineWidthSwitch = new LineWidthSwitch(7);
            {
                var vs    = new VertexShader(vertexCode);
                var fs    = new FragmentShader(fragmentCode);
                var array = new ShaderArray(vs, fs);
                var map   = new AttributeMap();
                map.Add("inPosition", position);
                map.Add("inColor", color);
                //var pointSizeSwitch = new PointSizeSwitch(7);
                smoothBulder = new RenderMethodBuilder(array, map, lineWidthSwitch);
            }
            {
                var vs    = new VertexShader(flatVertexCode);
                var fs    = new FragmentShader(flatFragmentCode);
                var array = new ShaderArray(vs, fs);
                var map   = new AttributeMap();
                map.Add("inPosition", position);
                map.Add("inColor", color);
                //var pointSizeSwitch = new PointSizeSwitch(7);
                flatBuilder = new RenderMethodBuilder(array, map, lineWidthSwitch);
            }
            var node = new DrawModesNode(model, position, smoothBulder, flatBuilder);

            node.Initialize();
            node.ModelSize = size;

            return(node);
        }
Пример #2
0
        private SceneNodeBase GetRootNode()
        {
            var group = new GroupNode();

            {
                var model = new DrawModesModel();
                var node  = DrawModesNode.Create(model, DrawModesModel.strPosition, DrawModesModel.strColor, model.GetSize());
                group.Children.Add(node);

                this.drawModeNode = node;
                (new FormPropertyGrid(node)).Show();
            }

            return(group);
        }