Exemple #1
0
        public DesignModeAssist(IGLCanvas canvas)
        {
            var       camera = new Camera(new vec3(0, 0, 4), new vec3(0, 0, 0), new vec3(0, 1, 0), CameraType.Perspecitive, canvas.Width, canvas.Height);
            GroupNode group;
            {
                var propeller = new PropellerRenderer()
                {
                    WorldPosition = new vec3(0, -1.5f, 0)
                };
                var clock = new ClockNode();
                group = new GroupNode(propeller, clock);
            }
            var scene = new Scene(camera, canvas)
            {
                ClearColor  = Color.Black.ToVec4(),
                RootElement = group,
            };

            this.scene = scene;

            var list            = new ActionList();
            var transformAction = new TransformAction(scene);

            list.Add(transformAction);
            var renderAction = new RenderAction(scene);

            list.Add(renderAction);
            this.actionList = list;

            this.fullname = canvas.GetType().FullName;
        }
Exemple #2
0
        /// <summary>
        /// Render propeller in modern opengl.
        /// </summary>
        /// <returns></returns>
        public static PropellerRenderer Create()
        {
            var vertexShader   = new VertexShader(vertexCode, "inPositoin", "inColor");
            var fragmentShader = new FragmentShader(fragmentCode);
            var provider       = new ShaderArray(vertexShader, fragmentShader);
            var map            = new AttributeMap();

            map.Add("inPosition", Propeller.strPosition);
            map.Add("inColor", Propeller.strColor);
            var renderer = new PropellerRenderer(new Propeller(), provider, map);

            renderer.Initialize();

            return(renderer);
        }
Exemple #3
0
        /// <summary>
        /// Render propeller in modern opengl.
        /// </summary>
        /// <returns></returns>
        public static PropellerRenderer Create()
        {
            var vs       = new VertexShader(vertexCode);
            var fs       = new FragmentShader(fragmentCode);
            var provider = new ShaderArray(vs, fs);
            var map      = new AttributeMap();

            map.Add("inPosition", Propeller.strPosition);
            map.Add("inColor", Propeller.strColor);
            var model   = new Propeller();
            var builder = new RenderMethodBuilder(provider, map);
            var node    = new PropellerRenderer(model, builder);

            node.Initialize();

            return(node);
        }
        public DesignModeAssist(IGLCanvas canvas)
        {
            var           camera = new Camera(new vec3(0, 0, 4), new vec3(0, 0, 0), new vec3(0, 1, 0), CameraType.Perspecitive, canvas.Width, canvas.Height);
            GroupRenderer group;
            {
                var propeller = new PropellerRenderer()
                {
                    WorldPosition = new vec3(0, -1.5f, 0)
                };
                var clock = new ClockRenderer();
                group = new GroupRenderer(propeller, clock);
            }
            var scene = new Scene(camera, canvas)
            {
                ClearColor  = Color.Black.ToVec4(),
                RootElement = group,
            };

            this.scene    = scene;
            this.fullname = canvas.GetType().FullName;
        }
Exemple #5
0
        public DesignModeAssist(WinGLCanvas canvas, bool designMode, System.ComponentModel.LicenseUsageMode licenseUsageMode)
        {
            var       camera = new Camera(new vec3(0, 0, 4), new vec3(0, 0, 0), new vec3(0, 1, 0), CameraType.Perspecitive, canvas.Width, canvas.Height);
            GroupNode group;
            {
                group = new GroupNode();
                if (designMode)
                {
                    var propeller = new PropellerRenderer()
                    {
                        WorldPosition = new vec3(0, -1.5f, 0)
                    };
                    group.Children.Add(propeller);
                }
                if (licenseUsageMode == System.ComponentModel.LicenseUsageMode.Designtime)
                {
                    var clock = new ClockNode();
                    group.Children.Add(clock);
                }
            }
            var scene = new Scene(camera)
            {
                ClearColor = Color.Black.ToVec4(),
                RootNode   = group,
            };

            this.scene = scene;

            var list            = new ActionList();
            var transformAction = new TransformAction(scene);

            list.Add(transformAction);
            var renderAction = new RenderAction(scene);

            list.Add(renderAction);
            this.actionList = list;

            this.fullname = canvas.GetType().FullName;
        }