Пример #1
0
        private SceneNodeBase GetRootElement()
        {
            var bmps = new Bitmap[5];

            for (int i = 0; i < bmps.Length; i++)
            {
                bmps[i] = new Bitmap(string.Format("{0}.png", i));
            }

            var node = LayeredRectangleNode.Create(bmps);

            node.Scale = new vec3(3, -3, 3);
            this.node  = node;
            return(node);
        }
Пример #2
0
        private SceneNodeBase GetRootElement()
        {
            var    bmps   = new Bitmap[5];
            string folder = System.Windows.Forms.Application.StartupPath;

            for (int i = 0; i < bmps.Length; i++)
            {
                bmps[i] = new Bitmap(System.IO.Path.Combine(folder, string.Format("{0}.png", i)));
            }

            var node = LayeredRectangleNode.Create(bmps);

            node.Scale = new vec3(3, -3, 3);
            this.node  = node;
            return(node);
        }
Пример #3
0
        public static LayeredRectangleNode Create(Bitmap[] bitmaps)
        {
            var vs       = new VertexShader(vertexCode);
            var fs       = new FragmentShader(fragmentCode);
            var provider = new ShaderArray(vs, fs);
            var map      = new AttributeMap();

            map.Add(inPosition, LayeredRectangleModel.strPosition);
            map.Add(inUV, LayeredRectangleModel.strUV);
            var builder = new RenderMethodBuilder(provider, map, new BlendFuncSwitch(BlendSrcFactor.SrcAlpha, BlendDestFactor.OneMinusSrcAlpha));
            var node    = new LayeredRectangleNode(new LayeredRectangleModel(), builder);

            node.bitmaps = bitmaps;
            node.Initialize();

            return(node);
        }